Skip to contentSkip to conversation

peak_pci: add PCI ID definition pcie card variant

PATCH Applied Oliver Hartkopp 3 participants 4 messages Sep 16, 2014 CAN network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 peak_pci: add PCI ID definition pcie card variant

Add PCI ID definition for the single channel PCAN ExpressCard 34 adapter. Due to the subsystem id evaluation the correct number of channels (here 1) is created at initialization time. Tested including the LED functionality.

CC Stephane Grosjean <[email protected]>

---

Hi Marc,

as this is 'just a PCI ID definition' this patch should go into Daves net-tree for 3.17-rc upstream. The USB guys do it the same as there is no risk of breaking other peoples work at that stage.

Tnx,
Oliver

drivers/net/can/sja1000/peak_pci.c +5 -1
index 7a85590..e5fac36 100644
@@ -70,6 +70,8 @@ struct peak_pci_chan {
 #define PEAK_PC_104P_DEVICE_ID	0x0006	/* PCAN-PC/104+ cards */
 #define PEAK_PCI_104E_DEVICE_ID	0x0007	/* PCAN-PCI/104 Express cards */
 #define PEAK_MPCIE_DEVICE_ID	0x0008	/* The miniPCIe slot cards */
+#define PEAK_PCIE_OEM_ID	0x0009	/* PCAN-PCI Express OEM */
+#define PEAK_PCIEC34_DEVICE_ID	0x000A	/* PCAN-PCI Express 34 (one channel) */
 
 #define PEAK_PCI_CHAN_MAX	4
 
@@ -87,6 +89,7 @@ static const struct pci_device_id peak_pci_tbl[] = {
 	{PEAK_PCI_VENDOR_ID, PEAK_CPCI_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,},
 #ifdef CONFIG_CAN_PEAK_PCIEC
 	{PEAK_PCI_VENDOR_ID, PEAK_PCIEC_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,},
+	{PEAK_PCI_VENDOR_ID, PEAK_PCIEC34_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,},
 #endif
 	{0,}
 };
@@ -653,7 +656,8 @@ static int peak_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 		 * This must be done *before* register_sja1000dev() but
 		 * *after* devices linkage
 		 */
-		if (pdev->device == PEAK_PCIEC_DEVICE_ID) {
+		if (pdev->device == PEAK_PCIEC_DEVICE_ID ||
+		    pdev->device == PEAK_PCIEC34_DEVICE_ID) {
 			err = peak_pciec_probe(pdev, dev);
 			if (err) {
 				dev_err(&pdev->dev,
Acked-by on v1 1/1
#1 lore raw

Hi Oliver,

You've got my Acked-by, many thanks for having handled that !

Quoted 6 lines · Oliver Hartkopp

Add PCI ID definition for the single channel PCAN ExpressCard 34 adapter. Due to the subsystem id evaluation the correct number of channels (here 1) is created at initialization time. Tested including the LED functionality.

CC Stephane Grosjean <[email protected]>
Quoted 39 lines

---

Hi Marc,

as this is 'just a PCI ID definition' this patch should go into Daves net-tree for 3.17-rc upstream. The USB guys do it the same as there is no risk of breaking other peoples work at that stage.

Tnx,
Oliver

drivers/net/can/sja1000/peak_pci.c +3 -0
index 7a85590..e5fac36 100644
@@ -70,6 +70,8 @@ struct peak_pci_chan {
  #define PEAK_PC_104P_DEVICE_ID	0x0006	/* PCAN-PC/104+ cards */
  #define PEAK_PCI_104E_DEVICE_ID	0x0007	/* PCAN-PCI/104 Express cards */
  #define PEAK_MPCIE_DEVICE_ID	0x0008	/* The miniPCIe slot cards */
+#define PEAK_PCIE_OEM_ID	0x0009	/* PCAN-PCI Express OEM */
+#define PEAK_PCIEC34_DEVICE_ID	0x000A	/* PCAN-PCI Express 34 (one channel) */
 
  #define PEAK_PCI_CHAN_MAX	4
 
@@ -87,6 +89,7 @@ static const struct pci_device_id peak_pci_tbl[] = {
  	{PEAK_PCI_VENDOR_ID, PEAK_CPCI_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,},
  #ifdef CONFIG_CAN_PEAK_PCIEC
  	{PEAK_PCI_VENDOR_ID, PEAK_PCIEC_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,},
+	{PEAK_PCI_VENDOR_ID, PEAK_PCIEC34_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,},
  #endif
  	{0,}
  };

drivers/net/can/sja1000/peak_pci.c static int peak_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · line 663

Quoted 9 lines
drivers/net/can/sja1000/peak_pci.c +2 -1
@@ -653,7 +656,8 @@ static int peak_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
  		 * This must be done *before* register_sja1000dev() but
  		 * *after* devices linkage
  		 */
-		if (pdev->device == PEAK_PCIEC_DEVICE_ID) {
+		if (pdev->device == PEAK_PCIEC_DEVICE_ID ||
+		    pdev->device == PEAK_PCIEC34_DEVICE_ID) {
  			err = peak_pciec_probe(pdev, dev);
  			if (err) {
  				dev_err(&pdev->dev,

--
PEAK-System Technik GmbH, Otto-Roehm-Strasse 69, D-64293 Darmstadt Geschaeftsleitung: A.Gach/U.Wilhelm,St.Nr.:007/241/13586 FA Darmstadt HRB-9183 Darmstadt, Ust.IdNr.:DE 202220078, WEE-Reg.-Nr.: DE39305391 Tel.+49 (0)6151-817320 / Fax:+49 (0)6151-817329, [email protected] --

#2 lore raw

Hi Stephane,

Quoted 1 line · Stephane Grosjean

You've got my Acked-by, many thanks for having handled that !

That's the advantage when providing readable code :-)

The adapter works pretty good - even the PCI hotplug stuff and the LED.

Thanks & best regards,
Oliver

Quoted 10 lines · Oliver Hartkopp
Quoted 6 lines

Add PCI ID definition for the single channel PCAN ExpressCard 34 adapter. Due to the subsystem id evaluation the correct number of channels (here 1) is created at initialization time. Tested including the LED functionality.

CC Stephane Grosjean <[email protected]>
Quoted 1 line
maintainer Applied
#3 lore raw
In reply to Oliver Hartkopp
Quoted 6 lines · Oliver Hartkopp

Add PCI ID definition for the single channel PCAN ExpressCard 34 adapter. Due to the subsystem id evaluation the correct number of channels (here 1) is created at initialization time. Tested including the LED functionality.

CC Stephane Grosjean <[email protected]>

Applied to can.

Thnx,
Marc

Signature · 4 lines
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |