libsdhcdrivers: Applying formatting Files that are going to be changes in the future commits got formatted.
diff --git a/libsdhcdrivers/include/sdhc/mmc.h b/libsdhcdrivers/include/sdhc/mmc.h index 36bf485..8ba7d4a 100644 --- a/libsdhcdrivers/include/sdhc/mmc.h +++ b/libsdhcdrivers/include/sdhc/mmc.h
@@ -10,16 +10,15 @@ * @TAG(DATA61_BSD) */ -#ifndef _SDHC_MMC_H_ -#define _SDHC_MMC_H_ +#pragma once #include <platsupport/io.h> #include <sdhc/sdio.h> -typedef struct mmc_card* mmc_card_t; +typedef struct mmc_card *mmc_card_t; -typedef void (*mmc_cb)(mmc_card_t mmc_card, int status, size_t bytes_transferred, void* token); +typedef void (*mmc_cb)(mmc_card_t mmc_card, int status, size_t bytes_transferred, void *token); static inline int mmc_block_size(mmc_card_t mmc_card) @@ -37,7 +36,7 @@ * associated with the provided id. * @return 0 on success. */ -int mmc_init(sdio_host_dev_t* sdio, ps_io_ops_t *io_ops, mmc_card_t* mmc_card); +int mmc_init(sdio_host_dev_t *sdio, ps_io_ops_t *io_ops, mmc_card_t *mmc_card); /** Read blocks from the MMC * The client may use either physical or virtual address for the transfer depending @@ -55,7 +54,7 @@ * @return The number of bytes read, negative on failure. */ long mmc_block_read(mmc_card_t mmc_card, unsigned long start_block, int nblocks, - void* vbuf, uintptr_t pbuf, mmc_cb cb, void* token); + void *vbuf, uintptr_t pbuf, mmc_cb cb, void *token); /** Write blocks to the MMC * The client may use either physical or virtual address for the transfer depending @@ -72,7 +71,7 @@ * @return The number of bytes read, negative on failure. */ long mmc_block_write(mmc_card_t mmc_card, unsigned long start_block, int nblocks, - const void* vbuf, uintptr_t pbuf, mmc_cb cb, void* token); + const void *vbuf, uintptr_t pbuf, mmc_cb cb, void *token); /** * Returns the nth IRQ that this underlying device generates @@ -95,5 +94,3 @@ * @return Card capacity in bytes */ unsigned long long mmc_card_capacity(mmc_card_t mmc_card); - -#endif /* _SDHC_MMC_H_ */
diff --git a/libsdhcdrivers/include/sdhc/sdio.h b/libsdhcdrivers/include/sdhc/sdio.h index fbc7005..cdd3c64 100644 --- a/libsdhcdrivers/include/sdhc/sdio.h +++ b/libsdhcdrivers/include/sdhc/sdio.h
@@ -10,8 +10,7 @@ * @TAG(DATA61_BSD) */ -#ifndef SDIO_H -#define SDIO_H +#pragma once /* NOT to be confused with SDHC. This API is universal */ @@ -20,15 +19,15 @@ /* TODO turn this into sdio_cmd */ struct mmc_cmd; struct sdio_host_dev; -typedef void (*sdio_cb)(struct sdio_host_dev* sdio, int status, struct mmc_cmd* cmd, void* token); +typedef void (*sdio_cb)(struct sdio_host_dev *sdio, int status, struct mmc_cmd *cmd, void *token); struct sdio_host_dev { - int (*reset)(struct sdio_host_dev* sdio); - int (*send_command)(struct sdio_host_dev* sdio, struct mmc_cmd *cmd, sdio_cb cb, void* token); - int (*handle_irq)(struct sdio_host_dev* sdio, int irq); - int (*is_voltage_compatible)(struct sdio_host_dev* sdio, int mv); - int (*nth_irq)(struct sdio_host_dev* sdio, int n); - void* priv; + int (*reset)(struct sdio_host_dev *sdio); + int (*send_command)(struct sdio_host_dev *sdio, struct mmc_cmd *cmd, sdio_cb cb, void *token); + int (*handle_irq)(struct sdio_host_dev *sdio, int irq); + int (*is_voltage_compatible)(struct sdio_host_dev *sdio, int mv); + int (*nth_irq)(struct sdio_host_dev *sdio, int n); + void *priv; }; typedef struct sdio_host_dev sdio_host_dev_t; @@ -43,8 +42,7 @@ * @param[in] token A token to pass, unmodified, to the provided callback function. * @return 1 if the provided voltage level is supported */ -static inline int -sdio_send_command(sdio_host_dev_t* sdio, struct mmc_cmd *cmd, sdio_cb cb, void* token) +static inline int sdio_send_command(sdio_host_dev_t *sdio, struct mmc_cmd *cmd, sdio_cb cb, void *token) { return sdio->send_command(sdio, cmd, cb, token); } @@ -55,8 +53,7 @@ * @param[in] mv The voltage to be queried, in millivolts * @return 1 if the provided voltage level is supported */ -static inline int -sdio_is_voltage_compatible(sdio_host_dev_t* sdio, int mv) +static inline int sdio_is_voltage_compatible(sdio_host_dev_t *sdio, int mv) { return sdio->is_voltage_compatible(sdio, mv); } @@ -66,8 +63,7 @@ * @param[in] sdio A handle to an initialised SDIO driver * @return 0 on success */ -static inline int -sdio_reset(sdio_host_dev_t* sdio) +static inline int sdio_reset(sdio_host_dev_t *sdio) { return sdio->reset(sdio); } @@ -78,8 +74,7 @@ * @param[in] n Index of the desired IRQ. * @return The IRQ number, or -1 if n is invalid */ -static inline int -sdio_nth_irq(sdio_host_dev_t* sdio, int n) +static inline int sdio_nth_irq(sdio_host_dev_t *sdio, int n) { return sdio->nth_irq(sdio, n); } @@ -90,8 +85,7 @@ * @param[in] irq The IRQ number that was triggered. * @return 0 if an IRQ was handled */ -static inline int -sdio_handle_irq(sdio_host_dev_t* sdio, int irq) +static inline int sdio_handle_irq(sdio_host_dev_t *sdio, int irq) { return sdio->handle_irq(sdio, irq); } @@ -109,6 +103,4 @@ * @param[out] dev An sdio structure to populate. * @return 0 on success */ -int sdio_init(enum sdio_id id, ps_io_ops_t *io_ops, sdio_host_dev_t* dev); - -#endif /* SDIO_H */ +int sdio_init(enum sdio_id id, ps_io_ops_t *io_ops, sdio_host_dev_t *dev);
diff --git a/libsdhcdrivers/plat_include/exynos4/sdhc/plat/sdio.h b/libsdhcdrivers/plat_include/exynos4/sdhc/plat/sdio.h index e3ee4dd..361f9ac 100644 --- a/libsdhcdrivers/plat_include/exynos4/sdhc/plat/sdio.h +++ b/libsdhcdrivers/plat_include/exynos4/sdhc/plat/sdio.h
@@ -10,8 +10,7 @@ * @TAG(DATA61_BSD) */ -#ifndef _PLAT_SDIO_H_ -#define _PLAT_SDIO_H_ +#pragma once enum sdio_id { SDHC0, @@ -22,6 +21,3 @@ NSDHC, SDHC_DEFAULT = SDHC2 }; - -#endif /* _PLAT_SDIO_H_ */ -
diff --git a/libsdhcdrivers/plat_include/imx6/sdhc/plat/sdio.h b/libsdhcdrivers/plat_include/imx6/sdhc/plat/sdio.h index 57dc786..f551fdb 100644 --- a/libsdhcdrivers/plat_include/imx6/sdhc/plat/sdio.h +++ b/libsdhcdrivers/plat_include/imx6/sdhc/plat/sdio.h
@@ -10,8 +10,7 @@ * @TAG(DATA61_BSD) */ -#ifndef _PLAT_SDIO_H_ -#define _PLAT_SDIO_H_ +#pragma once enum sdio_id { SDHC1, @@ -21,6 +20,3 @@ NSDHC, SDHC_DEFAULT = SDHC4 }; - -#endif /* _PLAT_SDIO_H_ */ -
diff --git a/libsdhcdrivers/src/mmc.c b/libsdhcdrivers/src/mmc.c index 19cf9d0..4cef6c1 100644 --- a/libsdhcdrivers/src/mmc.c +++ b/libsdhcdrivers/src/mmc.c
@@ -27,9 +27,9 @@ #endif struct mmc_completion_token { - struct mmc_card* card; + struct mmc_card *card; mmc_cb cb; - void* token; + void *token; }; @@ -128,9 +128,9 @@ return 0; } -static struct mmc_cmd* -mmc_cmd_new(uint32_t index, uint32_t arg, int rsp_type) { - struct mmc_cmd* cmd; +static struct mmc_cmd *mmc_cmd_new(uint32_t index, uint32_t arg, int rsp_type) +{ + struct mmc_cmd *cmd; cmd = malloc(sizeof(*cmd)); if (cmd) { /* Command */ @@ -147,13 +147,12 @@ return cmd; } -static int -mmc_cmd_add_data(struct mmc_cmd* cmd, void* vbuf, uintptr_t pbuf, uint32_t addr, - uint32_t block_size, uint32_t blocks) +static int mmc_cmd_add_data(struct mmc_cmd *cmd, void *vbuf, uintptr_t pbuf, uint32_t addr, + uint32_t block_size, uint32_t blocks) { - struct mmc_data* d; + struct mmc_data *d; assert(cmd->data == NULL); - d = (struct mmc_data*)malloc(sizeof(*d)); + d = (struct mmc_data *)malloc(sizeof(*d)); if (d) { d->pbuf = pbuf; d->vbuf = vbuf; @@ -167,8 +166,7 @@ } } -static void -mmc_cmd_destroy(struct mmc_cmd* cmd) +static void mmc_cmd_destroy(struct mmc_cmd *cmd) { if (cmd->data) { free(cmd->data); @@ -176,10 +174,10 @@ free(cmd); } -static struct mmc_completion_token* -mmc_new_completion_token(mmc_card_t mmc_card, mmc_cb cb, void* token) { - struct mmc_completion_token* t; - t = (struct mmc_completion_token*)malloc(sizeof(*t)); +static struct mmc_completion_token *mmc_new_completion_token(mmc_card_t mmc_card, mmc_cb cb, void *token) +{ + struct mmc_completion_token *t; + t = (struct mmc_completion_token *)malloc(sizeof(*t)); if (t) { t->card = mmc_card; t->cb = cb; @@ -188,8 +186,7 @@ return t; } -static void -mmc_completion_token_destroy(struct mmc_completion_token* t) +static void mmc_completion_token_destroy(struct mmc_completion_token *t) { free(t); } @@ -197,8 +194,7 @@ /** * MMC/SD/SDIO card registry. */ -static int -mmc_card_registry(mmc_card_t card) +static int mmc_card_registry(mmc_card_t card) { struct mmc_cmd cmd = {.data = NULL}; int ret; @@ -271,8 +267,7 @@ /** * Card voltage validation. */ -static int -mmc_voltage_validation(mmc_card_t card) +static int mmc_voltage_validation(mmc_card_t card) { struct mmc_cmd cmd = {.data = NULL}; int voltage; @@ -342,8 +337,7 @@ } -static int -mmc_reset(mmc_card_t card) +static int mmc_reset(mmc_card_t card) { /* Reset the card with CMD0 */ struct mmc_cmd cmd = {.data = NULL}; @@ -360,14 +354,13 @@ return 0; } -static void -mmc_blockop_completion_cb(struct sdio_host_dev* sdio, int stat, struct mmc_cmd* cmd, - void* token) +static void mmc_blockop_completion_cb(struct sdio_host_dev *sdio, int stat, struct mmc_cmd *cmd, + void *token) { struct mmc_completion_token *t; size_t bytes; - t = (struct mmc_completion_token*)token; + t = (struct mmc_completion_token *)token; if (stat == 0) { bytes = cmd->data->block_size * cmd->data->blocks; } else { @@ -380,8 +373,7 @@ mmc_completion_token_destroy(t); } -int -mmc_init(sdio_host_dev_t* sdio, ps_io_ops_t *io_ops, mmc_card_t* mmc_card) +int mmc_init(sdio_host_dev_t *sdio, ps_io_ops_t *io_ops, mmc_card_t *mmc_card) { mmc_card_t mmc; @@ -422,11 +414,10 @@ return 0; } -long -mmc_block_read(mmc_card_t mmc_card, unsigned long start, - int nblocks, void* vbuf, uintptr_t pbuf, mmc_cb cb, void* token) +long mmc_block_read(mmc_card_t mmc_card, unsigned long start, + int nblocks, void *vbuf, uintptr_t pbuf, mmc_cb cb, void *token) { - struct mmc_cmd* cmd; + struct mmc_cmd *cmd; uint32_t arg; int bs; bs = mmc_block_size(mmc_card); @@ -448,7 +439,7 @@ } /* Send the command */ if (cb) { - struct mmc_completion_token* mmc_token; + struct mmc_completion_token *mmc_token; unsigned long ret; mmc_token = mmc_new_completion_token(mmc_card, cb, token); if (mmc_token == NULL) { @@ -470,11 +461,10 @@ } -long -mmc_block_write(mmc_card_t mmc_card, unsigned long start, int nblocks, - const void* vbuf, uintptr_t pbuf, mmc_cb cb, void* token) +long mmc_block_write(mmc_card_t mmc_card, unsigned long start, int nblocks, + const void *vbuf, uintptr_t pbuf, mmc_cb cb, void *token) { - struct mmc_cmd* cmd; + struct mmc_cmd *cmd; uint32_t arg; int bs; bs = mmc_block_size(mmc_card); @@ -491,14 +481,14 @@ } /* Add a data segment */ - if (mmc_cmd_add_data(cmd, (void*)vbuf, pbuf, start, bs, nblocks)) { + if (mmc_cmd_add_data(cmd, (void *)vbuf, pbuf, start, bs, nblocks)) { mmc_cmd_destroy(cmd); return -1; } /* Send the command */ if (cb) { - struct mmc_completion_token* mmc_token; + struct mmc_completion_token *mmc_token; unsigned long ret; mmc_token = mmc_new_completion_token(mmc_card, cb, token); if (mmc_token == NULL) { @@ -520,8 +510,7 @@ } } -unsigned long long -mmc_card_capacity(mmc_card_t mmc_card) +unsigned long long mmc_card_capacity(mmc_card_t mmc_card) { int ret; unsigned long long capacity; @@ -545,14 +534,12 @@ } -int -mmc_nth_irq(mmc_card_t mmc, int n) +int mmc_nth_irq(mmc_card_t mmc, int n) { return host_nth_irq(mmc, n); } -int -mmc_handle_irq(mmc_card_t mmc, int irq) +int mmc_handle_irq(mmc_card_t mmc, int irq) { return host_handle_irq(mmc, irq); }
diff --git a/libsdhcdrivers/src/mmc.h b/libsdhcdrivers/src/mmc.h index 1e2828a..602172c 100644 --- a/libsdhcdrivers/src/mmc.h +++ b/libsdhcdrivers/src/mmc.h
@@ -10,8 +10,7 @@ * @TAG(DATA61_BSD) */ -#ifndef _MMC_H -#define _MMC_H +#pragma once #include <sdhc/mmc.h> #include "sdhc.h" @@ -104,7 +103,7 @@ struct mmc_data { uintptr_t pbuf; - void* vbuf; + void *vbuf; uint32_t data_addr; uint32_t block_size; uint32_t blocks; @@ -120,9 +119,9 @@ enum mmc_rsp_type rsp_type; /* For async handling */ sdio_cb cb; - void* token; + void *token; /* For queueing */ - struct mmc_cmd* next; + struct mmc_cmd *next; int complete; }; @@ -167,37 +166,32 @@ uint32_t version; uint32_t high_capacity; uint32_t status; - ps_dma_man_t* dalloc; - sdio_host_dev_t* sdio; + ps_dma_man_t *dalloc; + sdio_host_dev_t *sdio; }; -static inline int -host_send_command(struct mmc_card* card, struct mmc_cmd *cmd, sdio_cb cb, void* token) +static inline int host_send_command(struct mmc_card *card, struct mmc_cmd *cmd, sdio_cb cb, void *token) { return sdio_send_command(card->sdio, cmd, cb, token); } -static inline int -host_nth_irq(mmc_card_t card, int n) +static inline int host_nth_irq(mmc_card_t card, int n) { return sdio_nth_irq(card->sdio, n); } -static inline int -host_handle_irq(struct mmc_card* card, int irq) +static inline int host_handle_irq(struct mmc_card *card, int irq) { return sdio_handle_irq(card->sdio, irq); } -static inline int -host_is_voltage_compatible(struct mmc_card* card, int mv) +static inline int host_is_voltage_compatible(struct mmc_card *card, int mv) { return sdio_is_voltage_compatible(card->sdio, mv); } -static inline int -host_reset(struct mmc_card* card) +static inline int host_reset(struct mmc_card *card) { return sdio_reset(card->sdio); } @@ -207,4 +201,3 @@ /* void card_data(...) */ -#endif //_MMC_H
diff --git a/libsdhcdrivers/src/plat/exynos4/sdio.c b/libsdhcdrivers/src/plat/exynos4/sdio.c index a391367..a46e385 100644 --- a/libsdhcdrivers/src/plat/exynos4/sdio.c +++ b/libsdhcdrivers/src/plat/exynos4/sdio.c
@@ -40,16 +40,13 @@ [SDHC4] = SDHC4_IRQ }; -enum sdio_id -sdio_default_id(void) -{ +enum sdio_id sdio_default_id(void) { return SDHC_DEFAULT; } -int -sdio_init(enum sdio_id id, ps_io_ops_t* io_ops, sdio_host_dev_t* dev) +int sdio_init(enum sdio_id id, ps_io_ops_t *io_ops, sdio_host_dev_t *dev) { - void* iobase; + void *iobase; int ret; switch (id) { case SDHC0:
diff --git a/libsdhcdrivers/src/plat/imx6/sdio.c b/libsdhcdrivers/src/plat/imx6/sdio.c index f6ba60c..ac4bbc1 100644 --- a/libsdhcdrivers/src/plat/imx6/sdio.c +++ b/libsdhcdrivers/src/plat/imx6/sdio.c
@@ -36,16 +36,13 @@ [SDHC4] = SDHC4_IRQ }; -enum sdio_id -sdio_default_id(void) -{ +enum sdio_id sdio_default_id(void) { return SDHC_DEFAULT; } -int -sdio_init(enum sdio_id id, ps_io_ops_t* io_ops, sdio_host_dev_t* dev) +int sdio_init(enum sdio_id id, ps_io_ops_t *io_ops, sdio_host_dev_t *dev) { - void* iobase; + void *iobase; int ret; switch (id) { case SDHC1:
diff --git a/libsdhcdrivers/src/sdhc.c b/libsdhcdrivers/src/sdhc.c index c991fcb..a75d7db 100644 --- a/libsdhcdrivers/src/sdhc.c +++ b/libsdhcdrivers/src/sdhc.c
@@ -166,15 +166,13 @@ DMA_MODE_ADMA }; -static inline sdhc_dev_t -sdio_get_sdhc(sdio_host_dev_t* sdio) +static inline sdhc_dev_t sdio_get_sdhc(sdio_host_dev_t *sdio) { return (sdhc_dev_t)sdio->priv; } /** Print uSDHC registers. */ -UNUSED static void -print_sdhc_regs(struct sdhc *host) +UNUSED static void print_sdhc_regs(struct sdhc *host) { int i; for (i = DS_ADDR; i <= HOST_VERSION; i += 0x4) { @@ -182,29 +180,27 @@ } } -static inline enum dma_mode -get_dma_mode(struct sdhc* host, struct mmc_cmd* cmd) -{ - if (cmd->data == NULL) { +static inline enum dma_mode get_dma_mode(struct sdhc *host, struct mmc_cmd *cmd) { + if (cmd->data == NULL) + { return DMA_MODE_NONE; } - if (cmd->data->pbuf == 0) { + if (cmd->data->pbuf == 0) + { return DMA_MODE_NONE; } /* Currently only SDMA supported */ return DMA_MODE_SDMA; } -static inline int -cap_sdma_supported(struct sdhc *host) +static inline int cap_sdma_supported(struct sdhc *host) { uint32_t v; v = readl(host->base + HOST_CTRL_CAP); return !!(v & HOST_CTRL_CAP_DMAS); } -static inline int -cap_max_buffer_size(struct sdhc *host) +static inline int cap_max_buffer_size(struct sdhc *host) { uint32_t v; v = readl(host->base + HOST_CTRL_CAP); @@ -212,19 +208,18 @@ return 512 << v; } -static int -sdhc_next_cmd(sdhc_dev_t host) +static int sdhc_next_cmd(sdhc_dev_t host) { - struct mmc_cmd* cmd = host->cmd_list_head; + struct mmc_cmd *cmd = host->cmd_list_head; uint32_t val; uint32_t mix_ctrl; /* Enable IRQs */ - val = ( INT_STATUS_ADMAE | INT_STATUS_OVRCURE | INT_STATUS_DEBE - | INT_STATUS_DCE | INT_STATUS_DTOE | INT_STATUS_CRM - | INT_STATUS_CINS | INT_STATUS_CIE | INT_STATUS_CEBE - | INT_STATUS_CCE | INT_STATUS_CTOE | INT_STATUS_TC - | INT_STATUS_CC); + val = (INT_STATUS_ADMAE | INT_STATUS_OVRCURE | INT_STATUS_DEBE + | INT_STATUS_DCE | INT_STATUS_DTOE | INT_STATUS_CRM + | INT_STATUS_CINS | INT_STATUS_CIE | INT_STATUS_CEBE + | INT_STATUS_CCE | INT_STATUS_CTOE | INT_STATUS_TC + | INT_STATUS_CC); if (get_dma_mode(host, cmd) == DMA_MODE_NONE) { val |= INT_STATUS_BRR | INT_STATUS_BWR; } @@ -343,15 +338,14 @@ * @param[in] sd_dev The sdhc interface device that triggered * the interrupt event. */ -static int -sdhc_handle_irq(sdio_host_dev_t* sdio, int irq UNUSED) +static int sdhc_handle_irq(sdio_host_dev_t *sdio, int irq UNUSED) { sdhc_dev_t host = sdio_get_sdhc(sdio); - struct mmc_cmd* cmd = host->cmd_list_head; + struct mmc_cmd *cmd = host->cmd_list_head; uint32_t int_status; int_status = readl(host->base + INT_STATUS); - if(!cmd){ + if (!cmd) { /* Clear flags */ writel(int_status, host->base + INT_STATUS); return 0; @@ -471,7 +465,7 @@ assert(cmd->data->vbuf); assert(cmd->complete == 0); if (host->blocks_remaining) { - io_buf = (volatile uint32_t*)((void*)host->base + DATA_BUFF_ACC_PORT); + io_buf = (volatile uint32_t *)((void *)host->base + DATA_BUFF_ACC_PORT); usr_buf = (uint32_t *)cmd->data->vbuf; if (int_status & INT_STATUS_BRR) { /* Buffer Read Ready */ @@ -518,8 +512,7 @@ return 0; } -static int -sdhc_is_voltage_compatible(sdio_host_dev_t* sdio, int mv) +static int sdhc_is_voltage_compatible(sdio_host_dev_t *sdio, int mv) { uint32_t val; sdhc_dev_t host = sdio_get_sdhc(sdio); @@ -531,8 +524,7 @@ } } -static int -sdhc_send_cmd(sdio_host_dev_t* sdio, struct mmc_cmd *cmd, sdio_cb cb, void* token) +static int sdhc_send_cmd(sdio_host_dev_t *sdio, struct mmc_cmd *cmd, sdio_cb cb, void *token) { sdhc_dev_t host = sdio_get_sdhc(sdio); int ret; @@ -573,8 +565,7 @@ } /** Software Reset */ -static int -sdhc_reset(sdio_host_dev_t* sdio) +static int sdhc_reset(sdio_host_dev_t *sdio) { sdhc_dev_t host = sdio_get_sdhc(sdio); uint32_t val; @@ -588,11 +579,11 @@ } while (val & SYS_CTRL_RSTA); /* Enable IRQs */ - val = ( INT_STATUS_ADMAE | INT_STATUS_OVRCURE | INT_STATUS_DEBE - | INT_STATUS_DCE | INT_STATUS_DTOE | INT_STATUS_CRM - | INT_STATUS_CINS | INT_STATUS_BRR | INT_STATUS_BWR - | INT_STATUS_CIE | INT_STATUS_CEBE | INT_STATUS_CCE - | INT_STATUS_CTOE | INT_STATUS_TC | INT_STATUS_CC); + val = (INT_STATUS_ADMAE | INT_STATUS_OVRCURE | INT_STATUS_DEBE + | INT_STATUS_DCE | INT_STATUS_DTOE | INT_STATUS_CRM + | INT_STATUS_CINS | INT_STATUS_BRR | INT_STATUS_BWR + | INT_STATUS_CIE | INT_STATUS_CEBE | INT_STATUS_CCE + | INT_STATUS_CTOE | INT_STATUS_TC | INT_STATUS_CC); writel(val, host->base + INT_STATUS_EN); writel(val, host->base + INT_SIGNAL_EN); @@ -637,7 +628,7 @@ /* Wait until the Command and Data Lines are ready. */ while ((readl(host->base + PRES_STATE) & PRES_STATE_CDIHB) || - (readl(host->base + PRES_STATE) & PRES_STATE_CIHB)); + (readl(host->base + PRES_STATE) & PRES_STATE_CIHB)); /* Send 80 clock ticks to card to power up. */ val = readl(host->base + SYS_CTRL); @@ -660,8 +651,7 @@ return 0; } -static int -sdhc_get_nth_irq(sdio_host_dev_t* sdio, int n) +static int sdhc_get_nth_irq(sdio_host_dev_t *sdio, int n) { sdhc_dev_t host = sdio_get_sdhc(sdio); if (n < 0 || n >= host->nirqs) { @@ -672,9 +662,8 @@ } -int -sdhc_init(void* iobase, const int* irq_table, int nirqs, ps_io_ops_t* io_ops, - sdio_host_dev_t* dev) +int sdhc_init(void *iobase, const int *irq_table, int nirqs, ps_io_ops_t *io_ops, + sdio_host_dev_t *dev) { sdhc_dev_t sdhc; /* Allocate memory for SDHC structure */