Skip to content

Commit

Permalink
Fix style
Browse files Browse the repository at this point in the history
Signed-off-by: juliab <[email protected]>
  • Loading branch information
midnightveil committed Jul 22, 2024
1 parent c112164 commit c83bd7b
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions drivers/blk/mmc/imx/usdhc.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ static struct driver_state {

static inline void reset_driver_and_card_state(void)
{
driver_state = (struct driver_state){
driver_state = (struct driver_state) {
.command = {
.normal = DRIVER_STATE_INIT,
.app_prefix = DRIVER_STATE_INIT,
Expand All @@ -119,7 +119,7 @@ static inline void reset_driver_and_card_state(void)
.data_transfer = DRIVER_STATE_INIT,
};

card_info = (struct card_info){
card_info = (struct card_info) {
.rca = 0,
.ccs = false, /* really: unknown */

Expand Down Expand Up @@ -270,7 +270,8 @@ poll_t send_command(sd_cmd_t cmd, uint32_t cmd_arg)
{
if (cmd.is_app_cmd && driver_state.command.app_prefix != SendStateDone) {
/* See description of App-Specific commands in [SD-PHY] 4.3.9 */
poll_t poll = send_command_inner(&driver_state.command.app_prefix, SD_CMD55_APP_CMD, (uint32_t)card_info.rca << SD_RCA_SHIFT);
poll_t poll = send_command_inner(&driver_state.command.app_prefix, SD_CMD55_APP_CMD,
(uint32_t)card_info.rca << SD_RCA_SHIFT);
if (poll == PollPending) {
return PollPending;
}
Expand Down Expand Up @@ -482,7 +483,7 @@ poll_t perform_card_identification_and_select()
return PollPending;
}

driver_state.command = (struct command_state){};
driver_state.command = (struct command_state) {};
driver_state.card_ident = CardIdentStateIfCond;
fallthrough;

Expand All @@ -491,7 +492,8 @@ poll_t perform_card_identification_and_select()
> [19:16] Voltage supplied (VHS) from Table 4-18
> [15:8 ] Check pattern to any 8-bit pattern.
*/
poll = send_command(SD_CMD8_SEND_IF_COND,(SD_IF_COND_VHS27_36 << SD_IF_COND_VHS_SHIFT) | (IF_COND_CHECK_PATTERN << SD_IF_COND_CHECK_SHIFT));
poll = send_command(SD_CMD8_SEND_IF_COND,
(SD_IF_COND_VHS27_36 << SD_IF_COND_VHS_SHIFT) | (IF_COND_CHECK_PATTERN << SD_IF_COND_CHECK_SHIFT));
if (poll == PollPending) {
return PollPending;
}
Expand Down Expand Up @@ -521,7 +523,7 @@ poll_t perform_card_identification_and_select()
}

driver_state.card_ident = CardIdentStateOpCondInquiry;
driver_state.command = (struct command_state){};
driver_state.command = (struct command_state) {};
fallthrough;

case CardIdentStateOpCondInquiry:
Expand All @@ -543,7 +545,7 @@ poll_t perform_card_identification_and_select()
assert(ocr_register & (SD_OCR_VDD31_32 | SD_OCR_VDD32_33));

driver_state.card_ident = CardIdentStateOpCond;
driver_state.command = (struct command_state){};
driver_state.command = (struct command_state) {};
fallthrough;

case CardIdentStateOpCond:
Expand Down Expand Up @@ -573,7 +575,7 @@ poll_t perform_card_identification_and_select()
if (poll == PollPending) {
return PollPending;
}
driver_state.command = (struct command_state){};
driver_state.command = (struct command_state) {};

ocr_register = usdhc_regs->cmd_rsp0;
if (!(ocr_register & SD_OCR_POWER_UP_STATUS)) {
Expand Down Expand Up @@ -608,7 +610,7 @@ poll_t perform_card_identification_and_select()

card_info.card_state = CardStateIdent;
driver_state.card_ident = CardIdentStateSendRca;
driver_state.command = (struct command_state){};
driver_state.command = (struct command_state) {};
fallthrough;

case CardIdentStateSendRca:
Expand All @@ -628,7 +630,7 @@ poll_t perform_card_identification_and_select()
TODO: Actually do `usdhc_change_clock_frequency(ClockSpeedDefault_25MHz)`
*/
driver_state.card_ident = CardIdentStateSendCsd;
driver_state.command = (struct command_state){};
driver_state.command = (struct command_state) {};
fallthrough;

case CardIdentStateSendCsd:
Expand All @@ -640,7 +642,7 @@ poll_t perform_card_identification_and_select()
read_r2_response(card_info.csd);

driver_state.card_ident = CardIdentStateCardSelect;
driver_state.command = (struct command_state){};
driver_state.command = (struct command_state) {};
fallthrough;

case CardIdentStateCardSelect:
Expand All @@ -653,7 +655,7 @@ poll_t perform_card_identification_and_select()
card_info.card_state = CardStateTran;

driver_state.card_ident = CardIdentStateDone;
driver_state.command = (struct command_state){};
driver_state.command = (struct command_state) {};
fallthrough;

case CardIdentStateDone:
Expand Down Expand Up @@ -702,7 +704,7 @@ poll_t usdhc_read_blocks(uintptr_t dma_address, uint32_t sector_number, uint16_t
usdhc_regs->blk_att |= ((uint32_t)sector_count << USDHC_BLK_ATT_BLKCNT_SHIFT);

driver_state.data_transfer = DataStateSend;
driver_state.command = (struct command_state){};
driver_state.command = (struct command_state) {};
fallthrough;

case DataStateSend:
Expand All @@ -717,14 +719,14 @@ poll_t usdhc_read_blocks(uintptr_t dma_address, uint32_t sector_number, uint16_t
} else {
data_address = sector_number * SD_BLOCK_SIZE;
}
poll = send_command( SD_CMD18_READ_MULTIPLE_BLOCK, data_address);
poll = send_command(SD_CMD18_READ_MULTIPLE_BLOCK, data_address);
if (poll == PollPending) {
return PollPending;
}

card_info.card_state = CardStateData;
driver_state.data_transfer = DataStateTransfer;
driver_state.command = (struct command_state){};
driver_state.command = (struct command_state) {};
return PollPending; // wait for IRQ.

case DataStateTransfer:
Expand Down Expand Up @@ -785,7 +787,7 @@ poll_t usdhc_write_blocks(uintptr_t dma_address, uint32_t sector_number, uint16_
usdhc_regs->blk_att |= ((uint32_t)sector_count << USDHC_BLK_ATT_BLKCNT_SHIFT);

driver_state.data_transfer = DataStateSend;
driver_state.command = (struct command_state){};
driver_state.command = (struct command_state) {};
fallthrough;

case DataStateSend:
Expand All @@ -807,7 +809,7 @@ poll_t usdhc_write_blocks(uintptr_t dma_address, uint32_t sector_number, uint16_

card_info.card_state = CardStateRcv;
driver_state.data_transfer = DataStateTransfer;
driver_state.command = (struct command_state){};
driver_state.command = (struct command_state) {};
return PollPending; // wait for IRQ.

case DataStateTransfer:
Expand Down

0 comments on commit c83bd7b

Please sign in to comment.