All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][RESEND] parport: parport_pc: PCI SIO access should also depend on SIO option
@ 2016-03-28 22:00 Maciej S. Szmigiero
  2016-04-04 16:11 ` Sudip Mukherjee
  0 siblings, 1 reply; 3+ messages in thread
From: Maciej S. Szmigiero @ 2016-03-28 22:00 UTC (permalink / raw)
  To: Sudip Mukherjee; +Cc: linux-kernel

CONFIG_PARPORT_PC_SUPERIO toggles Super IO chip support in parport_pc
code, however only code accessing SIO chip via ISA (or LPC) bus was
conditional on it.

This patch makes SIO chip accesses via PCI bus also dependent on this
config option.

It should be noted that Super IO support in parport_pc is needed only when
firmware has failed to make parallel port available either via PNP or
on standard I/O ranges and user has one of a few supported SIOs.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
---
This is a resend without functional changes.

 drivers/parport/parport_pc.c | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c
index 78530d1714dc..b241fb0bcde3 100644
--- a/drivers/parport/parport_pc.c
+++ b/drivers/parport/parport_pc.c
@@ -2301,6 +2301,7 @@ EXPORT_SYMBOL(parport_pc_unregister_port);
 
 #ifdef CONFIG_PCI
 
+#ifdef CONFIG_PARPORT_PC_SUPERIO
 /* ITE support maintained by Rich Liu <richliu@poorman.org> */
 static int sio_ite_8872_probe(struct pci_dev *pdev, int autoirq, int autodma,
 			      const struct parport_pc_via_data *via)
@@ -2611,6 +2612,9 @@ static struct parport_pc_superio {
 	{ sio_via_probe, &via_8231_data, },
 	{ sio_ite_8872_probe, NULL, },
 };
+#else
+#define last_sio 0
+#endif /* CONFIG_PARPORT_PC_SUPERIO */
 
 enum parport_pc_pci_cards {
 	siig_1p_10x = last_sio,
@@ -2711,11 +2715,13 @@ static struct parport_pc_pci {
 };
 
 static const struct pci_device_id parport_pc_pci_tbl[] = {
+#ifdef CONFIG_PARPORT_PC_SUPERIO
 	/* Super-IO onboard chips */
 	{ 0x1106, 0x0686, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sio_via_686a },
 	{ 0x1106, 0x8231, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sio_via_8231 },
 	{ PCI_VENDOR_ID_ITE, PCI_DEVICE_ID_ITE_8872,
 	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, sio_ite_8872 },
+#endif
 
 	/* PCI cards */
 	{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1P_10x,
@@ -2900,7 +2906,11 @@ static struct pci_driver parport_pc_pci_driver = {
 	.probe		= parport_pc_pci_probe,
 	.remove		= parport_pc_pci_remove,
 };
+#else
+static struct pci_driver parport_pc_pci_driver;
+#endif /* CONFIG_PCI */
 
+#if defined(CONFIG_PCI) && defined(CONFIG_PARPORT_PC_SUPERIO)
 static int __init parport_pc_init_superio(int autoirq, int autodma)
 {
 	const struct pci_device_id *id;
@@ -2922,12 +2932,11 @@ static int __init parport_pc_init_superio(int autoirq, int autodma)
 	return ret; /* number of devices found */
 }
 #else
-static struct pci_driver parport_pc_pci_driver;
 static int __init parport_pc_init_superio(int autoirq, int autodma)
 {
 	return 0;
 }
-#endif /* CONFIG_PCI */
+#endif
 
 #ifdef CONFIG_PNP
 
@@ -3125,7 +3134,7 @@ static int __init parport_parse_dma(const char *dmastr, int *val)
 				     PARPORT_DMA_NONE, PARPORT_DMA_NOFIFO);
 }
 
-#ifdef CONFIG_PCI
+#if defined(CONFIG_PCI) && defined(CONFIG_PARPORT_PC_SUPERIO)
 static int __init parport_init_mode_setup(char *str)
 {
 	printk(KERN_DEBUG
@@ -3162,7 +3171,7 @@ module_param_array(dma, charp, NULL, 0);
 MODULE_PARM_DESC(verbose_probing, "Log chit-chat during initialisation");
 module_param(verbose_probing, int, 0644);
 #endif
-#ifdef CONFIG_PCI
+#if defined(CONFIG_PCI) && defined(CONFIG_PARPORT_PC_SUPERIO)
 static char *init_mode;
 MODULE_PARM_DESC(init_mode,
 	"Initialise mode for VIA VT8231 port (spp, ps2, epp, ecp or ecpepp)");
@@ -3174,7 +3183,7 @@ static int __init parse_parport_params(void)
 	unsigned int i;
 	int val;
 
-#ifdef CONFIG_PCI
+#if defined(CONFIG_PCI) && defined(CONFIG_PARPORT_PC_SUPERIO)
 	if (init_mode)
 		parport_init_mode_setup(init_mode);
 #endif
@@ -3292,7 +3301,7 @@ __setup("parport=", parport_setup);
  *
  * parport_init_mode=[spp|ps2|epp|ecp|ecpepp]
  */
-#ifdef CONFIG_PCI
+#if defined(CONFIG_PCI) && defined(CONFIG_PARPORT_PC_SUPERIO)
 __setup("parport_init_mode=", parport_init_mode_setup);
 #endif
 #endif

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH][RESEND] parport: parport_pc: PCI SIO access should also depend on SIO option
  2016-03-28 22:00 [PATCH][RESEND] parport: parport_pc: PCI SIO access should also depend on SIO option Maciej S. Szmigiero
@ 2016-04-04 16:11 ` Sudip Mukherjee
  2016-04-05 22:23   ` Maciej S. Szmigiero
  0 siblings, 1 reply; 3+ messages in thread
From: Sudip Mukherjee @ 2016-04-04 16:11 UTC (permalink / raw)
  To: Maciej S. Szmigiero; +Cc: linux-kernel

On Tue, Mar 29, 2016 at 12:00:56AM +0200, Maciej S. Szmigiero wrote:
> CONFIG_PARPORT_PC_SUPERIO toggles Super IO chip support in parport_pc
> code, however only code accessing SIO chip via ISA (or LPC) bus was
> conditional on it.
> 
> This patch makes SIO chip accesses via PCI bus also dependent on this
> config option.
> 
> It should be noted that Super IO support in parport_pc is needed only when
> firmware has failed to make parallel port available either via PNP or
> on standard I/O ranges and user has one of a few supported SIOs.
> 
> Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
> ---
> This is a resend without functional changes.

Resend was not required. I had your original patch.
Have you tested it on hardware?

regards
sudip

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH][RESEND] parport: parport_pc: PCI SIO access should also depend on SIO option
  2016-04-04 16:11 ` Sudip Mukherjee
@ 2016-04-05 22:23   ` Maciej S. Szmigiero
  0 siblings, 0 replies; 3+ messages in thread
From: Maciej S. Szmigiero @ 2016-04-05 22:23 UTC (permalink / raw)
  To: Sudip Mukherjee; +Cc: linux-kernel

Hi Sudip,

On 04.04.2016 18:11, Sudip Mukherjee wrote:
> On Tue, Mar 29, 2016 at 12:00:56AM +0200, Maciej S. Szmigiero wrote:
>> CONFIG_PARPORT_PC_SUPERIO toggles Super IO chip support in parport_pc
>> code, however only code accessing SIO chip via ISA (or LPC) bus was
>> conditional on it.
>>
>> This patch makes SIO chip accesses via PCI bus also dependent on this
>> config option.
>>
>> It should be noted that Super IO support in parport_pc is needed only when
>> firmware has failed to make parallel port available either via PNP or
>> on standard I/O ranges and user has one of a few supported SIOs.
>>
>> Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
>> ---
>> This is a resend without functional changes.
> 
> Resend was not required. I had your original patch.
>
> Have you tested it on hardware?

I've tested it with CONFIG_PARPORT_PC_SUPERIO both set and unset,
but on parallel port without one of such SIOs needing special setup.

However, considering that this patch only moves PCI SIO access code
behind this config option (just like ISA one is currently) and doesn't
alter the actual setup functionality I don't expect problems here.

> regards
> sudip

Best regards,
Maciej

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-04-05 22:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-28 22:00 [PATCH][RESEND] parport: parport_pc: PCI SIO access should also depend on SIO option Maciej S. Szmigiero
2016-04-04 16:11 ` Sudip Mukherjee
2016-04-05 22:23   ` Maciej S. Szmigiero

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.