aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/memstick/host
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-01-12 20:01:03 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-13 11:03:21 -0500
commit8930c8aa740b12ad69f44a35137bcc39bfa3dc41 (patch)
treeaa6cac8a6219112a3f6ab2fb12a341974e509811 /drivers/memstick/host
parent68860b96ebac0d56961cf80b94f65dab55e39069 (diff)
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/host')
-rw-r--r--drivers/memstick/host/jmb38x_ms.c17
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,
765#define PMOS0_SW_LED_POLARITY_ENABLE 0x80 765#define PMOS0_SW_LED_POLARITY_ENABLE 0x80
766#define PMOS0_ACTIVE_BITS (PMOS0_ENABLE | PMOS0_EN_OVERCURRENT_DEBOUNCE | \ 766#define PMOS0_ACTIVE_BITS (PMOS0_ENABLE | PMOS0_EN_OVERCURRENT_DEBOUNCE | \
767 PMOS0_OVERCURRENT_LEVEL_2_4V) 767 PMOS0_OVERCURRENT_LEVEL_2_4V)
768#define PCI_PMOS1_CONTROL 0xbd
769#define PMOS1_ACTIVE_BITS 0x4a
768#define PCI_CLOCK_CTL 0xb9 770#define PCI_CLOCK_CTL 0xb9
769 771
770static int jmb38x_ms_pmos(struct pci_dev *pdev, int flag) 772static 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)
779 pci_write_config_byte(pdev, PCI_PMOS0_CONTROL, val); 781 pci_write_config_byte(pdev, PCI_PMOS0_CONTROL, val);
780 dev_dbg(&pdev->dev, "JMB38x: set PMOS0 val 0x%x\n", val); 782 dev_dbg(&pdev->dev, "JMB38x: set PMOS0 val 0x%x\n", val);
781 783
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
782 pci_read_config_byte(pdev, PCI_CLOCK_CTL, &val); 794 pci_read_config_byte(pdev, PCI_CLOCK_CTL, &val);
783 pci_write_config_byte(pdev, PCI_CLOCK_CTL, val & ~0x0f); 795 pci_write_config_byte(pdev, PCI_CLOCK_CTL, val & ~0x0f);
784 pci_write_config_byte(pdev, PCI_CLOCK_CTL, val | 0x01); 796 pci_write_config_byte(pdev, PCI_CLOCK_CTL, val | 0x01);
@@ -1018,8 +1030,9 @@ static void jmb38x_ms_remove(struct pci_dev *dev)
1018} 1030}
1019 1031
1020static struct pci_device_id jmb38x_ms_id_tbl [] = { 1032static struct pci_device_id jmb38x_ms_id_tbl [] = {
1021 { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB38X_MS, PCI_ANY_ID, 1033 { PCI_VDEVICE(JMICRON, PCI_DEVICE_ID_JMICRON_JMB38X_MS) },
1022 PCI_ANY_ID, 0, 0, 0 }, 1034 { PCI_VDEVICE(JMICRON, PCI_DEVICE_ID_JMICRON_JMB385_MS) },
1035 { PCI_VDEVICE(JMICRON, PCI_DEVICE_ID_JMICRON_JMB390_MS) },
1023 { } 1036 { }
1024}; 1037};
1025 1038