diff options
author | Marius Strobl <marius@FreeBSD.org> | 2017-03-06 23:47:59 +0000 |
---|---|---|
committer | Marius Strobl <marius@FreeBSD.org> | 2017-03-06 23:47:59 +0000 |
commit | b440e965da9648c04cceae5371897c50a2673739 (patch) | |
tree | 81dbf61cdb5b4da70ac3137e97a2b8e7312dd798 /sys | |
parent | 98a9874f7b4e58c23754c321cdc032ac41c03cef (diff) | |
download | src-b440e965da9648c04cceae5371897c50a2673739.tar.gz src-b440e965da9648c04cceae5371897c50a2673739.zip |
o Another round fixes for mmc(4), mmcsd(4) and sdhci(4) regarding
comments, marking unused parameters as such, style(9), whitespace,
etc.
o In the mmc(4) bridges and sdhci(4) (bus) front-ends:
- Remove redundant assignments of the default bus_generic_print_child
device method (I've whipped these out of the tree as part of r227843
once, but they keep coming back ...),
- use DEVMETHOD_END,
- use NULL instead of 0 for pointers.
o Trim/adjust includes.
Notes
Notes:
svn path=/head/; revision=314811
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arm/allwinner/a10_mmc.c | 5 | ||||
-rw-r--r-- | sys/arm/amlogic/aml8726/aml8726_mmc.c | 4 | ||||
-rw-r--r-- | sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c | 3 | ||||
-rw-r--r-- | sys/arm/at91/at91_mci.c | 8 | ||||
-rw-r--r-- | sys/arm/broadcom/bcm2835/bcm2835_sdhci.c | 9 | ||||
-rw-r--r-- | sys/arm/lpc/lpc_mmc.c | 16 | ||||
-rw-r--r-- | sys/arm/nvidia/tegra_sdhci.c | 3 | ||||
-rw-r--r-- | sys/arm/ti/ti_sdhci.c | 4 | ||||
-rw-r--r-- | sys/dev/mmc/bridge.h | 13 | ||||
-rw-r--r-- | sys/dev/mmc/host/dwmmc.c | 7 | ||||
-rw-r--r-- | sys/dev/mmc/mmc.c | 36 | ||||
-rw-r--r-- | sys/dev/mmc/mmcbrvar.h | 5 | ||||
-rw-r--r-- | sys/dev/mmc/mmcsd.c | 4 | ||||
-rw-r--r-- | sys/dev/mmc/mmcvar.h | 2 | ||||
-rw-r--r-- | sys/dev/sdhci/fsl_sdhci.c | 12 | ||||
-rw-r--r-- | sys/dev/sdhci/sdhci.c | 44 | ||||
-rw-r--r-- | sys/dev/sdhci/sdhci_acpi.c | 9 | ||||
-rw-r--r-- | sys/dev/sdhci/sdhci_fdt.c | 5 | ||||
-rw-r--r-- | sys/dev/sdhci/sdhci_pci.c | 8 | ||||
-rw-r--r-- | sys/mips/ingenic/jz4780_mmc.c | 4 |
20 files changed, 88 insertions, 113 deletions
diff --git a/sys/arm/allwinner/a10_mmc.c b/sys/arm/allwinner/a10_mmc.c index cfbd74b798b6..40178d04867f 100644 --- a/sys/arm/allwinner/a10_mmc.c +++ b/sys/arm/allwinner/a10_mmc.c @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include <dev/ofw/ofw_bus_subr.h> #include <dev/mmc/bridge.h> -#include <dev/mmc/mmcreg.h> #include <dev/mmc/mmcbrvar.h> #include <arm/allwinner/a10_mmc.h> @@ -898,7 +897,6 @@ static device_method_t a10_mmc_methods[] = { /* Bus interface */ DEVMETHOD(bus_read_ivar, a10_mmc_read_ivar), DEVMETHOD(bus_write_ivar, a10_mmc_write_ivar), - DEVMETHOD(bus_print_child, bus_generic_print_child), /* MMC bridge interface */ DEVMETHOD(mmcbr_update_ios, a10_mmc_update_ios), @@ -918,6 +916,7 @@ static driver_t a10_mmc_driver = { sizeof(struct a10_mmc_softc), }; -DRIVER_MODULE(a10_mmc, simplebus, a10_mmc_driver, a10_mmc_devclass, 0, 0); +DRIVER_MODULE(a10_mmc, simplebus, a10_mmc_driver, a10_mmc_devclass, NULL, + NULL); DRIVER_MODULE(mmc, a10_mmc, mmc_driver, mmc_devclass, NULL, NULL); MODULE_DEPEND(a10_mmc, mmc, 1, 1, 1); diff --git a/sys/arm/amlogic/aml8726/aml8726_mmc.c b/sys/arm/amlogic/aml8726/aml8726_mmc.c index b14dab005890..5af20872a49f 100644 --- a/sys/arm/amlogic/aml8726/aml8726_mmc.c +++ b/sys/arm/amlogic/aml8726/aml8726_mmc.c @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/systm.h> -#include <sys/conf.h> #include <sys/bus.h> #include <sys/kernel.h> #include <sys/module.h> @@ -51,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include <dev/ofw/ofw_bus_subr.h> #include <dev/mmc/bridge.h> -#include <dev/mmc/mmcreg.h> #include <dev/mmc/mmcbrvar.h> #include <arm/amlogic/aml8726/aml8726_mmc.h> @@ -1095,7 +1093,7 @@ static driver_t aml8726_mmc_driver = { static devclass_t aml8726_mmc_devclass; DRIVER_MODULE(aml8726_mmc, simplebus, aml8726_mmc_driver, - aml8726_mmc_devclass, 0, 0); + aml8726_mmc_devclass, NULL, NULL); MODULE_DEPEND(aml8726_mmc, aml8726_gpio, 1, 1, 1); DRIVER_MODULE(mmc, aml8726_mmc, mmc_driver, mmc_devclass, NULL, NULL); MODULE_DEPEND(aml8726_mmc, mmc, 1, 1, 1); diff --git a/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c b/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c index 563eb5738013..4d67b8fdbbff 100644 --- a/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c +++ b/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/systm.h> -#include <sys/conf.h> #include <sys/bus.h> #include <sys/kernel.h> #include <sys/module.h> @@ -1374,7 +1373,7 @@ static driver_t aml8726_sdxc_driver = { static devclass_t aml8726_sdxc_devclass; DRIVER_MODULE(aml8726_sdxc, simplebus, aml8726_sdxc_driver, - aml8726_sdxc_devclass, 0, 0); + aml8726_sdxc_devclass, NULL, NULL); MODULE_DEPEND(aml8726_sdxc, aml8726_gpio, 1, 1, 1); DRIVER_MODULE(mmc, aml8726_sdxc, mmc_driver, mmc_devclass, NULL, NULL); MODULE_DEPEND(aml8726_sdxc, mmc, 1, 1, 1); diff --git a/sys/arm/at91/at91_mci.c b/sys/arm/at91/at91_mci.c index 477ce9dcc3c5..03ca157968f6 100644 --- a/sys/arm/at91/at91_mci.c +++ b/sys/arm/at91/at91_mci.c @@ -32,23 +32,16 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/systm.h> -#include <sys/bio.h> #include <sys/bus.h> -#include <sys/conf.h> #include <sys/endian.h> #include <sys/kernel.h> -#include <sys/kthread.h> #include <sys/lock.h> #include <sys/malloc.h> #include <sys/module.h> #include <sys/mutex.h> -#include <sys/queue.h> #include <sys/resource.h> #include <sys/rman.h> #include <sys/sysctl.h> -#include <sys/time.h> -#include <sys/timetc.h> -#include <sys/watchdog.h> #include <machine/bus.h> #include <machine/resource.h> @@ -59,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include <arm/at91/at91_pdcreg.h> #include <dev/mmc/bridge.h> -#include <dev/mmc/mmcreg.h> #include <dev/mmc/mmcbrvar.h> #ifdef FDT diff --git a/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c b/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c index f98d07df193c..55288376750d 100644 --- a/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c +++ b/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c @@ -46,9 +46,10 @@ __FBSDID("$FreeBSD$"); #include <dev/mmc/bridge.h> #include <dev/mmc/mmcreg.h> -#include <dev/mmc/mmcbrvar.h> #include <dev/sdhci/sdhci.h> + +#include "mmcbr_if.h" #include "sdhci_if.h" #include "bcm2835_dma.h" @@ -642,7 +643,6 @@ static device_method_t bcm_sdhci_methods[] = { /* Bus interface */ DEVMETHOD(bus_read_ivar, sdhci_generic_read_ivar), DEVMETHOD(bus_write_ivar, sdhci_generic_write_ivar), - DEVMETHOD(bus_print_child, bus_generic_print_child), /* MMC bridge interface */ DEVMETHOD(mmcbr_update_ios, sdhci_generic_update_ios), @@ -665,7 +665,7 @@ static device_method_t bcm_sdhci_methods[] = { DEVMETHOD(sdhci_write_4, bcm_sdhci_write_4), DEVMETHOD(sdhci_write_multi_4, bcm_sdhci_write_multi_4), - { 0, 0 } + DEVMETHOD_END }; static devclass_t bcm_sdhci_devclass; @@ -676,7 +676,8 @@ static driver_t bcm_sdhci_driver = { sizeof(struct bcm_sdhci_softc), }; -DRIVER_MODULE(sdhci_bcm, simplebus, bcm_sdhci_driver, bcm_sdhci_devclass, 0, 0); +DRIVER_MODULE(sdhci_bcm, simplebus, bcm_sdhci_driver, bcm_sdhci_devclass, + NULL, NULL); MODULE_DEPEND(sdhci_bcm, sdhci, 1, 1, 1); DRIVER_MODULE(mmc, sdhci_bcm, mmc_driver, mmc_devclass, NULL, NULL); MODULE_DEPEND(sdhci_bcm, mmc, 1, 1, 1); diff --git a/sys/arm/lpc/lpc_mmc.c b/sys/arm/lpc/lpc_mmc.c index c337d72ef2b9..535bde007ee3 100644 --- a/sys/arm/lpc/lpc_mmc.c +++ b/sys/arm/lpc/lpc_mmc.c @@ -29,24 +29,14 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/systm.h> -#include <sys/bio.h> #include <sys/bus.h> -#include <sys/conf.h> -#include <sys/endian.h> #include <sys/kernel.h> -#include <sys/kthread.h> #include <sys/lock.h> #include <sys/malloc.h> #include <sys/module.h> #include <sys/mutex.h> -#include <sys/queue.h> #include <sys/resource.h> #include <sys/rman.h> -#include <sys/time.h> -#include <sys/timetc.h> -#include <sys/watchdog.h> - -#include <sys/kdb.h> #include <machine/bus.h> #include <machine/resource.h> @@ -56,7 +46,6 @@ __FBSDID("$FreeBSD$"); #include <dev/ofw/ofw_bus_subr.h> #include <dev/mmc/bridge.h> -#include <dev/mmc/mmcreg.h> #include <dev/mmc/mmcbrvar.h> #include <arm/lpc/lpcreg.h> @@ -752,7 +741,6 @@ static device_method_t lpc_mmc_methods[] = { /* Bus interface */ DEVMETHOD(bus_read_ivar, lpc_mmc_read_ivar), DEVMETHOD(bus_write_ivar, lpc_mmc_write_ivar), - DEVMETHOD(bus_print_child, bus_generic_print_child), /* MMC bridge interface */ DEVMETHOD(mmcbr_update_ios, lpc_mmc_update_ios), @@ -761,7 +749,7 @@ static device_method_t lpc_mmc_methods[] = { DEVMETHOD(mmcbr_acquire_host, lpc_mmc_acquire_host), DEVMETHOD(mmcbr_release_host, lpc_mmc_release_host), - { 0, 0 } + DEVMETHOD_END }; static devclass_t lpc_mmc_devclass; @@ -772,6 +760,6 @@ static driver_t lpc_mmc_driver = { sizeof(struct lpc_mmc_softc), }; -DRIVER_MODULE(lpcmmc, simplebus, lpc_mmc_driver, lpc_mmc_devclass, 0, 0); +DRIVER_MODULE(lpcmmc, simplebus, lpc_mmc_driver, lpc_mmc_devclass, NULL, NULL); DRIVER_MODULE(mmc, lpcmmc, mmc_driver, mmc_devclass, NULL, NULL); MODULE_DEPEND(lpcmmc, mmc, 1, 1, 1); diff --git a/sys/arm/nvidia/tegra_sdhci.c b/sys/arm/nvidia/tegra_sdhci.c index ea35410afbeb..9375d3342e6e 100644 --- a/sys/arm/nvidia/tegra_sdhci.c +++ b/sys/arm/nvidia/tegra_sdhci.c @@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$"); #include <sys/systm.h> #include <sys/types.h> #include <sys/bus.h> -#include <sys/callout.h> #include <sys/gpio.h> #include <sys/kernel.h> #include <sys/lock.h> @@ -46,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include <sys/rman.h> #include <sys/sysctl.h> #include <sys/taskqueue.h> -#include <sys/time.h> #include <machine/bus.h> #include <machine/resource.h> @@ -56,7 +54,6 @@ __FBSDID("$FreeBSD$"); #include <dev/extres/hwreset/hwreset.h> #include <dev/gpio/gpiobusvar.h> #include <dev/mmc/bridge.h> -#include <dev/mmc/mmcreg.h> #include <dev/mmc/mmcbrvar.h> #include <dev/ofw/ofw_bus.h> #include <dev/ofw/ofw_bus_subr.h> diff --git a/sys/arm/ti/ti_sdhci.c b/sys/arm/ti/ti_sdhci.c index 16fa9569f040..6ecfb1880910 100644 --- a/sys/arm/ti/ti_sdhci.c +++ b/sys/arm/ti/ti_sdhci.c @@ -692,7 +692,6 @@ static device_method_t ti_sdhci_methods[] = { /* Bus interface */ DEVMETHOD(bus_read_ivar, sdhci_generic_read_ivar), DEVMETHOD(bus_write_ivar, sdhci_generic_write_ivar), - DEVMETHOD(bus_print_child, bus_generic_print_child), /* MMC bridge interface */ DEVMETHOD(mmcbr_update_ios, ti_sdhci_update_ios), @@ -723,7 +722,8 @@ static driver_t ti_sdhci_driver = { sizeof(struct ti_sdhci_softc), }; -DRIVER_MODULE(sdhci_ti, simplebus, ti_sdhci_driver, ti_sdhci_devclass, 0, 0); +DRIVER_MODULE(sdhci_ti, simplebus, ti_sdhci_driver, ti_sdhci_devclass, NULL, + NULL); MODULE_DEPEND(sdhci_ti, sdhci, 1, 1, 1); DRIVER_MODULE(mmc, sdhci_ti, mmc_driver, mmc_devclass, NULL, NULL); MODULE_DEPEND(sdhci_ti, mmc, 1, 1, 1); diff --git a/sys/dev/mmc/bridge.h b/sys/dev/mmc/bridge.h index a26c31ec078d..64a5366b9548 100644 --- a/sys/dev/mmc/bridge.h +++ b/sys/dev/mmc/bridge.h @@ -52,7 +52,7 @@ */ #ifndef DEV_MMC_BRIDGE_H -#define DEV_MMC_BRIDGE_H +#define DEV_MMC_BRIDGE_H #include <sys/bus.h> @@ -60,7 +60,7 @@ * This file defines interfaces for the mmc bridge. The names chosen * are similar to or the same as the names used in Linux to allow for * easy porting of what Linux calls mmc host drivers. I use the - * FreeBSD terminology of bridge and bus for consistancy with other + * FreeBSD terminology of bridge and bus for consistency with other * drivers in the system. This file corresponds roughly to the Linux * linux/mmc/host.h file. * @@ -73,10 +73,9 @@ * to be added to the mmcbus file). * * Attached to the mmc bridge is an mmcbus. The mmcbus is described - * in dev/mmc/bus.h. + * in dev/mmc/mmcbus_if.m. */ - /* * mmc_ios is a structure that is used to store the state of the mmc/sd * bus configuration. This include the bus' clock speed, its voltage, @@ -130,9 +129,9 @@ struct mmc_host { uint32_t host_ocr; uint32_t ocr; uint32_t caps; -#define MMC_CAP_4_BIT_DATA (1 << 0) /* Can do 4-bit data transfers */ -#define MMC_CAP_8_BIT_DATA (1 << 1) /* Can do 8-bit data transfers */ -#define MMC_CAP_HSPEED (1 << 2) /* Can do High Speed transfers */ +#define MMC_CAP_4_BIT_DATA (1 << 0) /* Can do 4-bit data transfers */ +#define MMC_CAP_8_BIT_DATA (1 << 1) /* Can do 8-bit data transfers */ +#define MMC_CAP_HSPEED (1 << 2) /* Can do High Speed transfers */ enum mmc_card_mode mode; struct mmc_ios ios; /* Current state of the host */ }; diff --git a/sys/dev/mmc/host/dwmmc.c b/sys/dev/mmc/host/dwmmc.c index fe08fe96fe8b..5bf5532f428f 100644 --- a/sys/dev/mmc/host/dwmmc.c +++ b/sys/dev/mmc/host/dwmmc.c @@ -43,11 +43,8 @@ __FBSDID("$FreeBSD$"); #include <sys/module.h> #include <sys/malloc.h> #include <sys/rman.h> -#include <sys/timeet.h> -#include <sys/timetc.h> #include <dev/mmc/bridge.h> -#include <dev/mmc/mmcreg.h> #include <dev/mmc/mmcbrvar.h> #include <dev/fdt/fdt_common.h> @@ -1182,7 +1179,7 @@ driver_t dwmmc_driver = { static devclass_t dwmmc_devclass; -DRIVER_MODULE(dwmmc, simplebus, dwmmc_driver, dwmmc_devclass, 0, 0); -DRIVER_MODULE(dwmmc, ofwbus, dwmmc_driver, dwmmc_devclass, 0, 0); +DRIVER_MODULE(dwmmc, simplebus, dwmmc_driver, dwmmc_devclass, NULL, NULL); +DRIVER_MODULE(dwmmc, ofwbus, dwmmc_driver, dwmmc_devclass, NULL, NULL); DRIVER_MODULE(mmc, dwmmc, mmc_driver, mmc_devclass, NULL, NULL); MODULE_DEPEND(dwmmc, mmc, 1, 1, 1); diff --git a/sys/dev/mmc/mmc.c b/sys/dev/mmc/mmc.c index c300ff517fe5..da7431b07ca3 100644 --- a/sys/dev/mmc/mmc.c +++ b/sys/dev/mmc/mmc.c @@ -408,7 +408,8 @@ mmc_wait_for_req(struct mmc_softc *sc, struct mmc_request *req) } static int -mmc_wait_for_request(device_t brdev, device_t reqdev, struct mmc_request *req) +mmc_wait_for_request(device_t brdev, device_t reqdev __unused, + struct mmc_request *req) { struct mmc_softc *sc = device_get_softc(brdev); @@ -768,17 +769,29 @@ mmc_set_timing(struct mmc_softc *sc, int timing) return (err); } +static const uint8_t p8[8] = { + 0x55, 0xAA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +static const uint8_t p8ok[8] = { + 0xAA, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +static const uint8_t p4[4] = { + 0x5A, 0x00, 0x00, 0x00 +}; + +static const uint8_t p4ok[4] = { + 0xA5, 0x00, 0x00, 0x00 +}; + static int mmc_test_bus_width(struct mmc_softc *sc) { struct mmc_command cmd; struct mmc_data data; - int err; uint8_t buf[8]; - uint8_t p8[8] = { 0x55, 0xAA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - uint8_t p8ok[8] = { 0xAA, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - uint8_t p4[4] = { 0x5A, 0x00, 0x00, 0x00, }; - uint8_t p4ok[4] = { 0xA5, 0x00, 0x00, 0x00, }; + int err; if (mmcbr_get_caps(sc->dev) & MMC_CAP_8_BIT_DATA) { mmcbr_set_bus_width(sc->dev, bus_width_8); @@ -792,7 +805,7 @@ mmc_test_bus_width(struct mmc_softc *sc) cmd.flags = MMC_RSP_R1 | MMC_CMD_ADTC; cmd.data = &data; - data.data = p8; + data.data = __DECONST(void *, p8); data.len = 8; data.flags = MMC_DATA_WRITE; mmc_wait_for_cmd(sc, &cmd, 0); @@ -829,7 +842,7 @@ mmc_test_bus_width(struct mmc_softc *sc) cmd.flags = MMC_RSP_R1 | MMC_CMD_ADTC; cmd.data = &data; - data.data = p4; + data.data = __DECONST(void *, p4); data.len = 4; data.flags = MMC_DATA_WRITE; mmc_wait_for_cmd(sc, &cmd, 0); @@ -1291,13 +1304,14 @@ mmc_log_card(device_t dev, struct mmc_ivars *ivar, int newcard) static void mmc_discover_cards(struct mmc_softc *sc) { + u_char switch_res[64]; + uint32_t raw_cid[4]; struct mmc_ivars *ivar = NULL; device_t *devlist; - int err, i, devcount, newcard; - uint32_t raw_cid[4], resp, sec_count, status; device_t child; + int err, i, devcount, newcard; + uint32_t resp, sec_count, status; uint16_t rca = 2; - u_char switch_res[64]; if (bootverbose || mmc_debug) device_printf(sc->dev, "Probing cards\n"); diff --git a/sys/dev/mmc/mmcbrvar.h b/sys/dev/mmc/mmcbrvar.h index 9fc1ab893284..c81f3f1f35ea 100644 --- a/sys/dev/mmc/mmcbrvar.h +++ b/sys/dev/mmc/mmcbrvar.h @@ -49,7 +49,7 @@ * or the SD Card Association to disclose or distribute any technical * information, know-how or other confidential information to any third party. * - * "$FreeBSD$" + * $FreeBSD$ */ #ifndef DEV_MMC_MMCBRVAR_H @@ -57,6 +57,7 @@ #include <dev/mmc/bridge.h> #include <dev/mmc/mmcreg.h> + #include "mmcbr_if.h" enum mmcbr_device_ivars { @@ -100,12 +101,14 @@ MMCBR_ACCESSOR(max_data, MAX_DATA, int) static int __inline mmcbr_update_ios(device_t dev) { + return (MMCBR_UPDATE_IOS(device_get_parent(dev), dev)); } static int __inline mmcbr_get_ro(device_t dev) { + return (MMCBR_GET_RO(device_get_parent(dev), dev)); } diff --git a/sys/dev/mmc/mmcsd.c b/sys/dev/mmc/mmcsd.c index 65005c98bc41..1204044f69a3 100644 --- a/sys/dev/mmc/mmcsd.c +++ b/sys/dev/mmc/mmcsd.c @@ -278,14 +278,14 @@ mmcsd_resume(device_t dev) } static int -mmcsd_open(struct disk *dp) +mmcsd_open(struct disk *dp __unused) { return (0); } static int -mmcsd_close(struct disk *dp) +mmcsd_close(struct disk *dp __unused) { return (0); diff --git a/sys/dev/mmc/mmcvar.h b/sys/dev/mmc/mmcvar.h index c7a4af9945de..7e7808d68d66 100644 --- a/sys/dev/mmc/mmcvar.h +++ b/sys/dev/mmc/mmcvar.h @@ -49,7 +49,7 @@ * or the SD Card Association to disclose or distribute any technical * information, know-how or other confidential information to any third party. * - * "$FreeBSD$" + * $FreeBSD$ */ #ifndef DEV_MMC_MMCVAR_H diff --git a/sys/dev/sdhci/fsl_sdhci.c b/sys/dev/sdhci/fsl_sdhci.c index 7e9a983749b5..15635505caf1 100644 --- a/sys/dev/sdhci/fsl_sdhci.c +++ b/sys/dev/sdhci/fsl_sdhci.c @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); #include <sys/types.h> #include <sys/bus.h> #include <sys/callout.h> -#include <sys/endian.h> #include <sys/kernel.h> #include <sys/libkern.h> #include <sys/lock.h> @@ -60,15 +59,16 @@ __FBSDID("$FreeBSD$"); #endif #include <dev/gpio/gpiobusvar.h> + #include <dev/ofw/ofw_bus.h> #include <dev/ofw/ofw_bus_subr.h> #include <dev/mmc/bridge.h> -#include <dev/mmc/mmcreg.h> -#include <dev/mmc/mmcbrvar.h> #include <dev/sdhci/sdhci.h> #include <dev/sdhci/sdhci_fdt_gpio.h> + +#include "mmcbr_if.h" #include "sdhci_if.h" struct fsl_sdhci_softc { @@ -961,7 +961,6 @@ static device_method_t fsl_sdhci_methods[] = { /* Bus interface */ DEVMETHOD(bus_read_ivar, sdhci_generic_read_ivar), DEVMETHOD(bus_write_ivar, sdhci_generic_write_ivar), - DEVMETHOD(bus_print_child, bus_generic_print_child), /* MMC bridge interface */ DEVMETHOD(mmcbr_update_ios, sdhci_generic_update_ios), @@ -981,7 +980,7 @@ static device_method_t fsl_sdhci_methods[] = { DEVMETHOD(sdhci_write_multi_4, fsl_sdhci_write_multi_4), DEVMETHOD(sdhci_get_card_present,fsl_sdhci_get_card_present), - { 0, 0 } + DEVMETHOD_END }; static devclass_t fsl_sdhci_devclass; @@ -992,7 +991,8 @@ static driver_t fsl_sdhci_driver = { sizeof(struct fsl_sdhci_softc), }; -DRIVER_MODULE(sdhci_fsl, simplebus, fsl_sdhci_driver, fsl_sdhci_devclass, 0, 0); +DRIVER_MODULE(sdhci_fsl, simplebus, fsl_sdhci_driver, fsl_sdhci_devclass, + NULL, NULL); MODULE_DEPEND(sdhci_fsl, sdhci, 1, 1, 1); DRIVER_MODULE(mmc, sdhci_fsl, mmc_driver, mmc_devclass, NULL, NULL); MODULE_DEPEND(sdhci_fsl, mmc, 1, 1, 1); diff --git a/sys/dev/sdhci/sdhci.c b/sys/dev/sdhci/sdhci.c index 845ab4990fc4..7ea25d73553b 100644 --- a/sys/dev/sdhci/sdhci.c +++ b/sys/dev/sdhci/sdhci.c @@ -170,6 +170,7 @@ static void sdhci_reset(struct sdhci_slot *slot, uint8_t mask) { int timeout; + uint32_t clock; if (slot->quirks & SDHCI_QUIRK_NO_CARD_NO_RESET) { if (!SDHCI_GET_CARD_PRESENT(slot->bus, slot)) @@ -179,8 +180,6 @@ sdhci_reset(struct sdhci_slot *slot, uint8_t mask) /* Some controllers need this kick or reset won't work. */ if ((mask & SDHCI_RESET_ALL) == 0 && (slot->quirks & SDHCI_QUIRK_CLOCK_BEFORE_RESET)) { - uint32_t clock; - /* This is to force an update */ clock = slot->clock; slot->clock = 0; @@ -199,7 +198,7 @@ sdhci_reset(struct sdhci_slot *slot, uint8_t mask) * Resets on TI OMAPs and AM335x are incompatible with SDHCI * specification. The reset bit has internal propagation delay, * so a fast read after write returns 0 even if reset process is - * in progress. The workaround is to poll for 1 before polling + * in progress. The workaround is to poll for 1 before polling * for 0. In the worst case, if we miss seeing it asserted the * time we spent waiting is enough to ensure the reset finishes. */ @@ -267,7 +266,7 @@ sdhci_set_clock(struct sdhci_slot *slot, uint32_t clock) /* Turn off the clock. */ clk = RD2(slot, SDHCI_CLOCK_CONTROL); WR2(slot, SDHCI_CLOCK_CONTROL, clk & ~SDHCI_CLOCK_CARD_EN); - /* If no clock requested - left it so. */ + /* If no clock requested - leave it so. */ if (clock == 0) return; @@ -364,7 +363,7 @@ sdhci_set_power(struct sdhci_slot *slot, u_char power) /* Turn off the power. */ pwr = 0; WR1(slot, SDHCI_POWER_CONTROL, pwr); - /* If power down requested - left it so. */ + /* If power down requested - leave it so. */ if (power == 0) return; /* Set voltage. */ @@ -613,7 +612,7 @@ sdhci_init_slot(device_t dev, struct sdhci_slot *slot, int num) if (err != 0 || slot->paddr == 0) { device_printf(dev, "Can't load DMA memory\n"); SDHCI_LOCK_DESTROY(slot); - if(err) + if (err) return (err); else return (EFAULT); @@ -794,7 +793,7 @@ sdhci_generic_resume(struct sdhci_slot *slot) } uint32_t -sdhci_generic_min_freq(device_t brdev, struct sdhci_slot *slot) +sdhci_generic_min_freq(device_t brdev __unused, struct sdhci_slot *slot) { if (slot->version >= SDHCI_SPEC_300) @@ -804,7 +803,7 @@ sdhci_generic_min_freq(device_t brdev, struct sdhci_slot *slot) } bool -sdhci_generic_get_card_present(device_t brdev, struct sdhci_slot *slot) +sdhci_generic_get_card_present(device_t brdev __unused, struct sdhci_slot *slot) { if (slot->opt & SDHCI_NON_REMOVABLE) @@ -847,7 +846,7 @@ sdhci_generic_update_ios(device_t brdev, device_t reqdev) slot->hostctrl &= ~SDHCI_CTRL_HISPD; WR1(slot, SDHCI_HOST_CONTROL, slot->hostctrl); /* Some controllers like reset after bus changes. */ - if(slot->quirks & SDHCI_QUIRK_RESET_ON_IOS) + if (slot->quirks & SDHCI_QUIRK_RESET_ON_IOS) sdhci_reset(slot, SDHCI_RESET_CMD | SDHCI_RESET_DATA); SDHCI_UNLOCK(slot); @@ -885,8 +884,7 @@ sdhci_timeout(void *arg) } static void -sdhci_set_transfer_mode(struct sdhci_slot *slot, - struct mmc_data *data) +sdhci_set_transfer_mode(struct sdhci_slot *slot, struct mmc_data *data) { uint16_t mode; @@ -925,8 +923,10 @@ sdhci_start_command(struct sdhci_slot *slot, struct mmc_command *cmd) return; } - /* Do not issue command if there is no card, clock or power. - * Controller will not detect timeout without clock active. */ + /* + * Do not issue command if there is no card, clock or power. + * Controller will not detect timeout without clock active. + */ if (!SDHCI_GET_CARD_PRESENT(slot->bus, slot) || slot->power == 0 || slot->clock == 0) { @@ -1196,7 +1196,8 @@ sdhci_start(struct sdhci_slot *slot) } int -sdhci_generic_request(device_t brdev, device_t reqdev, struct mmc_request *req) +sdhci_generic_request(device_t brdev __unused, device_t reqdev, + struct mmc_request *req) { struct sdhci_slot *slot = device_get_ivars(reqdev); @@ -1226,7 +1227,7 @@ sdhci_generic_request(device_t brdev, device_t reqdev, struct mmc_request *req) } int -sdhci_generic_get_ro(device_t brdev, device_t reqdev) +sdhci_generic_get_ro(device_t brdev __unused, device_t reqdev) { struct sdhci_slot *slot = device_get_ivars(reqdev); uint32_t val; @@ -1238,7 +1239,7 @@ sdhci_generic_get_ro(device_t brdev, device_t reqdev) } int -sdhci_generic_acquire_host(device_t brdev, device_t reqdev) +sdhci_generic_acquire_host(device_t brdev __unused, device_t reqdev) { struct sdhci_slot *slot = device_get_ivars(reqdev); int err = 0; @@ -1254,7 +1255,7 @@ sdhci_generic_acquire_host(device_t brdev, device_t reqdev) } int -sdhci_generic_release_host(device_t brdev, device_t reqdev) +sdhci_generic_release_host(device_t brdev __unused, device_t reqdev) { struct sdhci_slot *slot = device_get_ivars(reqdev); @@ -1531,6 +1532,8 @@ sdhci_generic_write_ivar(device_t bus, device_t child, int which, uintptr_t value) { struct sdhci_slot *slot = device_get_ivars(child); + uint32_t clock, max_clock; + int i; switch (which) { default: @@ -1546,10 +1549,6 @@ sdhci_generic_write_ivar(device_t bus, device_t child, int which, break; case MMCBR_IVAR_CLOCK: if (value > 0) { - uint32_t max_clock; - uint32_t clock; - int i; - max_clock = slot->max_clk; clock = max_clock; @@ -1560,8 +1559,7 @@ sdhci_generic_write_ivar(device_t bus, device_t child, int which, break; clock >>= 1; } - } - else { + } else { for (i = 0; i < SDHCI_300_MAX_DIVIDER; i += 2) { if (clock <= value) diff --git a/sys/dev/sdhci/sdhci_acpi.c b/sys/dev/sdhci/sdhci_acpi.c index 4f5b2f046683..f4c04fd3dc4f 100644 --- a/sys/dev/sdhci/sdhci_acpi.c +++ b/sys/dev/sdhci/sdhci_acpi.c @@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/systm.h> #include <sys/bus.h> -#include <sys/conf.h> #include <sys/kernel.h> #include <sys/lock.h> #include <sys/module.h> @@ -41,16 +40,14 @@ __FBSDID("$FreeBSD$"); #include <machine/bus.h> #include <machine/resource.h> -#include <machine/stdarg.h> #include <contrib/dev/acpica/include/acpi.h> #include <dev/acpica/acpivar.h> #include <dev/mmc/bridge.h> -#include <dev/mmc/mmcreg.h> -#include <dev/mmc/mmcbrvar.h> -#include "sdhci.h" +#include <dev/sdhci/sdhci.h> + #include "mmcbr_if.h" #include "sdhci_if.h" @@ -192,7 +189,7 @@ sdhci_acpi_find_device(device_t dev) if ((sdhci_acpi_devices[i].uid != 0) && (sdhci_acpi_devices[i].uid != uid)) continue; - return &sdhci_acpi_devices[i]; + return (&sdhci_acpi_devices[i]); } return (NULL); diff --git a/sys/dev/sdhci/sdhci_fdt.c b/sys/dev/sdhci/sdhci_fdt.c index 3bcbe6fa0595..cde19e8306d1 100644 --- a/sys/dev/sdhci/sdhci_fdt.c +++ b/sys/dev/sdhci/sdhci_fdt.c @@ -34,7 +34,6 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/systm.h> #include <sys/bus.h> -#include <sys/conf.h> #include <sys/kernel.h> #include <sys/lock.h> #include <sys/module.h> @@ -46,15 +45,13 @@ __FBSDID("$FreeBSD$"); #include <machine/bus.h> #include <machine/resource.h> -#include <machine/stdarg.h> #include <dev/fdt/fdt_common.h> #include <dev/ofw/ofw_bus.h> #include <dev/ofw/ofw_bus_subr.h> #include <dev/mmc/bridge.h> -#include <dev/mmc/mmcreg.h> -#include <dev/mmc/mmcbrvar.h> + #include <dev/sdhci/sdhci.h> #include "mmcbr_if.h" diff --git a/sys/dev/sdhci/sdhci_pci.c b/sys/dev/sdhci/sdhci_pci.c index 056a05e50457..1f4447966949 100644 --- a/sys/dev/sdhci/sdhci_pci.c +++ b/sys/dev/sdhci/sdhci_pci.c @@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/systm.h> #include <sys/bus.h> -#include <sys/conf.h> #include <sys/kernel.h> #include <sys/lock.h> #include <sys/module.h> @@ -44,20 +43,17 @@ __FBSDID("$FreeBSD$"); #include <machine/bus.h> #include <machine/resource.h> -#include <machine/stdarg.h> #include <dev/mmc/bridge.h> -#include <dev/mmc/mmcreg.h> -#include <dev/mmc/mmcbrvar.h> -#include "sdhci.h" +#include <dev/sdhci/sdhci.h> + #include "mmcbr_if.h" #include "sdhci_if.h" /* * PCI registers */ - #define PCI_SDHCI_IFPIO 0x00 #define PCI_SDHCI_IFDMA 0x01 #define PCI_SDHCI_IFVENDOR 0x02 diff --git a/sys/mips/ingenic/jz4780_mmc.c b/sys/mips/ingenic/jz4780_mmc.c index c74b441cb0a1..190d5cf90124 100644 --- a/sys/mips/ingenic/jz4780_mmc.c +++ b/sys/mips/ingenic/jz4780_mmc.c @@ -968,7 +968,6 @@ static device_method_t jz4780_mmc_methods[] = { /* Bus interface */ DEVMETHOD(bus_read_ivar, jz4780_mmc_read_ivar), DEVMETHOD(bus_write_ivar, jz4780_mmc_write_ivar), - DEVMETHOD(bus_print_child, bus_generic_print_child), /* MMC bridge interface */ DEVMETHOD(mmcbr_update_ios, jz4780_mmc_update_ios), @@ -988,6 +987,7 @@ static driver_t jz4780_mmc_driver = { sizeof(struct jz4780_mmc_softc), }; -DRIVER_MODULE(jzmmc, simplebus, jz4780_mmc_driver, jz4780_mmc_devclass, 0, 0); +DRIVER_MODULE(jzmmc, simplebus, jz4780_mmc_driver, jz4780_mmc_devclass, NULL, + NULL); DRIVER_MODULE(mmc, jzmmc, mmc_driver, mmc_devclass, NULL, NULL); MODULE_DEPEND(jzmmc, mmc, 1, 1, 1); |