diff options
author | Ondrej Zary <linux@zary.sk> | 2023-02-18 23:01:38 +0100 |
---|---|---|
committer | Damien Le Moal <damien.lemoal@opensource.wdc.com> | 2023-03-23 02:29:25 +0100 |
commit | fe027ff984c61f4ac5e79823fef30ced4f46d23d (patch) | |
tree | 674957edeb486b721e4154b502e05349e7a541b8 /drivers/ata | |
parent | ata: pata_parport: remove obsolete changelogs (diff) | |
download | linux-fe027ff984c61f4ac5e79823fef30ced4f46d23d.tar.xz linux-fe027ff984c61f4ac5e79823fef30ced4f46d23d.zip |
ata: pata_parport: move pata_parport.h to drivers/ata/pata_parport
Now that paride is gone, pata_parport.h does not need to be in
include/linux. Move it to drivers/ata/pata_parport.
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
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/aten.c | 3 | ||||
-rw-r--r-- | drivers/ata/pata_parport/bpck.c | 3 | ||||
-rw-r--r-- | drivers/ata/pata_parport/bpck6.c | 3 | ||||
-rw-r--r-- | drivers/ata/pata_parport/comm.c | 3 | ||||
-rw-r--r-- | drivers/ata/pata_parport/dstr.c | 3 | ||||
-rw-r--r-- | drivers/ata/pata_parport/epat.c | 3 | ||||
-rw-r--r-- | drivers/ata/pata_parport/epia.c | 3 | ||||
-rw-r--r-- | drivers/ata/pata_parport/fit2.c | 3 | ||||
-rw-r--r-- | drivers/ata/pata_parport/fit3.c | 3 | ||||
-rw-r--r-- | drivers/ata/pata_parport/friq.c | 3 | ||||
-rw-r--r-- | drivers/ata/pata_parport/frpw.c | 3 | ||||
-rw-r--r-- | drivers/ata/pata_parport/kbic.c | 3 | ||||
-rw-r--r-- | drivers/ata/pata_parport/ktti.c | 3 | ||||
-rw-r--r-- | drivers/ata/pata_parport/on20.c | 3 | ||||
-rw-r--r-- | drivers/ata/pata_parport/on26.c | 3 | ||||
-rw-r--r-- | drivers/ata/pata_parport/pata_parport.c | 2 | ||||
-rw-r--r-- | drivers/ata/pata_parport/pata_parport.h | 96 |
17 files changed, 112 insertions, 31 deletions
diff --git a/drivers/ata/pata_parport/aten.c b/drivers/ata/pata_parport/aten.c index f0d63b8513e0..1bd248c42f8b 100644 --- a/drivers/ata/pata_parport/aten.c +++ b/drivers/ata/pata_parport/aten.c @@ -16,8 +16,7 @@ #include <linux/wait.h> #include <linux/types.h> #include <asm/io.h> - -#include <linux/pata_parport.h> +#include "pata_parport.h" #define j44(a,b) ((((a>>4)&0x0f)|(b&0xf0))^0x88) diff --git a/drivers/ata/pata_parport/bpck.c b/drivers/ata/pata_parport/bpck.c index 472029a21d59..1c5035a09554 100644 --- a/drivers/ata/pata_parport/bpck.c +++ b/drivers/ata/pata_parport/bpck.c @@ -14,8 +14,7 @@ #include <linux/types.h> #include <linux/wait.h> #include <asm/io.h> - -#include <linux/pata_parport.h> +#include "pata_parport.h" #undef r2 #undef w2 diff --git a/drivers/ata/pata_parport/bpck6.c b/drivers/ata/pata_parport/bpck6.c index 683a11131acd..964bc688e280 100644 --- a/drivers/ata/pata_parport/bpck6.c +++ b/drivers/ata/pata_parport/bpck6.c @@ -18,9 +18,8 @@ #include <linux/types.h> #include <asm/io.h> #include <linux/parport.h> - #include "ppc6lnx.c" -#include <linux/pata_parport.h> +#include "pata_parport.h" #define PPCSTRUCT(pi) ((Interface *)(pi->private)) diff --git a/drivers/ata/pata_parport/comm.c b/drivers/ata/pata_parport/comm.c index 0483caa80544..4c2f9ad60ad8 100644 --- a/drivers/ata/pata_parport/comm.c +++ b/drivers/ata/pata_parport/comm.c @@ -15,8 +15,7 @@ #include <linux/types.h> #include <linux/wait.h> #include <asm/io.h> - -#include <linux/pata_parport.h> +#include "pata_parport.h" /* mode codes: 0 nybble reads, 8-bit writes 1 8-bit reads and writes diff --git a/drivers/ata/pata_parport/dstr.c b/drivers/ata/pata_parport/dstr.c index c5af7a5fa636..2524684be206 100644 --- a/drivers/ata/pata_parport/dstr.c +++ b/drivers/ata/pata_parport/dstr.c @@ -14,8 +14,7 @@ #include <linux/types.h> #include <linux/wait.h> #include <asm/io.h> - -#include <linux/pata_parport.h> +#include "pata_parport.h" /* mode codes: 0 nybble reads, 8-bit writes 1 8-bit reads and writes diff --git a/drivers/ata/pata_parport/epat.c b/drivers/ata/pata_parport/epat.c index 0315f98326f8..b146999368ae 100644 --- a/drivers/ata/pata_parport/epat.c +++ b/drivers/ata/pata_parport/epat.c @@ -16,8 +16,7 @@ #include <linux/types.h> #include <linux/wait.h> #include <asm/io.h> - -#include <linux/pata_parport.h> +#include "pata_parport.h" #define j44(a,b) (((a>>4)&0x0f)+(b&0xf0)) #define j53(a,b) (((a>>3)&0x1f)+((b<<4)&0xe0)) diff --git a/drivers/ata/pata_parport/epia.c b/drivers/ata/pata_parport/epia.c index 77869639773d..f6db2f79fe99 100644 --- a/drivers/ata/pata_parport/epia.c +++ b/drivers/ata/pata_parport/epia.c @@ -17,8 +17,7 @@ #include <linux/types.h> #include <linux/wait.h> #include <asm/io.h> - -#include <linux/pata_parport.h> +#include "pata_parport.h" /* mode codes: 0 nybble reads on port 1, 8-bit writes 1 5/3 reads on ports 1 & 2, 8-bit writes diff --git a/drivers/ata/pata_parport/fit2.c b/drivers/ata/pata_parport/fit2.c index 3536d8c07955..fd3b2ce426a5 100644 --- a/drivers/ata/pata_parport/fit2.c +++ b/drivers/ata/pata_parport/fit2.c @@ -20,8 +20,7 @@ #include <linux/types.h> #include <linux/wait.h> #include <asm/io.h> - -#include <linux/pata_parport.h> +#include "pata_parport.h" #define j44(a,b) (((a>>4)&0x0f)|(b&0xf0)) diff --git a/drivers/ata/pata_parport/fit3.c b/drivers/ata/pata_parport/fit3.c index 9f5320c750e2..75df656ac472 100644 --- a/drivers/ata/pata_parport/fit3.c +++ b/drivers/ata/pata_parport/fit3.c @@ -24,8 +24,7 @@ #include <linux/types.h> #include <linux/wait.h> #include <asm/io.h> - -#include <linux/pata_parport.h> +#include "pata_parport.h" #define j44(a,b) (((a>>3)&0x0f)|((b<<1)&0xf0)) diff --git a/drivers/ata/pata_parport/friq.c b/drivers/ata/pata_parport/friq.c index 8883b3c509cc..1647264cd9a8 100644 --- a/drivers/ata/pata_parport/friq.c +++ b/drivers/ata/pata_parport/friq.c @@ -27,8 +27,7 @@ #include <linux/types.h> #include <linux/wait.h> #include <asm/io.h> - -#include <linux/pata_parport.h> +#include "pata_parport.h" #define CMD(x) w2(4);w0(0xff);w0(0xff);w0(0x73);w0(0x73);\ w0(0xc9);w0(0xc9);w0(0x26);w0(0x26);w0(x);w0(x); diff --git a/drivers/ata/pata_parport/frpw.c b/drivers/ata/pata_parport/frpw.c index 1ef8be79d793..3ec0abf16fa6 100644 --- a/drivers/ata/pata_parport/frpw.c +++ b/drivers/ata/pata_parport/frpw.c @@ -20,8 +20,7 @@ #include <linux/types.h> #include <linux/wait.h> #include <asm/io.h> - -#include <linux/pata_parport.h> +#include "pata_parport.h" #define cec4 w2(0xc);w2(0xe);w2(0xe);w2(0xc);w2(4);w2(4);w2(4); #define j44(l,h) (((l>>4)&0x0f)|(h&0xf0)) diff --git a/drivers/ata/pata_parport/kbic.c b/drivers/ata/pata_parport/kbic.c index 29f4f1e14d21..8213e62f8f00 100644 --- a/drivers/ata/pata_parport/kbic.c +++ b/drivers/ata/pata_parport/kbic.c @@ -19,8 +19,7 @@ #include <linux/types.h> #include <linux/wait.h> #include <asm/io.h> - -#include <linux/pata_parport.h> +#include "pata_parport.h" #define r12w() (delay_p,inw(pi->port+1)&0xffff) diff --git a/drivers/ata/pata_parport/ktti.c b/drivers/ata/pata_parport/ktti.c index 742051f6ea10..4890b1f12348 100644 --- a/drivers/ata/pata_parport/ktti.c +++ b/drivers/ata/pata_parport/ktti.c @@ -16,8 +16,7 @@ #include <linux/types.h> #include <linux/wait.h> #include <asm/io.h> - -#include <linux/pata_parport.h> +#include "pata_parport.h" #define j44(a,b) (((a>>4)&0x0f)|(b&0xf0)) diff --git a/drivers/ata/pata_parport/on20.c b/drivers/ata/pata_parport/on20.c index 6956b91efb47..276ace12d490 100644 --- a/drivers/ata/pata_parport/on20.c +++ b/drivers/ata/pata_parport/on20.c @@ -13,8 +13,7 @@ #include <linux/types.h> #include <linux/wait.h> #include <asm/io.h> - -#include <linux/pata_parport.h> +#include "pata_parport.h" #define op(f) w2(4);w0(f);w2(5);w2(0xd);w2(5);w2(0xd);w2(5);w2(4); #define vl(v) w2(4);w0(v);w2(5);w2(7);w2(5);w2(4); diff --git a/drivers/ata/pata_parport/on26.c b/drivers/ata/pata_parport/on26.c index 1d90eb9b541e..dc47a54b121f 100644 --- a/drivers/ata/pata_parport/on26.c +++ b/drivers/ata/pata_parport/on26.c @@ -14,8 +14,7 @@ #include <linux/types.h> #include <linux/wait.h> #include <asm/io.h> - -#include <linux/pata_parport.h> +#include "pata_parport.h" /* mode codes: 0 nybble reads, 8-bit writes 1 8-bit reads and writes diff --git a/drivers/ata/pata_parport/pata_parport.c b/drivers/ata/pata_parport/pata_parport.c index b6499f2160da..b02a7d16551c 100644 --- a/drivers/ata/pata_parport/pata_parport.c +++ b/drivers/ata/pata_parport/pata_parport.c @@ -6,7 +6,7 @@ #include <linux/kernel.h> #include <linux/module.h> #include <linux/parport.h> -#include <linux/pata_parport.h> +#include "pata_parport.h" #define DRV_NAME "pata_parport" diff --git a/drivers/ata/pata_parport/pata_parport.h b/drivers/ata/pata_parport/pata_parport.h new file mode 100644 index 000000000000..bbfa4e63ee85 --- /dev/null +++ b/drivers/ata/pata_parport/pata_parport.h @@ -0,0 +1,96 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * pata_parport.h (c) 1997-8 Grant R. Guenther <grant@torque.net> + * Under the terms of the GPL. + * + * This file defines the interface for parallel port IDE adapter chip drivers. + */ + +#ifndef LINUX_PATA_PARPORT_H +#define LINUX_PATA_PARPORT_H + +#include <linux/libata.h> + +struct pi_adapter { + struct device dev; + struct pi_protocol *proto; /* adapter protocol */ + int port; /* base address of parallel port */ + int mode; /* transfer mode in use */ + int delay; /* adapter delay setting */ + int unit; /* unit number for chained adapters */ + int saved_r0; /* saved port state */ + int saved_r2; /* saved port state */ + unsigned long private; /* for protocol module */ + struct pardevice *pardev; /* pointer to pardevice */ +}; + +/* registers are addressed as (cont,regr) + * cont: 0 for command register file, 1 for control register(s) + * regr: 0-7 for register number. + */ + +/* macros and functions exported to the protocol modules */ +#define delay_p (pi->delay ? udelay(pi->delay) : (void)0) +#define out_p(offs, byte) do { outb(byte, pi->port + offs); delay_p; } while (0) +#define in_p(offs) (delay_p, inb(pi->port + offs)) + +#define w0(byte) out_p(0, byte) +#define r0() in_p(0) +#define w1(byte) out_p(1, byte) +#define r1() in_p(1) +#define w2(byte) out_p(2, byte) +#define r2() in_p(2) +#define w3(byte) out_p(3, byte) +#define w4(byte) out_p(4, byte) +#define r4() in_p(4) +#define w4w(data) do { outw(data, pi->port + 4); delay_p; } while (0) +#define w4l(data) do { outl(data, pi->port + 4); delay_p; } while (0) +#define r4w() (delay_p, inw(pi->port + 4)) +#define r4l() (delay_p, inl(pi->port + 4)) + +struct pi_protocol { + char name[8]; + + int max_mode; + int epp_first; /* modes >= this use 8 ports */ + + int default_delay; + int max_units; /* max chained units probed for */ + + void (*write_regr)(struct pi_adapter *pi, int cont, int regr, int val); + int (*read_regr)(struct pi_adapter *pi, int cont, int regr); + void (*write_block)(struct pi_adapter *pi, char *buf, int count); + void (*read_block)(struct pi_adapter *pi, char *buf, int count); + + void (*connect)(struct pi_adapter *pi); + void (*disconnect)(struct pi_adapter *pi); + + int (*test_port)(struct pi_adapter *pi); + int (*probe_unit)(struct pi_adapter *pi); + int (*test_proto)(struct pi_adapter *pi); + void (*log_adapter)(struct pi_adapter *pi); + + int (*init_proto)(struct pi_adapter *pi); + void (*release_proto)(struct pi_adapter *pi); + struct module *owner; + struct device_driver driver; + struct scsi_host_template sht; +}; + +#define PATA_PARPORT_SHT ATA_PIO_SHT + +int pata_parport_register_driver(struct pi_protocol *pr); +void pata_parport_unregister_driver(struct pi_protocol *pr); + +/** + * module_pata_parport_driver() - Helper macro for registering a pata_parport driver + * @__pi_protocol: pi_protocol struct + * + * Helper macro for pata_parport drivers which do not do anything special in module + * init/exit. This eliminates a lot of boilerplate. Each module may only + * use this macro once, and calling it replaces module_init() and module_exit() + */ +#define module_pata_parport_driver(__pi_protocol) \ + module_driver(__pi_protocol, pata_parport_register_driver, pata_parport_unregister_driver) + +#endif /* LINUX_PATA_PARPORT_H */ |