Skip to content

Commit 8930c8a

Browse files
tiwaitorvalds
authored andcommitted
memstick: add support for JMicron JMB 385 and 390 controllers
Signed-off-by: Aries Lee <arieslee@jmicron.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Cc: Alex Dubov <oakad@yahoo.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 68860b9 commit 8930c8a

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

‎drivers/memstick/host/jmb38x_ms.c‎

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -765,6 +765,8 @@ static int jmb38x_ms_set_param(struct memstick_host *msh,
765765
#define PMOS0_SW_LED_POLARITY_ENABLE 0x80
766766
#define PMOS0_ACTIVE_BITS (PMOS0_ENABLE | PMOS0_EN_OVERCURRENT_DEBOUNCE | \
767767
PMOS0_OVERCURRENT_LEVEL_2_4V)
768+
#define PCI_PMOS1_CONTROL 0xbd
769+
#define PMOS1_ACTIVE_BITS 0x4a
768770
#define PCI_CLOCK_CTL 0xb9
769771

770772
static int jmb38x_ms_pmos(struct pci_dev *pdev, int flag)
@@ -779,6 +781,16 @@ static int jmb38x_ms_pmos(struct pci_dev *pdev, int flag)
779781
pci_write_config_byte(pdev, PCI_PMOS0_CONTROL, val);
780782
dev_dbg(&pdev->dev, "JMB38x: set PMOS0 val 0x%x\n", val);
781783

784+
if (pci_resource_flags(pdev, 1)) {
785+
pci_read_config_byte(pdev, PCI_PMOS1_CONTROL, &val);
786+
if (flag)
787+
val |= PMOS1_ACTIVE_BITS;
788+
else
789+
val &= ~PMOS1_ACTIVE_BITS;
790+
pci_write_config_byte(pdev, PCI_PMOS1_CONTROL, val);
791+
dev_dbg(&pdev->dev, "JMB38x: set PMOS1 val 0x%x\n", val);
792+
}
793+
782794
pci_read_config_byte(pdev, PCI_CLOCK_CTL, &val);
783795
pci_write_config_byte(pdev, PCI_CLOCK_CTL, val & ~0x0f);
784796
pci_write_config_byte(pdev, PCI_CLOCK_CTL, val | 0x01);
@@ -1018,8 +1030,9 @@ static void jmb38x_ms_remove(struct pci_dev *dev)
10181030
}
10191031

10201032
static struct pci_device_id jmb38x_ms_id_tbl [] = {
1021-
{ PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB38X_MS, PCI_ANY_ID,
1022-
PCI_ANY_ID, 0, 0, 0 },
1033+
{ PCI_VDEVICE(JMICRON, PCI_DEVICE_ID_JMICRON_JMB38X_MS) },
1034+
{ PCI_VDEVICE(JMICRON, PCI_DEVICE_ID_JMICRON_JMB385_MS) },
1035+
{ PCI_VDEVICE(JMICRON, PCI_DEVICE_ID_JMICRON_JMB390_MS) },
10231036
{ }
10241037
};
10251038

‎include/linux/pci_ids.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2369,8 +2369,10 @@
23692369
#define PCI_DEVICE_ID_JMICRON_JMB38X_SD 0x2381
23702370
#define PCI_DEVICE_ID_JMICRON_JMB38X_MMC 0x2382
23712371
#define PCI_DEVICE_ID_JMICRON_JMB38X_MS 0x2383
2372+
#define PCI_DEVICE_ID_JMICRON_JMB385_MS 0x2388
23722373
#define PCI_DEVICE_ID_JMICRON_JMB388_SD 0x2391
23732374
#define PCI_DEVICE_ID_JMICRON_JMB388_ESD 0x2392
2375+
#define PCI_DEVICE_ID_JMICRON_JMB390_MS 0x2393
23742376

23752377
#define PCI_VENDOR_ID_KORENIX 0x1982
23762378
#define PCI_DEVICE_ID_KORENIX_JETCARDF0 0x1600

0 commit comments

Comments
 (0)