diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-01-13 02:01:03 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 17:03:21 +0100 |
commit | 8930c8aa740b12ad69f44a35137bcc39bfa3dc41 (patch) | |
tree | aa6cac8a6219112a3f6ab2fb12a341974e509811 /drivers/memstick | |
parent | memstick: set PMOS values propery for JMicron 38x controllers (diff) | |
download | linux-8930c8aa740b12ad69f44a35137bcc39bfa3dc41.tar.xz linux-8930c8aa740b12ad69f44a35137bcc39bfa3dc41.zip |
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>
Diffstat (limited to 'drivers/memstick')
-rw-r--r-- | drivers/memstick/host/jmb38x_ms.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/memstick/host/jmb38x_ms.c b/drivers/memstick/host/jmb38x_ms.c index 4ce8773fa3b8..d89d925caecf 100644 --- a/drivers/memstick/host/jmb38x_ms.c +++ b/drivers/memstick/host/jmb38x_ms.c @@ -765,6 +765,8 @@ static int jmb38x_ms_set_param(struct memstick_host *msh, #define PMOS0_SW_LED_POLARITY_ENABLE 0x80 #define PMOS0_ACTIVE_BITS (PMOS0_ENABLE | PMOS0_EN_OVERCURRENT_DEBOUNCE | \ PMOS0_OVERCURRENT_LEVEL_2_4V) +#define PCI_PMOS1_CONTROL 0xbd +#define PMOS1_ACTIVE_BITS 0x4a #define PCI_CLOCK_CTL 0xb9 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) pci_write_config_byte(pdev, PCI_PMOS0_CONTROL, val); dev_dbg(&pdev->dev, "JMB38x: set PMOS0 val 0x%x\n", val); + if (pci_resource_flags(pdev, 1)) { + pci_read_config_byte(pdev, PCI_PMOS1_CONTROL, &val); + if (flag) + val |= PMOS1_ACTIVE_BITS; + else + val &= ~PMOS1_ACTIVE_BITS; + pci_write_config_byte(pdev, PCI_PMOS1_CONTROL, val); + dev_dbg(&pdev->dev, "JMB38x: set PMOS1 val 0x%x\n", val); + } + pci_read_config_byte(pdev, PCI_CLOCK_CTL, &val); pci_write_config_byte(pdev, PCI_CLOCK_CTL, val & ~0x0f); pci_write_config_byte(pdev, PCI_CLOCK_CTL, val | 0x01); @@ -1018,8 +1030,9 @@ static void jmb38x_ms_remove(struct pci_dev *dev) } static struct pci_device_id jmb38x_ms_id_tbl [] = { - { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB38X_MS, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0 }, + { PCI_VDEVICE(JMICRON, PCI_DEVICE_ID_JMICRON_JMB38X_MS) }, + { PCI_VDEVICE(JMICRON, PCI_DEVICE_ID_JMICRON_JMB385_MS) }, + { PCI_VDEVICE(JMICRON, PCI_DEVICE_ID_JMICRON_JMB390_MS) }, { } }; |