staging: rts5208: sd.c: Alignment fixes
Lining up with open parenthesis found by checkpatch Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Родитель
33f2b12165
Коммит
20390dc72e
|
@ -157,7 +157,8 @@ RTY_SEND_CMD:
|
|||
rtsx_add_cmd(chip, WRITE_REG_CMD, REG_SD_TRANSFER,
|
||||
0xFF, SD_TM_CMD_RSP | SD_TRANSFER_START);
|
||||
rtsx_add_cmd(chip, CHECK_REG_CMD, REG_SD_TRANSFER,
|
||||
SD_TRANSFER_END | SD_STAT_IDLE, SD_TRANSFER_END | SD_STAT_IDLE);
|
||||
SD_TRANSFER_END | SD_STAT_IDLE, SD_TRANSFER_END |
|
||||
SD_STAT_IDLE);
|
||||
|
||||
if (rsp_type == SD_RSP_TYPE_R2) {
|
||||
for (reg_addr = PPBUF_BASE2; reg_addr < PPBUF_BASE2 + 16;
|
||||
|
@ -353,8 +354,8 @@ static int sd_read_data(struct rtsx_chip *chip,
|
|||
}
|
||||
|
||||
static int sd_write_data(struct rtsx_chip *chip, u8 trans_mode,
|
||||
u8 *cmd, int cmd_len, u16 byte_cnt, u16 blk_cnt, u8 bus_width,
|
||||
u8 *buf, int buf_len, int timeout)
|
||||
u8 *cmd, int cmd_len, u16 byte_cnt, u16 blk_cnt,
|
||||
u8 bus_width, u8 *buf, int buf_len, int timeout)
|
||||
{
|
||||
struct sd_info *sd_card = &chip->sd_card;
|
||||
int retval;
|
||||
|
@ -411,8 +412,8 @@ static int sd_write_data(struct rtsx_chip *chip, u8 trans_mode,
|
|||
retval = rtsx_send_cmd(chip, SD_CARD, timeout);
|
||||
if (retval < 0) {
|
||||
if (retval == -ETIMEDOUT) {
|
||||
sd_send_cmd_get_rsp(chip, SEND_STATUS,
|
||||
sd_card->sd_addr, SD_RSP_TYPE_R1, NULL, 0);
|
||||
sd_send_cmd_get_rsp(chip, SEND_STATUS, sd_card->sd_addr,
|
||||
SD_RSP_TYPE_R1, NULL, 0);
|
||||
}
|
||||
|
||||
rtsx_trace(chip);
|
||||
|
@ -723,8 +724,8 @@ static int sd_wait_state_data_ready(struct rtsx_chip *chip, u8 state,
|
|||
|
||||
for (i = 0; i < polling_cnt; i++) {
|
||||
retval = sd_send_cmd_get_rsp(chip, SEND_STATUS,
|
||||
sd_card->sd_addr, SD_RSP_TYPE_R1, rsp,
|
||||
5);
|
||||
sd_card->sd_addr, SD_RSP_TYPE_R1,
|
||||
rsp, 5);
|
||||
if (retval != STATUS_SUCCESS) {
|
||||
rtsx_trace(chip);
|
||||
return STATUS_FAIL;
|
||||
|
@ -851,8 +852,8 @@ static int sd_voltage_switch(struct rtsx_chip *chip)
|
|||
(SD_CMD_STATUS | SD_DAT3_STATUS | SD_DAT2_STATUS |
|
||||
SD_DAT1_STATUS | SD_DAT0_STATUS)) {
|
||||
dev_dbg(rtsx_dev(chip), "SD_BUS_STAT: 0x%x\n", stat);
|
||||
rtsx_write_register(chip, SD_BUS_STAT,
|
||||
SD_CLK_TOGGLE_EN | SD_CLK_FORCE_STOP, 0);
|
||||
rtsx_write_register(chip, SD_BUS_STAT, SD_CLK_TOGGLE_EN |
|
||||
SD_CLK_FORCE_STOP, 0);
|
||||
rtsx_write_register(chip, CARD_CLK_EN, 0xFF, 0);
|
||||
rtsx_trace(chip);
|
||||
return STATUS_FAIL;
|
||||
|
@ -1214,8 +1215,8 @@ static int sd_query_switch_result(struct rtsx_chip *chip, u8 func_group,
|
|||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static int sd_check_switch_mode(struct rtsx_chip *chip, u8 mode,
|
||||
u8 func_group, u8 func_to_switch, u8 bus_width)
|
||||
static int sd_check_switch_mode(struct rtsx_chip *chip, u8 mode, u8 func_group,
|
||||
u8 func_to_switch, u8 bus_width)
|
||||
{
|
||||
struct sd_info *sd_card = &chip->sd_card;
|
||||
int retval;
|
||||
|
@ -1345,7 +1346,9 @@ static int sd_check_switch(struct rtsx_chip *chip,
|
|||
u8 stat;
|
||||
|
||||
retval = sd_check_switch_mode(chip, SD_SWITCH_MODE,
|
||||
func_group, func_to_switch, bus_width);
|
||||
func_group,
|
||||
func_to_switch,
|
||||
bus_width);
|
||||
if (retval == STATUS_SUCCESS) {
|
||||
switch_good = true;
|
||||
break;
|
||||
|
@ -1385,8 +1388,8 @@ static int sd_switch_function(struct rtsx_chip *chip, u8 bus_width)
|
|||
u8 func_to_switch = 0;
|
||||
|
||||
/* Get supported functions */
|
||||
retval = sd_check_switch_mode(chip, SD_CHECK_MODE,
|
||||
NO_ARGUMENT, NO_ARGUMENT, bus_width);
|
||||
retval = sd_check_switch_mode(chip, SD_CHECK_MODE, NO_ARGUMENT,
|
||||
NO_ARGUMENT, bus_width);
|
||||
if (retval != STATUS_SUCCESS) {
|
||||
rtsx_trace(chip);
|
||||
return STATUS_FAIL;
|
||||
|
@ -1596,8 +1599,8 @@ static int sd_sdr_tuning_rx_cmd(struct rtsx_chip *chip, u8 sample_point)
|
|||
cmd[3] = 0;
|
||||
cmd[4] = 0;
|
||||
|
||||
retval = sd_read_data(chip, SD_TM_AUTO_TUNING,
|
||||
cmd, 5, 0x40, 1, SD_BUS_WIDTH_4, NULL, 0, 100);
|
||||
retval = sd_read_data(chip, SD_TM_AUTO_TUNING, cmd, 5, 0x40, 1,
|
||||
SD_BUS_WIDTH_4, NULL, 0, 100);
|
||||
if (retval != STATUS_SUCCESS) {
|
||||
(void)sd_wait_data_idle(chip);
|
||||
|
||||
|
@ -1636,8 +1639,8 @@ static int sd_ddr_tuning_rx_cmd(struct rtsx_chip *chip, u8 sample_point)
|
|||
cmd[3] = 0;
|
||||
cmd[4] = 0;
|
||||
|
||||
retval = sd_read_data(chip, SD_TM_NORMAL_READ,
|
||||
cmd, 5, 64, 1, SD_BUS_WIDTH_4, NULL, 0, 100);
|
||||
retval = sd_read_data(chip, SD_TM_NORMAL_READ, cmd, 5, 64, 1,
|
||||
SD_BUS_WIDTH_4, NULL, 0, 100);
|
||||
if (retval != STATUS_SUCCESS) {
|
||||
(void)sd_wait_data_idle(chip);
|
||||
|
||||
|
@ -1676,8 +1679,8 @@ static int mmc_ddr_tunning_rx_cmd(struct rtsx_chip *chip, u8 sample_point)
|
|||
cmd[3] = 0;
|
||||
cmd[4] = 0;
|
||||
|
||||
retval = sd_read_data(chip, SD_TM_NORMAL_READ,
|
||||
cmd, 5, 0x200, 1, bus_width, NULL, 0, 100);
|
||||
retval = sd_read_data(chip, SD_TM_NORMAL_READ, cmd, 5, 0x200, 1,
|
||||
bus_width, NULL, 0, 100);
|
||||
if (retval != STATUS_SUCCESS) {
|
||||
(void)sd_wait_data_idle(chip);
|
||||
|
||||
|
@ -1770,8 +1773,8 @@ static int sd_ddr_tuning_tx_cmd(struct rtsx_chip *chip, u8 sample_point)
|
|||
cmd[3] = 0;
|
||||
cmd[4] = 0;
|
||||
|
||||
retval = sd_write_data(chip, SD_TM_AUTO_WRITE_2,
|
||||
cmd, 5, 16, 1, bus_width, sd_card->raw_csd, 16, 100);
|
||||
retval = sd_write_data(chip, SD_TM_AUTO_WRITE_2, cmd, 5, 16, 1,
|
||||
bus_width, sd_card->raw_csd, 16, 100);
|
||||
if (retval != STATUS_SUCCESS) {
|
||||
rtsx_clear_sd_error(chip);
|
||||
rtsx_write_register(chip, SD_CFG3, SD_RSP_80CLK_TIMEOUT_EN, 0);
|
||||
|
@ -2002,8 +2005,8 @@ static int sd_ddr_pre_tuning_tx(struct rtsx_chip *chip)
|
|||
continue;
|
||||
|
||||
retval = sd_send_cmd_get_rsp(chip, SEND_STATUS,
|
||||
sd_card->sd_addr, SD_RSP_TYPE_R1, NULL,
|
||||
0);
|
||||
sd_card->sd_addr, SD_RSP_TYPE_R1,
|
||||
NULL, 0);
|
||||
if ((retval == STATUS_SUCCESS) ||
|
||||
!sd_check_err_code(chip, SD_RSP_TIMEOUT))
|
||||
phase_map |= 1 << i;
|
||||
|
@ -2499,8 +2502,8 @@ static int sd_read_lba0(struct rtsx_chip *chip)
|
|||
bus_width = SD_BUS_WIDTH_1;
|
||||
}
|
||||
|
||||
retval = sd_read_data(chip, SD_TM_NORMAL_READ, cmd,
|
||||
5, 512, 1, bus_width, NULL, 0, 100);
|
||||
retval = sd_read_data(chip, SD_TM_NORMAL_READ, cmd, 5, 512, 1,
|
||||
bus_width, NULL, 0, 100);
|
||||
if (retval != STATUS_SUCCESS) {
|
||||
rtsx_clear_sd_error(chip);
|
||||
rtsx_trace(chip);
|
||||
|
@ -2518,8 +2521,8 @@ static int sd_check_wp_state(struct rtsx_chip *chip)
|
|||
u16 sd_card_type;
|
||||
u8 cmd[5], buf[64];
|
||||
|
||||
retval = sd_send_cmd_get_rsp(chip, APP_CMD,
|
||||
sd_card->sd_addr, SD_RSP_TYPE_R1, NULL, 0);
|
||||
retval = sd_send_cmd_get_rsp(chip, APP_CMD, sd_card->sd_addr,
|
||||
SD_RSP_TYPE_R1, NULL, 0);
|
||||
if (retval != STATUS_SUCCESS) {
|
||||
rtsx_trace(chip);
|
||||
return STATUS_FAIL;
|
||||
|
@ -2957,8 +2960,8 @@ static int mmc_test_switch_bus(struct rtsx_chip *chip, u8 width)
|
|||
return SWITCH_ERR;
|
||||
}
|
||||
|
||||
retval = sd_write_data(chip, SD_TM_AUTO_WRITE_3,
|
||||
NULL, 0, byte_cnt, 1, bus_width, buf, len, 100);
|
||||
retval = sd_write_data(chip, SD_TM_AUTO_WRITE_3, NULL, 0, byte_cnt, 1,
|
||||
bus_width, buf, len, 100);
|
||||
if (retval != STATUS_SUCCESS) {
|
||||
rtsx_clear_sd_error(chip);
|
||||
rtsx_write_register(chip, REG_SD_CFG3, 0x02, 0);
|
||||
|
@ -2988,8 +2991,8 @@ static int mmc_test_switch_bus(struct rtsx_chip *chip, u8 width)
|
|||
rtsx_add_cmd(chip, WRITE_REG_CMD, REG_SD_BLOCK_CNT_L, 0xFF, 1);
|
||||
rtsx_add_cmd(chip, WRITE_REG_CMD, REG_SD_BLOCK_CNT_H, 0xFF, 0);
|
||||
|
||||
rtsx_add_cmd(chip, WRITE_REG_CMD, REG_SD_CFG2, 0xFF,
|
||||
SD_CALCULATE_CRC7 | SD_NO_CHECK_CRC16 | SD_NO_WAIT_BUSY_END|
|
||||
rtsx_add_cmd(chip, WRITE_REG_CMD, REG_SD_CFG2, 0xFF, SD_CALCULATE_CRC7 |
|
||||
SD_NO_CHECK_CRC16 | SD_NO_WAIT_BUSY_END |
|
||||
SD_CHECK_CRC7 | SD_RSP_LEN_6);
|
||||
rtsx_add_cmd(chip, WRITE_REG_CMD, CARD_DATA_SOURCE, 0x01,
|
||||
PINGPONG_BUFFER);
|
||||
|
@ -3132,8 +3135,8 @@ static int mmc_switch_timing_bus(struct rtsx_chip *chip, bool switch_ddr)
|
|||
SET_MMC_26M(sd_card);
|
||||
}
|
||||
|
||||
retval = sd_send_cmd_get_rsp(chip, SWITCH,
|
||||
0x03B90100, SD_RSP_TYPE_R1b, rsp, 5);
|
||||
retval = sd_send_cmd_get_rsp(chip, SWITCH, 0x03B90100,
|
||||
SD_RSP_TYPE_R1b, rsp, 5);
|
||||
if ((retval != STATUS_SUCCESS) || (rsp[4] & MMC_SWITCH_ERR))
|
||||
CLR_MMC_HS(sd_card);
|
||||
}
|
||||
|
@ -3416,7 +3419,8 @@ int reset_sd_card(struct rtsx_chip *chip)
|
|||
}
|
||||
} else {
|
||||
retval = rtsx_write_register(chip, FPGA_PULL_CTL,
|
||||
FPGA_SD_PULL_CTL_BIT | 0x20, 0);
|
||||
FPGA_SD_PULL_CTL_BIT |
|
||||
0x20, 0);
|
||||
if (retval != STATUS_SUCCESS) {
|
||||
rtsx_trace(chip);
|
||||
return STATUS_FAIL;
|
||||
|
@ -3587,7 +3591,8 @@ static int wait_data_buf_ready(struct rtsx_chip *chip)
|
|||
sd_card->sd_data_buf_ready = 0;
|
||||
|
||||
retval = sd_send_cmd_get_rsp(chip, SEND_STATUS,
|
||||
sd_card->sd_addr, SD_RSP_TYPE_R1, NULL, 0);
|
||||
sd_card->sd_addr, SD_RSP_TYPE_R1,
|
||||
NULL, 0);
|
||||
if (retval != STATUS_SUCCESS) {
|
||||
rtsx_trace(chip);
|
||||
return STATUS_FAIL;
|
||||
|
@ -3742,8 +3747,8 @@ int sd_rw(struct scsi_cmnd *srb, struct rtsx_chip *chip, u32 start_sector,
|
|||
SD_RSP_TYPE_R1, NULL, 0);
|
||||
}
|
||||
|
||||
retval = sd_send_cmd_get_rsp(chip, STOP_TRANSMISSION,
|
||||
0, SD_RSP_TYPE_R1b, NULL, 0);
|
||||
retval = sd_send_cmd_get_rsp(chip, STOP_TRANSMISSION, 0,
|
||||
SD_RSP_TYPE_R1b, NULL, 0);
|
||||
if (retval != STATUS_SUCCESS) {
|
||||
chip->rw_need_retry = 1;
|
||||
sd_set_err_code(chip, SD_STS_ERR);
|
||||
|
@ -3861,7 +3866,8 @@ int sd_rw(struct scsi_cmnd *srb, struct rtsx_chip *chip, u32 start_sector,
|
|||
}
|
||||
|
||||
retval = sd_send_cmd_get_rsp(chip, WRITE_MULTIPLE_BLOCK,
|
||||
data_addr, SD_RSP_TYPE_R1, NULL, 0);
|
||||
data_addr, SD_RSP_TYPE_R1,
|
||||
NULL, 0);
|
||||
if (retval != STATUS_SUCCESS) {
|
||||
chip->rw_need_retry = 1;
|
||||
rtsx_trace(chip);
|
||||
|
@ -3984,8 +3990,9 @@ int soft_reset_sd_card(struct rtsx_chip *chip)
|
|||
return reset_sd(chip);
|
||||
}
|
||||
|
||||
int ext_sd_send_cmd_get_rsp(struct rtsx_chip *chip, u8 cmd_idx,
|
||||
u32 arg, u8 rsp_type, u8 *rsp, int rsp_len, bool special_check)
|
||||
int ext_sd_send_cmd_get_rsp(struct rtsx_chip *chip, u8 cmd_idx, u32 arg,
|
||||
u8 rsp_type, u8 *rsp, int rsp_len,
|
||||
bool special_check)
|
||||
{
|
||||
int retval;
|
||||
int timeout = 100;
|
||||
|
@ -4373,7 +4380,8 @@ int sd_execute_no_data(struct scsi_cmnd *srb, struct rtsx_chip *chip)
|
|||
if (acmd) {
|
||||
retval = ext_sd_send_cmd_get_rsp(chip, APP_CMD,
|
||||
sd_card->sd_addr,
|
||||
SD_RSP_TYPE_R1, NULL, 0, false);
|
||||
SD_RSP_TYPE_R1, NULL, 0,
|
||||
false);
|
||||
if (retval != STATUS_SUCCESS) {
|
||||
rtsx_trace(chip);
|
||||
goto SD_Execute_Cmd_Failed;
|
||||
|
@ -4492,7 +4500,8 @@ int sd_execute_read_data(struct scsi_cmnd *srb, struct rtsx_chip *chip)
|
|||
|
||||
if (data_len < 512) {
|
||||
retval = ext_sd_send_cmd_get_rsp(chip, SET_BLOCKLEN, data_len,
|
||||
SD_RSP_TYPE_R1, NULL, 0, false);
|
||||
SD_RSP_TYPE_R1, NULL, 0,
|
||||
false);
|
||||
if (retval != STATUS_SUCCESS) {
|
||||
rtsx_trace(chip);
|
||||
goto SD_Execute_Read_Cmd_Failed;
|
||||
|
@ -4510,7 +4519,8 @@ int sd_execute_read_data(struct scsi_cmnd *srb, struct rtsx_chip *chip)
|
|||
if (acmd) {
|
||||
retval = ext_sd_send_cmd_get_rsp(chip, APP_CMD,
|
||||
sd_card->sd_addr,
|
||||
SD_RSP_TYPE_R1, NULL, 0, false);
|
||||
SD_RSP_TYPE_R1, NULL, 0,
|
||||
false);
|
||||
if (retval != STATUS_SUCCESS) {
|
||||
rtsx_trace(chip);
|
||||
goto SD_Execute_Read_Cmd_Failed;
|
||||
|
@ -4588,7 +4598,8 @@ int sd_execute_read_data(struct scsi_cmnd *srb, struct rtsx_chip *chip)
|
|||
rtsx_send_cmd_no_wait(chip);
|
||||
|
||||
retval = rtsx_transfer_data(chip, SD_CARD, scsi_sglist(srb),
|
||||
scsi_bufflen(srb), scsi_sg_count(srb),
|
||||
scsi_bufflen(srb),
|
||||
scsi_sg_count(srb),
|
||||
DMA_FROM_DEVICE, 10000);
|
||||
if (retval < 0) {
|
||||
read_err = true;
|
||||
|
@ -4617,8 +4628,9 @@ int sd_execute_read_data(struct scsi_cmnd *srb, struct rtsx_chip *chip)
|
|||
}
|
||||
|
||||
if (send_cmd12) {
|
||||
retval = ext_sd_send_cmd_get_rsp(chip, STOP_TRANSMISSION,
|
||||
0, SD_RSP_TYPE_R1b, NULL, 0, false);
|
||||
retval = ext_sd_send_cmd_get_rsp(chip, STOP_TRANSMISSION, 0,
|
||||
SD_RSP_TYPE_R1b, NULL, 0,
|
||||
false);
|
||||
if (retval != STATUS_SUCCESS) {
|
||||
rtsx_trace(chip);
|
||||
goto SD_Execute_Read_Cmd_Failed;
|
||||
|
@ -4627,7 +4639,8 @@ int sd_execute_read_data(struct scsi_cmnd *srb, struct rtsx_chip *chip)
|
|||
|
||||
if (data_len < 512) {
|
||||
retval = ext_sd_send_cmd_get_rsp(chip, SET_BLOCKLEN, 0x200,
|
||||
SD_RSP_TYPE_R1, NULL, 0, false);
|
||||
SD_RSP_TYPE_R1, NULL, 0,
|
||||
false);
|
||||
if (retval != STATUS_SUCCESS) {
|
||||
rtsx_trace(chip);
|
||||
goto SD_Execute_Read_Cmd_Failed;
|
||||
|
@ -4779,7 +4792,8 @@ int sd_execute_write_data(struct scsi_cmnd *srb, struct rtsx_chip *chip)
|
|||
|
||||
if (data_len < 512) {
|
||||
retval = ext_sd_send_cmd_get_rsp(chip, SET_BLOCKLEN, data_len,
|
||||
SD_RSP_TYPE_R1, NULL, 0, false);
|
||||
SD_RSP_TYPE_R1, NULL, 0,
|
||||
false);
|
||||
if (retval != STATUS_SUCCESS) {
|
||||
rtsx_trace(chip);
|
||||
goto SD_Execute_Write_Cmd_Failed;
|
||||
|
@ -4797,7 +4811,8 @@ int sd_execute_write_data(struct scsi_cmnd *srb, struct rtsx_chip *chip)
|
|||
if (acmd) {
|
||||
retval = ext_sd_send_cmd_get_rsp(chip, APP_CMD,
|
||||
sd_card->sd_addr,
|
||||
SD_RSP_TYPE_R1, NULL, 0, false);
|
||||
SD_RSP_TYPE_R1, NULL, 0,
|
||||
false);
|
||||
if (retval != STATUS_SUCCESS) {
|
||||
rtsx_trace(chip);
|
||||
goto SD_Execute_Write_Cmd_Failed;
|
||||
|
@ -4909,7 +4924,8 @@ int sd_execute_write_data(struct scsi_cmnd *srb, struct rtsx_chip *chip)
|
|||
rtsx_send_cmd_no_wait(chip);
|
||||
|
||||
retval = rtsx_transfer_data(chip, SD_CARD, scsi_sglist(srb),
|
||||
scsi_bufflen(srb), scsi_sg_count(srb),
|
||||
scsi_bufflen(srb),
|
||||
scsi_sg_count(srb),
|
||||
DMA_TO_DEVICE, 10000);
|
||||
|
||||
} else {
|
||||
|
@ -4954,8 +4970,9 @@ int sd_execute_write_data(struct scsi_cmnd *srb, struct rtsx_chip *chip)
|
|||
}
|
||||
|
||||
if (send_cmd12) {
|
||||
retval = ext_sd_send_cmd_get_rsp(chip, STOP_TRANSMISSION,
|
||||
0, SD_RSP_TYPE_R1b, NULL, 0, false);
|
||||
retval = ext_sd_send_cmd_get_rsp(chip, STOP_TRANSMISSION, 0,
|
||||
SD_RSP_TYPE_R1b, NULL, 0,
|
||||
false);
|
||||
if (retval != STATUS_SUCCESS) {
|
||||
rtsx_trace(chip);
|
||||
goto SD_Execute_Write_Cmd_Failed;
|
||||
|
@ -4964,7 +4981,8 @@ int sd_execute_write_data(struct scsi_cmnd *srb, struct rtsx_chip *chip)
|
|||
|
||||
if (data_len < 512) {
|
||||
retval = ext_sd_send_cmd_get_rsp(chip, SET_BLOCKLEN, 0x200,
|
||||
SD_RSP_TYPE_R1, NULL, 0, false);
|
||||
SD_RSP_TYPE_R1, NULL, 0,
|
||||
false);
|
||||
if (retval != STATUS_SUCCESS) {
|
||||
rtsx_trace(chip);
|
||||
goto SD_Execute_Write_Cmd_Failed;
|
||||
|
|
Загрузка…
Ссылка в новой задаче