summaryrefslogtreecommitdiff
path: root/drivers/ata
diff options
context:
space:
mode:
authorOndrej Zary <linux@zary.sk>2023-03-08 01:46:23 +0300
committerDamien Le Moal <damien.lemoal@opensource.wdc.com>2023-03-23 06:22:19 +0300
commit574197379327a55285da561996dfdf985b38d2ea (patch)
tree00851e681da8a9bdd3295579badc206bb7415d76 /drivers/ata
parentb04062789dd5ce2d39996a9a29de8febb771c73f (diff)
downloadlinux-574197379327a55285da561996dfdf985b38d2ea.tar.xz
ata: pata_parport-bpck6: move ppc6_rd_data_byte to bpck6.c and rename
Move ppc6_rd_data_byte to bpck6.c and rename it to bpck6_rd_data_byte Signed-off-by: Ondrej Zary <linux@zary.sk> Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/pata_parport/bpck6.c38
-rw-r--r--drivers/ata/pata_parport/ppc6lnx.c61
2 files changed, 36 insertions, 63 deletions
diff --git a/drivers/ata/pata_parport/bpck6.c b/drivers/ata/pata_parport/bpck6.c
index 32dc9e61e80c..064696b6d68f 100644
--- a/drivers/ata/pata_parport/bpck6.c
+++ b/drivers/ata/pata_parport/bpck6.c
@@ -37,12 +37,46 @@ static void bpck6_send_cmd(struct pi_adapter *pi, u8 cmd)
}
}
+static u8 bpck6_rd_data_byte(struct pi_adapter *pi)
+{
+ u8 data = 0;
+
+ switch (mode_map[pi->mode]) {
+ case PPCMODE_UNI_SW:
+ case PPCMODE_UNI_FW:
+ parport_frob_control(pi->pardev->port, PARPORT_CONTROL_STROBE,
+ PARPORT_CONTROL_INIT);
+ data = parport_read_status(pi->pardev->port);
+ data = ((data & 0x80) >> 1) | ((data & 0x38) >> 3);
+ parport_frob_control(pi->pardev->port, PARPORT_CONTROL_STROBE,
+ PARPORT_CONTROL_STROBE);
+ data |= parport_read_status(pi->pardev->port) & 0xB8;
+ break;
+ case PPCMODE_BI_SW:
+ case PPCMODE_BI_FW:
+ parport_data_reverse(pi->pardev->port);
+ parport_frob_control(pi->pardev->port, PARPORT_CONTROL_STROBE,
+ PARPORT_CONTROL_STROBE | PARPORT_CONTROL_INIT);
+ data = parport_read_data(pi->pardev->port);
+ parport_frob_control(pi->pardev->port, PARPORT_CONTROL_STROBE, 0);
+ parport_data_forward(pi->pardev->port);
+ break;
+ case PPCMODE_EPP_BYTE:
+ case PPCMODE_EPP_WORD:
+ case PPCMODE_EPP_DWORD:
+ pi->pardev->port->ops->epp_read_data(pi->pardev->port, &data, 1, 0);
+ break;
+ }
+
+ return data;
+}
+
static int bpck6_read_regr(struct pi_adapter *pi, int cont, int reg)
{
u8 port = cont ? reg | 8 : reg;
bpck6_send_cmd(pi, port | ACCESS_PORT | ACCESS_READ);
- return ppc6_rd_data_byte(pi);
+ return bpck6_rd_data_byte(pi);
}
static void bpck6_write_regr(struct pi_adapter *pi, int cont, int reg, int val)
@@ -240,7 +274,7 @@ static int bpck6_open(struct pi_adapter *pi)
ppc6_wr_data_byte(pi, RAMSIZE_128K);
bpck6_send_cmd(pi, ACCESS_REG | ACCESS_READ | REG_VERSION);
- if ((ppc6_rd_data_byte(pi) & 0x3F) == 0x0C)
+ if ((bpck6_rd_data_byte(pi) & 0x3F) == 0x0C)
pi->private |= fifo_wait;
return 1;
diff --git a/drivers/ata/pata_parport/ppc6lnx.c b/drivers/ata/pata_parport/ppc6lnx.c
index d3c3968fbfc8..838af60a0d4d 100644
--- a/drivers/ata/pata_parport/ppc6lnx.c
+++ b/drivers/ata/pata_parport/ppc6lnx.c
@@ -68,7 +68,6 @@
//***************************************************************************
static void ppc6_wr_data_byte(struct pi_adapter *pi, u8 data);
-static u8 ppc6_rd_data_byte(struct pi_adapter *pi);
//***************************************************************************
@@ -102,63 +101,3 @@ static void ppc6_wr_data_byte(struct pi_adapter *pi, u8 data)
}
}
}
-
-//***************************************************************************
-
-static u8 ppc6_rd_data_byte(struct pi_adapter *pi)
-{
- u8 data = 0;
-
- switch (mode_map[pi->mode])
- {
- case PPCMODE_UNI_SW :
- case PPCMODE_UNI_FW :
- {
- parport_frob_control(pi->pardev->port,
- PARPORT_CONTROL_STROBE, PARPORT_CONTROL_INIT);
-
- // DELAY
-
- data = parport_read_status(pi->pardev->port);
-
- data = ((data & 0x80) >> 1) | ((data & 0x38) >> 3);
-
- parport_frob_control(pi->pardev->port,
- PARPORT_CONTROL_STROBE, PARPORT_CONTROL_STROBE);
-
- // DELAY
-
- data |= parport_read_status(pi->pardev->port) & 0xB8;
-
- break;
- }
-
- case PPCMODE_BI_SW :
- case PPCMODE_BI_FW :
- {
- parport_data_reverse(pi->pardev->port);
-
- parport_frob_control(pi->pardev->port, PARPORT_CONTROL_STROBE,
- PARPORT_CONTROL_STROBE | PARPORT_CONTROL_INIT);
-
- data = parport_read_data(pi->pardev->port);
-
- parport_frob_control(pi->pardev->port, PARPORT_CONTROL_STROBE, 0);
-
- parport_data_forward(pi->pardev->port);
-
- break;
- }
-
- case PPCMODE_EPP_BYTE :
- case PPCMODE_EPP_WORD :
- case PPCMODE_EPP_DWORD :
- {
- pi->pardev->port->ops->epp_read_data(pi->pardev->port, &data, 1, 0);
-
- break;
- }
- }
-
- return(data);
-}