diff options
Diffstat (limited to 'drivers')
110 files changed, 1172 insertions, 736 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 328826381a2..b8d96ce37fc 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c | |||
| @@ -260,6 +260,7 @@ static const struct pci_device_id ahci_pci_tbl[] = { | |||
| 260 | { PCI_VDEVICE(INTEL, 0x1d02), board_ahci }, /* PBG AHCI */ | 260 | { PCI_VDEVICE(INTEL, 0x1d02), board_ahci }, /* PBG AHCI */ |
| 261 | { PCI_VDEVICE(INTEL, 0x1d04), board_ahci }, /* PBG RAID */ | 261 | { PCI_VDEVICE(INTEL, 0x1d04), board_ahci }, /* PBG RAID */ |
| 262 | { PCI_VDEVICE(INTEL, 0x1d06), board_ahci }, /* PBG RAID */ | 262 | { PCI_VDEVICE(INTEL, 0x1d06), board_ahci }, /* PBG RAID */ |
| 263 | { PCI_VDEVICE(INTEL, 0x2323), board_ahci }, /* DH89xxCC AHCI */ | ||
| 263 | 264 | ||
| 264 | /* JMicron 360/1/3/5/6, match class to avoid IDE function */ | 265 | /* JMicron 360/1/3/5/6, match class to avoid IDE function */ |
| 265 | { PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, | 266 | { PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, |
| @@ -379,6 +380,8 @@ static const struct pci_device_id ahci_pci_tbl[] = { | |||
| 379 | { PCI_VDEVICE(MARVELL, 0x6145), board_ahci_mv }, /* 6145 */ | 380 | { PCI_VDEVICE(MARVELL, 0x6145), board_ahci_mv }, /* 6145 */ |
| 380 | { PCI_VDEVICE(MARVELL, 0x6121), board_ahci_mv }, /* 6121 */ | 381 | { PCI_VDEVICE(MARVELL, 0x6121), board_ahci_mv }, /* 6121 */ |
| 381 | { PCI_DEVICE(0x1b4b, 0x9123), | 382 | { PCI_DEVICE(0x1b4b, 0x9123), |
| 383 | .class = PCI_CLASS_STORAGE_SATA_AHCI, | ||
| 384 | .class_mask = 0xffffff, | ||
| 382 | .driver_data = board_ahci_yes_fbs }, /* 88se9128 */ | 385 | .driver_data = board_ahci_yes_fbs }, /* 88se9128 */ |
| 383 | 386 | ||
| 384 | /* Promise */ | 387 | /* Promise */ |
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index a31fe96f7de..d4e52e21485 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
| @@ -4138,6 +4138,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { | |||
| 4138 | * device and controller are SATA. | 4138 | * device and controller are SATA. |
| 4139 | */ | 4139 | */ |
| 4140 | { "PIONEER DVD-RW DVRTD08", "1.00", ATA_HORKAGE_NOSETXFER }, | 4140 | { "PIONEER DVD-RW DVRTD08", "1.00", ATA_HORKAGE_NOSETXFER }, |
| 4141 | { "PIONEER DVD-RW DVR-212D", "1.28", ATA_HORKAGE_NOSETXFER }, | ||
| 4141 | 4142 | ||
| 4142 | /* End Marker */ | 4143 | /* End Marker */ |
| 4143 | { } | 4144 | { } |
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 5defc74973d..600f6353ecf 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
| @@ -1099,9 +1099,9 @@ static int ata_scsi_dev_config(struct scsi_device *sdev, | |||
| 1099 | struct request_queue *q = sdev->request_queue; | 1099 | struct request_queue *q = sdev->request_queue; |
| 1100 | void *buf; | 1100 | void *buf; |
| 1101 | 1101 | ||
| 1102 | /* set the min alignment and padding */ | 1102 | sdev->sector_size = ATA_SECT_SIZE; |
| 1103 | blk_queue_update_dma_alignment(sdev->request_queue, | 1103 | |
| 1104 | ATA_DMA_PAD_SZ - 1); | 1104 | /* set DMA padding */ |
| 1105 | blk_queue_update_dma_pad(sdev->request_queue, | 1105 | blk_queue_update_dma_pad(sdev->request_queue, |
| 1106 | ATA_DMA_PAD_SZ - 1); | 1106 | ATA_DMA_PAD_SZ - 1); |
| 1107 | 1107 | ||
| @@ -1115,13 +1115,25 @@ static int ata_scsi_dev_config(struct scsi_device *sdev, | |||
| 1115 | 1115 | ||
| 1116 | blk_queue_dma_drain(q, atapi_drain_needed, buf, ATAPI_MAX_DRAIN); | 1116 | blk_queue_dma_drain(q, atapi_drain_needed, buf, ATAPI_MAX_DRAIN); |
| 1117 | } else { | 1117 | } else { |
| 1118 | /* ATA devices must be sector aligned */ | ||
| 1119 | sdev->sector_size = ata_id_logical_sector_size(dev->id); | 1118 | sdev->sector_size = ata_id_logical_sector_size(dev->id); |
| 1120 | blk_queue_update_dma_alignment(sdev->request_queue, | ||
| 1121 | sdev->sector_size - 1); | ||
| 1122 | sdev->manage_start_stop = 1; | 1119 | sdev->manage_start_stop = 1; |
| 1123 | } | 1120 | } |
| 1124 | 1121 | ||
| 1122 | /* | ||
| 1123 | * ata_pio_sectors() expects buffer for each sector to not cross | ||
| 1124 | * page boundary. Enforce it by requiring buffers to be sector | ||
| 1125 | * aligned, which works iff sector_size is not larger than | ||
| 1126 | * PAGE_SIZE. ATAPI devices also need the alignment as | ||
| 1127 | * IDENTIFY_PACKET is executed as ATA_PROT_PIO. | ||
| 1128 | */ | ||
| 1129 | if (sdev->sector_size > PAGE_SIZE) | ||
| 1130 | ata_dev_printk(dev, KERN_WARNING, | ||
| 1131 | "sector_size=%u > PAGE_SIZE, PIO may malfunction\n", | ||
| 1132 | sdev->sector_size); | ||
| 1133 | |||
| 1134 | blk_queue_update_dma_alignment(sdev->request_queue, | ||
| 1135 | sdev->sector_size - 1); | ||
| 1136 | |||
| 1125 | if (dev->flags & ATA_DFLAG_AN) | 1137 | if (dev->flags & ATA_DFLAG_AN) |
| 1126 | set_bit(SDEV_EVT_MEDIA_CHANGE, sdev->supported_events); | 1138 | set_bit(SDEV_EVT_MEDIA_CHANGE, sdev->supported_events); |
| 1127 | 1139 | ||
diff --git a/drivers/ata/pata_hpt366.c b/drivers/ata/pata_hpt366.c index d7e57db36bc..538ec38ba99 100644 --- a/drivers/ata/pata_hpt366.c +++ b/drivers/ata/pata_hpt366.c | |||
| @@ -25,7 +25,7 @@ | |||
| 25 | #include <linux/libata.h> | 25 | #include <linux/libata.h> |
| 26 | 26 | ||
| 27 | #define DRV_NAME "pata_hpt366" | 27 | #define DRV_NAME "pata_hpt366" |
| 28 | #define DRV_VERSION "0.6.9" | 28 | #define DRV_VERSION "0.6.10" |
| 29 | 29 | ||
| 30 | struct hpt_clock { | 30 | struct hpt_clock { |
| 31 | u8 xfer_mode; | 31 | u8 xfer_mode; |
| @@ -160,8 +160,8 @@ static int hpt_dma_blacklisted(const struct ata_device *dev, char *modestr, | |||
| 160 | 160 | ||
| 161 | while (list[i] != NULL) { | 161 | while (list[i] != NULL) { |
| 162 | if (!strcmp(list[i], model_num)) { | 162 | if (!strcmp(list[i], model_num)) { |
| 163 | printk(KERN_WARNING DRV_NAME ": %s is not supported for %s.\n", | 163 | pr_warning(DRV_NAME ": %s is not supported for %s.\n", |
| 164 | modestr, list[i]); | 164 | modestr, list[i]); |
| 165 | return 1; | 165 | return 1; |
| 166 | } | 166 | } |
| 167 | i++; | 167 | i++; |
diff --git a/drivers/ata/pata_hpt37x.c b/drivers/ata/pata_hpt37x.c index efdd18bc866..4c5b5183225 100644 --- a/drivers/ata/pata_hpt37x.c +++ b/drivers/ata/pata_hpt37x.c | |||
| @@ -24,7 +24,7 @@ | |||
| 24 | #include <linux/libata.h> | 24 | #include <linux/libata.h> |
| 25 | 25 | ||
| 26 | #define DRV_NAME "pata_hpt37x" | 26 | #define DRV_NAME "pata_hpt37x" |
| 27 | #define DRV_VERSION "0.6.18" | 27 | #define DRV_VERSION "0.6.22" |
| 28 | 28 | ||
| 29 | struct hpt_clock { | 29 | struct hpt_clock { |
| 30 | u8 xfer_speed; | 30 | u8 xfer_speed; |
| @@ -229,8 +229,8 @@ static int hpt_dma_blacklisted(const struct ata_device *dev, char *modestr, | |||
| 229 | 229 | ||
| 230 | while (list[i] != NULL) { | 230 | while (list[i] != NULL) { |
| 231 | if (!strcmp(list[i], model_num)) { | 231 | if (!strcmp(list[i], model_num)) { |
| 232 | printk(KERN_WARNING DRV_NAME ": %s is not supported for %s.\n", | 232 | pr_warning(DRV_NAME ": %s is not supported for %s.\n", |
| 233 | modestr, list[i]); | 233 | modestr, list[i]); |
| 234 | return 1; | 234 | return 1; |
| 235 | } | 235 | } |
| 236 | i++; | 236 | i++; |
| @@ -642,7 +642,6 @@ static struct ata_port_operations hpt372_port_ops = { | |||
| 642 | static struct ata_port_operations hpt374_fn1_port_ops = { | 642 | static struct ata_port_operations hpt374_fn1_port_ops = { |
| 643 | .inherits = &hpt372_port_ops, | 643 | .inherits = &hpt372_port_ops, |
| 644 | .cable_detect = hpt374_fn1_cable_detect, | 644 | .cable_detect = hpt374_fn1_cable_detect, |
| 645 | .prereset = hpt37x_pre_reset, | ||
| 646 | }; | 645 | }; |
| 647 | 646 | ||
| 648 | /** | 647 | /** |
| @@ -803,7 +802,7 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id) | |||
| 803 | .udma_mask = ATA_UDMA6, | 802 | .udma_mask = ATA_UDMA6, |
| 804 | .port_ops = &hpt302_port_ops | 803 | .port_ops = &hpt302_port_ops |
| 805 | }; | 804 | }; |
| 806 | /* HPT374 - UDMA100, function 1 uses different prereset method */ | 805 | /* HPT374 - UDMA100, function 1 uses different cable_detect method */ |
| 807 | static const struct ata_port_info info_hpt374_fn0 = { | 806 | static const struct ata_port_info info_hpt374_fn0 = { |
| 808 | .flags = ATA_FLAG_SLAVE_POSS, | 807 | .flags = ATA_FLAG_SLAVE_POSS, |
| 809 | .pio_mask = ATA_PIO4, | 808 | .pio_mask = ATA_PIO4, |
| @@ -838,7 +837,8 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id) | |||
| 838 | if (rc) | 837 | if (rc) |
| 839 | return rc; | 838 | return rc; |
| 840 | 839 | ||
| 841 | if (dev->device == PCI_DEVICE_ID_TTI_HPT366) { | 840 | switch (dev->device) { |
| 841 | case PCI_DEVICE_ID_TTI_HPT366: | ||
| 842 | /* May be a later chip in disguise. Check */ | 842 | /* May be a later chip in disguise. Check */ |
| 843 | /* Older chips are in the HPT366 driver. Ignore them */ | 843 | /* Older chips are in the HPT366 driver. Ignore them */ |
| 844 | if (rev < 3) | 844 | if (rev < 3) |
| @@ -863,54 +863,50 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id) | |||
| 863 | chip_table = &hpt372; | 863 | chip_table = &hpt372; |
| 864 | break; | 864 | break; |
| 865 | default: | 865 | default: |
| 866 | printk(KERN_ERR "pata_hpt37x: Unknown HPT366 subtype, " | 866 | pr_err(DRV_NAME ": Unknown HPT366 subtype, " |
| 867 | "please report (%d).\n", rev); | 867 | "please report (%d).\n", rev); |
| 868 | return -ENODEV; | 868 | return -ENODEV; |
| 869 | } | 869 | } |
| 870 | } else { | 870 | break; |
| 871 | switch (dev->device) { | 871 | case PCI_DEVICE_ID_TTI_HPT372: |
| 872 | case PCI_DEVICE_ID_TTI_HPT372: | 872 | /* 372N if rev >= 2 */ |
| 873 | /* 372N if rev >= 2 */ | 873 | if (rev >= 2) |
| 874 | if (rev >= 2) | 874 | return -ENODEV; |
| 875 | return -ENODEV; | 875 | ppi[0] = &info_hpt372; |
| 876 | ppi[0] = &info_hpt372; | 876 | chip_table = &hpt372a; |
| 877 | chip_table = &hpt372a; | 877 | break; |
| 878 | break; | 878 | case PCI_DEVICE_ID_TTI_HPT302: |
| 879 | case PCI_DEVICE_ID_TTI_HPT302: | 879 | /* 302N if rev > 1 */ |
| 880 | /* 302N if rev > 1 */ | 880 | if (rev > 1) |
| 881 | if (rev > 1) | 881 | return -ENODEV; |
| 882 | return -ENODEV; | 882 | ppi[0] = &info_hpt302; |
| 883 | ppi[0] = &info_hpt302; | 883 | /* Check this */ |
| 884 | /* Check this */ | 884 | chip_table = &hpt302; |
| 885 | chip_table = &hpt302; | 885 | break; |
| 886 | break; | 886 | case PCI_DEVICE_ID_TTI_HPT371: |
| 887 | case PCI_DEVICE_ID_TTI_HPT371: | 887 | if (rev > 1) |
| 888 | if (rev > 1) | 888 | return -ENODEV; |
| 889 | return -ENODEV; | 889 | ppi[0] = &info_hpt302; |
| 890 | ppi[0] = &info_hpt302; | 890 | chip_table = &hpt371; |
| 891 | chip_table = &hpt371; | 891 | /* |
| 892 | /* | 892 | * Single channel device, master is not present but the BIOS |
| 893 | * Single channel device, master is not present | 893 | * (or us for non x86) must mark it absent |
| 894 | * but the BIOS (or us for non x86) must mark it | 894 | */ |
| 895 | * absent | 895 | pci_read_config_byte(dev, 0x50, &mcr1); |
| 896 | */ | 896 | mcr1 &= ~0x04; |
| 897 | pci_read_config_byte(dev, 0x50, &mcr1); | 897 | pci_write_config_byte(dev, 0x50, mcr1); |
| 898 | mcr1 &= ~0x04; | 898 | break; |
| 899 | pci_write_config_byte(dev, 0x50, mcr1); | 899 | case PCI_DEVICE_ID_TTI_HPT374: |
| 900 | break; | 900 | chip_table = &hpt374; |
| 901 | case PCI_DEVICE_ID_TTI_HPT374: | 901 | if (!(PCI_FUNC(dev->devfn) & 1)) |
| 902 | chip_table = &hpt374; | 902 | *ppi = &info_hpt374_fn0; |
| 903 | if (!(PCI_FUNC(dev->devfn) & 1)) | 903 | else |
| 904 | *ppi = &info_hpt374_fn0; | 904 | *ppi = &info_hpt374_fn1; |
| 905 | else | 905 | break; |
| 906 | *ppi = &info_hpt374_fn1; | 906 | default: |
| 907 | break; | 907 | pr_err(DRV_NAME ": PCI table is bogus, please report (%d).\n", |
| 908 | default: | 908 | dev->device); |
| 909 | printk(KERN_ERR | 909 | return -ENODEV; |
| 910 | "pata_hpt37x: PCI table is bogus, please report (%d).\n", | ||
| 911 | dev->device); | ||
| 912 | return -ENODEV; | ||
| 913 | } | ||
| 914 | } | 910 | } |
| 915 | /* Ok so this is a chip we support */ | 911 | /* Ok so this is a chip we support */ |
| 916 | 912 | ||
| @@ -957,8 +953,7 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id) | |||
| 957 | u8 sr; | 953 | u8 sr; |
| 958 | u32 total = 0; | 954 | u32 total = 0; |
| 959 | 955 | ||
| 960 | printk(KERN_WARNING | 956 | pr_warning(DRV_NAME ": BIOS has not set timing clocks.\n"); |
| 961 | "pata_hpt37x: BIOS has not set timing clocks.\n"); | ||
| 962 | 957 | ||
| 963 | /* This is the process the HPT371 BIOS is reported to use */ | 958 | /* This is the process the HPT371 BIOS is reported to use */ |
| 964 | for (i = 0; i < 128; i++) { | 959 | for (i = 0; i < 128; i++) { |
| @@ -1014,7 +1009,7 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id) | |||
| 1014 | (f_high << 16) | f_low | 0x100); | 1009 | (f_high << 16) | f_low | 0x100); |
| 1015 | } | 1010 | } |
| 1016 | if (adjust == 8) { | 1011 | if (adjust == 8) { |
| 1017 | printk(KERN_ERR "pata_hpt37x: DPLL did not stabilize!\n"); | 1012 | pr_err(DRV_NAME ": DPLL did not stabilize!\n"); |
| 1018 | return -ENODEV; | 1013 | return -ENODEV; |
| 1019 | } | 1014 | } |
| 1020 | if (dpll == 3) | 1015 | if (dpll == 3) |
| @@ -1022,8 +1017,8 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id) | |||
| 1022 | else | 1017 | else |
| 1023 | private_data = (void *)hpt37x_timings_50; | 1018 | private_data = (void *)hpt37x_timings_50; |
| 1024 | 1019 | ||
| 1025 | printk(KERN_INFO "pata_hpt37x: bus clock %dMHz, using %dMHz DPLL.\n", | 1020 | pr_info(DRV_NAME ": bus clock %dMHz, using %dMHz DPLL.\n", |
| 1026 | MHz[clock_slot], MHz[dpll]); | 1021 | MHz[clock_slot], MHz[dpll]); |
| 1027 | } else { | 1022 | } else { |
| 1028 | private_data = (void *)chip_table->clocks[clock_slot]; | 1023 | private_data = (void *)chip_table->clocks[clock_slot]; |
| 1029 | /* | 1024 | /* |
| @@ -1036,8 +1031,9 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id) | |||
| 1036 | ppi[0] = &info_hpt370_33; | 1031 | ppi[0] = &info_hpt370_33; |
| 1037 | if (clock_slot < 2 && ppi[0] == &info_hpt370a) | 1032 | if (clock_slot < 2 && ppi[0] == &info_hpt370a) |
| 1038 | ppi[0] = &info_hpt370a_33; | 1033 | ppi[0] = &info_hpt370a_33; |
| 1039 | printk(KERN_INFO "pata_hpt37x: %s using %dMHz bus clock.\n", | 1034 | |
| 1040 | chip_table->name, MHz[clock_slot]); | 1035 | pr_info(DRV_NAME ": %s using %dMHz bus clock.\n", |
| 1036 | chip_table->name, MHz[clock_slot]); | ||
| 1041 | } | 1037 | } |
| 1042 | 1038 | ||
| 1043 | /* Now kick off ATA set up */ | 1039 | /* Now kick off ATA set up */ |
diff --git a/drivers/ata/pata_hpt3x2n.c b/drivers/ata/pata_hpt3x2n.c index d2239bbdb79..eca68caf5f4 100644 --- a/drivers/ata/pata_hpt3x2n.c +++ b/drivers/ata/pata_hpt3x2n.c | |||
| @@ -25,7 +25,7 @@ | |||
| 25 | #include <linux/libata.h> | 25 | #include <linux/libata.h> |
| 26 | 26 | ||
| 27 | #define DRV_NAME "pata_hpt3x2n" | 27 | #define DRV_NAME "pata_hpt3x2n" |
| 28 | #define DRV_VERSION "0.3.13" | 28 | #define DRV_VERSION "0.3.14" |
| 29 | 29 | ||
| 30 | enum { | 30 | enum { |
| 31 | HPT_PCI_FAST = (1 << 31), | 31 | HPT_PCI_FAST = (1 << 31), |
| @@ -418,7 +418,7 @@ static int hpt3x2n_pci_clock(struct pci_dev *pdev) | |||
| 418 | u16 sr; | 418 | u16 sr; |
| 419 | u32 total = 0; | 419 | u32 total = 0; |
| 420 | 420 | ||
| 421 | printk(KERN_WARNING "pata_hpt3x2n: BIOS clock data not set.\n"); | 421 | pr_warning(DRV_NAME ": BIOS clock data not set.\n"); |
| 422 | 422 | ||
| 423 | /* This is the process the HPT371 BIOS is reported to use */ | 423 | /* This is the process the HPT371 BIOS is reported to use */ |
| 424 | for (i = 0; i < 128; i++) { | 424 | for (i = 0; i < 128; i++) { |
| @@ -528,8 +528,7 @@ hpt372n: | |||
| 528 | ppi[0] = &info_hpt372n; | 528 | ppi[0] = &info_hpt372n; |
| 529 | break; | 529 | break; |
| 530 | default: | 530 | default: |
| 531 | printk(KERN_ERR | 531 | pr_err(DRV_NAME ": PCI table is bogus, please report (%d).\n", |
| 532 | "pata_hpt3x2n: PCI table is bogus please report (%d).\n", | ||
| 533 | dev->device); | 532 | dev->device); |
| 534 | return -ENODEV; | 533 | return -ENODEV; |
| 535 | } | 534 | } |
| @@ -579,12 +578,11 @@ hpt372n: | |||
| 579 | pci_write_config_dword(dev, 0x5C, (f_high << 16) | f_low); | 578 | pci_write_config_dword(dev, 0x5C, (f_high << 16) | f_low); |
| 580 | } | 579 | } |
| 581 | if (adjust == 8) { | 580 | if (adjust == 8) { |
| 582 | printk(KERN_ERR "pata_hpt3x2n: DPLL did not stabilize!\n"); | 581 | pr_err(DRV_NAME ": DPLL did not stabilize!\n"); |
| 583 | return -ENODEV; | 582 | return -ENODEV; |
| 584 | } | 583 | } |
| 585 | 584 | ||
| 586 | printk(KERN_INFO "pata_hpt37x: bus clock %dMHz, using 66MHz DPLL.\n", | 585 | pr_info(DRV_NAME ": bus clock %dMHz, using 66MHz DPLL.\n", pci_mhz); |
| 587 | pci_mhz); | ||
| 588 | 586 | ||
| 589 | /* | 587 | /* |
| 590 | * Set our private data up. We only need a few flags | 588 | * Set our private data up. We only need a few flags |
diff --git a/drivers/ata/pata_mpc52xx.c b/drivers/ata/pata_mpc52xx.c index 8cc536e49a0..d7d8026cde9 100644 --- a/drivers/ata/pata_mpc52xx.c +++ b/drivers/ata/pata_mpc52xx.c | |||
| @@ -610,7 +610,7 @@ static struct scsi_host_template mpc52xx_ata_sht = { | |||
| 610 | }; | 610 | }; |
| 611 | 611 | ||
| 612 | static struct ata_port_operations mpc52xx_ata_port_ops = { | 612 | static struct ata_port_operations mpc52xx_ata_port_ops = { |
| 613 | .inherits = &ata_sff_port_ops, | 613 | .inherits = &ata_bmdma_port_ops, |
| 614 | .sff_dev_select = mpc52xx_ata_dev_select, | 614 | .sff_dev_select = mpc52xx_ata_dev_select, |
| 615 | .set_piomode = mpc52xx_ata_set_piomode, | 615 | .set_piomode = mpc52xx_ata_set_piomode, |
| 616 | .set_dmamode = mpc52xx_ata_set_dmamode, | 616 | .set_dmamode = mpc52xx_ata_set_dmamode, |
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c index 2aef5cd3acf..49e5e99917e 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bios.c +++ b/drivers/gpu/drm/nouveau/nouveau_bios.c | |||
| @@ -6310,6 +6310,9 @@ void merge_like_dcb_entries(struct drm_device *dev, struct dcb_table *dcb) | |||
| 6310 | static bool | 6310 | static bool |
| 6311 | apply_dcb_encoder_quirks(struct drm_device *dev, int idx, u32 *conn, u32 *conf) | 6311 | apply_dcb_encoder_quirks(struct drm_device *dev, int idx, u32 *conn, u32 *conf) |
| 6312 | { | 6312 | { |
| 6313 | struct drm_nouveau_private *dev_priv = dev->dev_private; | ||
| 6314 | struct dcb_table *dcb = &dev_priv->vbios.dcb; | ||
| 6315 | |||
| 6313 | /* Dell Precision M6300 | 6316 | /* Dell Precision M6300 |
| 6314 | * DCB entry 2: 02025312 00000010 | 6317 | * DCB entry 2: 02025312 00000010 |
| 6315 | * DCB entry 3: 02026312 00000020 | 6318 | * DCB entry 3: 02026312 00000020 |
| @@ -6327,6 +6330,18 @@ apply_dcb_encoder_quirks(struct drm_device *dev, int idx, u32 *conn, u32 *conf) | |||
| 6327 | return false; | 6330 | return false; |
| 6328 | } | 6331 | } |
| 6329 | 6332 | ||
| 6333 | /* GeForce3 Ti 200 | ||
| 6334 | * | ||
| 6335 | * DCB reports an LVDS output that should be TMDS: | ||
| 6336 | * DCB entry 1: f2005014 ffffffff | ||
| 6337 | */ | ||
| 6338 | if (nv_match_device(dev, 0x0201, 0x1462, 0x8851)) { | ||
| 6339 | if (*conn == 0xf2005014 && *conf == 0xffffffff) { | ||
| 6340 | fabricate_dcb_output(dcb, OUTPUT_TMDS, 1, 1, 1); | ||
| 6341 | return false; | ||
| 6342 | } | ||
| 6343 | } | ||
| 6344 | |||
| 6330 | return true; | 6345 | return true; |
| 6331 | } | 6346 | } |
| 6332 | 6347 | ||
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h index 01bffc4412d..9821fcacc3d 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drv.h +++ b/drivers/gpu/drm/nouveau/nouveau_drv.h | |||
| @@ -848,9 +848,6 @@ extern void nv10_mem_put_tile_region(struct drm_device *dev, | |||
| 848 | struct nouveau_fence *fence); | 848 | struct nouveau_fence *fence); |
| 849 | extern const struct ttm_mem_type_manager_func nouveau_vram_manager; | 849 | extern const struct ttm_mem_type_manager_func nouveau_vram_manager; |
| 850 | 850 | ||
| 851 | /* nvc0_vram.c */ | ||
| 852 | extern const struct ttm_mem_type_manager_func nvc0_vram_manager; | ||
| 853 | |||
| 854 | /* nouveau_notifier.c */ | 851 | /* nouveau_notifier.c */ |
| 855 | extern int nouveau_notifier_init_channel(struct nouveau_channel *); | 852 | extern int nouveau_notifier_init_channel(struct nouveau_channel *); |
| 856 | extern void nouveau_notifier_takedown_channel(struct nouveau_channel *); | 853 | extern void nouveau_notifier_takedown_channel(struct nouveau_channel *); |
diff --git a/drivers/gpu/drm/nouveau/nouveau_temp.c b/drivers/gpu/drm/nouveau/nouveau_temp.c index 7ecc4adc1e4..8d9968e1cba 100644 --- a/drivers/gpu/drm/nouveau/nouveau_temp.c +++ b/drivers/gpu/drm/nouveau/nouveau_temp.c | |||
| @@ -265,8 +265,8 @@ nouveau_temp_probe_i2c(struct drm_device *dev) | |||
| 265 | struct i2c_board_info info[] = { | 265 | struct i2c_board_info info[] = { |
| 266 | { I2C_BOARD_INFO("w83l785ts", 0x2d) }, | 266 | { I2C_BOARD_INFO("w83l785ts", 0x2d) }, |
| 267 | { I2C_BOARD_INFO("w83781d", 0x2d) }, | 267 | { I2C_BOARD_INFO("w83781d", 0x2d) }, |
| 268 | { I2C_BOARD_INFO("f75375", 0x2e) }, | ||
| 269 | { I2C_BOARD_INFO("adt7473", 0x2e) }, | 268 | { I2C_BOARD_INFO("adt7473", 0x2e) }, |
| 269 | { I2C_BOARD_INFO("f75375", 0x2e) }, | ||
| 270 | { I2C_BOARD_INFO("lm99", 0x4c) }, | 270 | { I2C_BOARD_INFO("lm99", 0x4c) }, |
| 271 | { } | 271 | { } |
| 272 | }; | 272 | }; |
diff --git a/drivers/gpu/drm/nouveau/nv50_graph.c b/drivers/gpu/drm/nouveau/nv50_graph.c index 2d7ea75a09d..37e21d2be95 100644 --- a/drivers/gpu/drm/nouveau/nv50_graph.c +++ b/drivers/gpu/drm/nouveau/nv50_graph.c | |||
| @@ -256,6 +256,7 @@ nv50_graph_destroy_context(struct nouveau_channel *chan) | |||
| 256 | struct drm_device *dev = chan->dev; | 256 | struct drm_device *dev = chan->dev; |
| 257 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 257 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
| 258 | struct nouveau_pgraph_engine *pgraph = &dev_priv->engine.graph; | 258 | struct nouveau_pgraph_engine *pgraph = &dev_priv->engine.graph; |
| 259 | struct nouveau_fifo_engine *pfifo = &dev_priv->engine.fifo; | ||
| 259 | int i, hdr = (dev_priv->chipset == 0x50) ? 0x200 : 0x20; | 260 | int i, hdr = (dev_priv->chipset == 0x50) ? 0x200 : 0x20; |
| 260 | unsigned long flags; | 261 | unsigned long flags; |
| 261 | 262 | ||
| @@ -265,6 +266,7 @@ nv50_graph_destroy_context(struct nouveau_channel *chan) | |||
| 265 | return; | 266 | return; |
| 266 | 267 | ||
| 267 | spin_lock_irqsave(&dev_priv->context_switch_lock, flags); | 268 | spin_lock_irqsave(&dev_priv->context_switch_lock, flags); |
| 269 | pfifo->reassign(dev, false); | ||
| 268 | pgraph->fifo_access(dev, false); | 270 | pgraph->fifo_access(dev, false); |
| 269 | 271 | ||
| 270 | if (pgraph->channel(dev) == chan) | 272 | if (pgraph->channel(dev) == chan) |
| @@ -275,6 +277,7 @@ nv50_graph_destroy_context(struct nouveau_channel *chan) | |||
| 275 | dev_priv->engine.instmem.flush(dev); | 277 | dev_priv->engine.instmem.flush(dev); |
| 276 | 278 | ||
| 277 | pgraph->fifo_access(dev, true); | 279 | pgraph->fifo_access(dev, true); |
| 280 | pfifo->reassign(dev, true); | ||
| 278 | spin_unlock_irqrestore(&dev_priv->context_switch_lock, flags); | 281 | spin_unlock_irqrestore(&dev_priv->context_switch_lock, flags); |
| 279 | 282 | ||
| 280 | nouveau_gpuobj_ref(NULL, &chan->ramin_grctx); | 283 | nouveau_gpuobj_ref(NULL, &chan->ramin_grctx); |
diff --git a/drivers/gpu/drm/nouveau/nv50_vm.c b/drivers/gpu/drm/nouveau/nv50_vm.c index 38e523e1099..459ff08241e 100644 --- a/drivers/gpu/drm/nouveau/nv50_vm.c +++ b/drivers/gpu/drm/nouveau/nv50_vm.c | |||
| @@ -45,11 +45,6 @@ nv50_vm_map_pgt(struct nouveau_gpuobj *pgd, u32 pde, | |||
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | if (phys & 1) { | 47 | if (phys & 1) { |
| 48 | if (dev_priv->vram_sys_base) { | ||
| 49 | phys += dev_priv->vram_sys_base; | ||
| 50 | phys |= 0x30; | ||
| 51 | } | ||
| 52 | |||
| 53 | if (coverage <= 32 * 1024 * 1024) | 48 | if (coverage <= 32 * 1024 * 1024) |
| 54 | phys |= 0x60; | 49 | phys |= 0x60; |
| 55 | else if (coverage <= 64 * 1024 * 1024) | 50 | else if (coverage <= 64 * 1024 * 1024) |
diff --git a/drivers/gpu/drm/nouveau/nvc0_graph.c b/drivers/gpu/drm/nouveau/nvc0_graph.c index e6ea7d83187..eb18a7e89f5 100644 --- a/drivers/gpu/drm/nouveau/nvc0_graph.c +++ b/drivers/gpu/drm/nouveau/nvc0_graph.c | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | #include "nvc0_graph.h" | 31 | #include "nvc0_graph.h" |
| 32 | 32 | ||
| 33 | static void nvc0_graph_isr(struct drm_device *); | 33 | static void nvc0_graph_isr(struct drm_device *); |
| 34 | static void nvc0_runk140_isr(struct drm_device *); | ||
| 34 | static int nvc0_graph_unload_context_to(struct drm_device *dev, u64 chan); | 35 | static int nvc0_graph_unload_context_to(struct drm_device *dev, u64 chan); |
| 35 | 36 | ||
| 36 | void | 37 | void |
| @@ -281,6 +282,7 @@ nvc0_graph_destroy(struct drm_device *dev) | |||
| 281 | return; | 282 | return; |
| 282 | 283 | ||
| 283 | nouveau_irq_unregister(dev, 12); | 284 | nouveau_irq_unregister(dev, 12); |
| 285 | nouveau_irq_unregister(dev, 25); | ||
| 284 | 286 | ||
| 285 | nouveau_gpuobj_ref(NULL, &priv->unk4188b8); | 287 | nouveau_gpuobj_ref(NULL, &priv->unk4188b8); |
| 286 | nouveau_gpuobj_ref(NULL, &priv->unk4188b4); | 288 | nouveau_gpuobj_ref(NULL, &priv->unk4188b4); |
| @@ -390,6 +392,7 @@ nvc0_graph_create(struct drm_device *dev) | |||
| 390 | } | 392 | } |
| 391 | 393 | ||
| 392 | nouveau_irq_register(dev, 12, nvc0_graph_isr); | 394 | nouveau_irq_register(dev, 12, nvc0_graph_isr); |
| 395 | nouveau_irq_register(dev, 25, nvc0_runk140_isr); | ||
| 393 | NVOBJ_CLASS(dev, 0x902d, GR); /* 2D */ | 396 | NVOBJ_CLASS(dev, 0x902d, GR); /* 2D */ |
| 394 | NVOBJ_CLASS(dev, 0x9039, GR); /* M2MF */ | 397 | NVOBJ_CLASS(dev, 0x9039, GR); /* M2MF */ |
| 395 | NVOBJ_CLASS(dev, 0x9097, GR); /* 3D */ | 398 | NVOBJ_CLASS(dev, 0x9097, GR); /* 3D */ |
| @@ -512,8 +515,8 @@ nvc0_graph_init_gpc_1(struct drm_device *dev) | |||
| 512 | nv_wr32(dev, TP_UNIT(gpc, tp, 0x224), 0xc0000000); | 515 | nv_wr32(dev, TP_UNIT(gpc, tp, 0x224), 0xc0000000); |
| 513 | nv_wr32(dev, TP_UNIT(gpc, tp, 0x48c), 0xc0000000); | 516 | nv_wr32(dev, TP_UNIT(gpc, tp, 0x48c), 0xc0000000); |
| 514 | nv_wr32(dev, TP_UNIT(gpc, tp, 0x084), 0xc0000000); | 517 | nv_wr32(dev, TP_UNIT(gpc, tp, 0x084), 0xc0000000); |
| 515 | nv_wr32(dev, TP_UNIT(gpc, tp, 0xe44), 0x001ffffe); | 518 | nv_wr32(dev, TP_UNIT(gpc, tp, 0x644), 0x001ffffe); |
| 516 | nv_wr32(dev, TP_UNIT(gpc, tp, 0xe4c), 0x0000000f); | 519 | nv_wr32(dev, TP_UNIT(gpc, tp, 0x64c), 0x0000000f); |
| 517 | } | 520 | } |
| 518 | nv_wr32(dev, GPC_UNIT(gpc, 0x2c90), 0xffffffff); | 521 | nv_wr32(dev, GPC_UNIT(gpc, 0x2c90), 0xffffffff); |
| 519 | nv_wr32(dev, GPC_UNIT(gpc, 0x2c94), 0xffffffff); | 522 | nv_wr32(dev, GPC_UNIT(gpc, 0x2c94), 0xffffffff); |
| @@ -777,3 +780,19 @@ nvc0_graph_isr(struct drm_device *dev) | |||
| 777 | 780 | ||
| 778 | nv_wr32(dev, 0x400500, 0x00010001); | 781 | nv_wr32(dev, 0x400500, 0x00010001); |
| 779 | } | 782 | } |
| 783 | |||
| 784 | static void | ||
| 785 | nvc0_runk140_isr(struct drm_device *dev) | ||
| 786 | { | ||
| 787 | u32 units = nv_rd32(dev, 0x00017c) & 0x1f; | ||
| 788 | |||
| 789 | while (units) { | ||
| 790 | u32 unit = ffs(units) - 1; | ||
| 791 | u32 reg = 0x140000 + unit * 0x2000; | ||
| 792 | u32 st0 = nv_mask(dev, reg + 0x1020, 0, 0); | ||
| 793 | u32 st1 = nv_mask(dev, reg + 0x1420, 0, 0); | ||
| 794 | |||
| 795 | NV_INFO(dev, "PRUNK140: %d 0x%08x 0x%08x\n", unit, st0, st1); | ||
| 796 | units &= ~(1 << unit); | ||
| 797 | } | ||
| 798 | } | ||
diff --git a/drivers/gpu/drm/nouveau/nvc0_grctx.c b/drivers/gpu/drm/nouveau/nvc0_grctx.c index b9e68b2d30a..f880ff776db 100644 --- a/drivers/gpu/drm/nouveau/nvc0_grctx.c +++ b/drivers/gpu/drm/nouveau/nvc0_grctx.c | |||
| @@ -1830,7 +1830,7 @@ nvc0_grctx_generate(struct nouveau_channel *chan) | |||
| 1830 | 1830 | ||
| 1831 | for (tp = 0, id = 0; tp < 4; tp++) { | 1831 | for (tp = 0, id = 0; tp < 4; tp++) { |
| 1832 | for (gpc = 0; gpc < priv->gpc_nr; gpc++) { | 1832 | for (gpc = 0; gpc < priv->gpc_nr; gpc++) { |
| 1833 | if (tp <= priv->tp_nr[gpc]) { | 1833 | if (tp < priv->tp_nr[gpc]) { |
| 1834 | nv_wr32(dev, TP_UNIT(gpc, tp, 0x698), id); | 1834 | nv_wr32(dev, TP_UNIT(gpc, tp, 0x698), id); |
| 1835 | nv_wr32(dev, TP_UNIT(gpc, tp, 0x4e8), id); | 1835 | nv_wr32(dev, TP_UNIT(gpc, tp, 0x4e8), id); |
| 1836 | nv_wr32(dev, GPC_UNIT(gpc, 0x0c10 + tp * 4), id); | 1836 | nv_wr32(dev, GPC_UNIT(gpc, 0x0c10 + tp * 4), id); |
diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c index d3ca17080df..842954fe74c 100644 --- a/drivers/gpu/drm/radeon/atombios_crtc.c +++ b/drivers/gpu/drm/radeon/atombios_crtc.c | |||
| @@ -994,6 +994,7 @@ static int evergreen_crtc_do_set_base(struct drm_crtc *crtc, | |||
| 994 | struct radeon_bo *rbo; | 994 | struct radeon_bo *rbo; |
| 995 | uint64_t fb_location; | 995 | uint64_t fb_location; |
| 996 | uint32_t fb_format, fb_pitch_pixels, tiling_flags; | 996 | uint32_t fb_format, fb_pitch_pixels, tiling_flags; |
| 997 | u32 fb_swap = EVERGREEN_GRPH_ENDIAN_SWAP(EVERGREEN_GRPH_ENDIAN_NONE); | ||
| 997 | int r; | 998 | int r; |
| 998 | 999 | ||
| 999 | /* no fb bound */ | 1000 | /* no fb bound */ |
| @@ -1045,11 +1046,17 @@ static int evergreen_crtc_do_set_base(struct drm_crtc *crtc, | |||
| 1045 | case 16: | 1046 | case 16: |
| 1046 | fb_format = (EVERGREEN_GRPH_DEPTH(EVERGREEN_GRPH_DEPTH_16BPP) | | 1047 | fb_format = (EVERGREEN_GRPH_DEPTH(EVERGREEN_GRPH_DEPTH_16BPP) | |
| 1047 | EVERGREEN_GRPH_FORMAT(EVERGREEN_GRPH_FORMAT_ARGB565)); | 1048 | EVERGREEN_GRPH_FORMAT(EVERGREEN_GRPH_FORMAT_ARGB565)); |
| 1049 | #ifdef __BIG_ENDIAN | ||
| 1050 | fb_swap = EVERGREEN_GRPH_ENDIAN_SWAP(EVERGREEN_GRPH_ENDIAN_8IN16); | ||
| 1051 | #endif | ||
| 1048 | break; | 1052 | break; |
| 1049 | case 24: | 1053 | case 24: |
| 1050 | case 32: | 1054 | case 32: |
| 1051 | fb_format = (EVERGREEN_GRPH_DEPTH(EVERGREEN_GRPH_DEPTH_32BPP) | | 1055 | fb_format = (EVERGREEN_GRPH_DEPTH(EVERGREEN_GRPH_DEPTH_32BPP) | |
| 1052 | EVERGREEN_GRPH_FORMAT(EVERGREEN_GRPH_FORMAT_ARGB8888)); | 1056 | EVERGREEN_GRPH_FORMAT(EVERGREEN_GRPH_FORMAT_ARGB8888)); |
| 1057 | #ifdef __BIG_ENDIAN | ||
| 1058 | fb_swap = EVERGREEN_GRPH_ENDIAN_SWAP(EVERGREEN_GRPH_ENDIAN_8IN32); | ||
| 1059 | #endif | ||
| 1053 | break; | 1060 | break; |
| 1054 | default: | 1061 | default: |
| 1055 | DRM_ERROR("Unsupported screen depth %d\n", | 1062 | DRM_ERROR("Unsupported screen depth %d\n", |
| @@ -1094,6 +1101,7 @@ static int evergreen_crtc_do_set_base(struct drm_crtc *crtc, | |||
| 1094 | WREG32(EVERGREEN_GRPH_SECONDARY_SURFACE_ADDRESS + radeon_crtc->crtc_offset, | 1101 | WREG32(EVERGREEN_GRPH_SECONDARY_SURFACE_ADDRESS + radeon_crtc->crtc_offset, |
| 1095 | (u32) fb_location & EVERGREEN_GRPH_SURFACE_ADDRESS_MASK); | 1102 | (u32) fb_location & EVERGREEN_GRPH_SURFACE_ADDRESS_MASK); |
| 1096 | WREG32(EVERGREEN_GRPH_CONTROL + radeon_crtc->crtc_offset, fb_format); | 1103 | WREG32(EVERGREEN_GRPH_CONTROL + radeon_crtc->crtc_offset, fb_format); |
| 1104 | WREG32(EVERGREEN_GRPH_SWAP_CONTROL + radeon_crtc->crtc_offset, fb_swap); | ||
| 1097 | 1105 | ||
| 1098 | WREG32(EVERGREEN_GRPH_SURFACE_OFFSET_X + radeon_crtc->crtc_offset, 0); | 1106 | WREG32(EVERGREEN_GRPH_SURFACE_OFFSET_X + radeon_crtc->crtc_offset, 0); |
| 1099 | WREG32(EVERGREEN_GRPH_SURFACE_OFFSET_Y + radeon_crtc->crtc_offset, 0); | 1107 | WREG32(EVERGREEN_GRPH_SURFACE_OFFSET_Y + radeon_crtc->crtc_offset, 0); |
| @@ -1150,6 +1158,7 @@ static int avivo_crtc_do_set_base(struct drm_crtc *crtc, | |||
| 1150 | struct drm_framebuffer *target_fb; | 1158 | struct drm_framebuffer *target_fb; |
| 1151 | uint64_t fb_location; | 1159 | uint64_t fb_location; |
| 1152 | uint32_t fb_format, fb_pitch_pixels, tiling_flags; | 1160 | uint32_t fb_format, fb_pitch_pixels, tiling_flags; |
| 1161 | u32 fb_swap = R600_D1GRPH_SWAP_ENDIAN_NONE; | ||
| 1153 | int r; | 1162 | int r; |
| 1154 | 1163 | ||
| 1155 | /* no fb bound */ | 1164 | /* no fb bound */ |
| @@ -1203,12 +1212,18 @@ static int avivo_crtc_do_set_base(struct drm_crtc *crtc, | |||
| 1203 | fb_format = | 1212 | fb_format = |
| 1204 | AVIVO_D1GRPH_CONTROL_DEPTH_16BPP | | 1213 | AVIVO_D1GRPH_CONTROL_DEPTH_16BPP | |
| 1205 | AVIVO_D1GRPH_CONTROL_16BPP_RGB565; | 1214 | AVIVO_D1GRPH_CONTROL_16BPP_RGB565; |
| 1215 | #ifdef __BIG_ENDIAN | ||
| 1216 | fb_swap = R600_D1GRPH_SWAP_ENDIAN_16BIT; | ||
| 1217 | #endif | ||
| 1206 | break; | 1218 | break; |
| 1207 | case 24: | 1219 | case 24: |
| 1208 | case 32: | 1220 | case 32: |
| 1209 | fb_format = | 1221 | fb_format = |
| 1210 | AVIVO_D1GRPH_CONTROL_DEPTH_32BPP | | 1222 | AVIVO_D1GRPH_CONTROL_DEPTH_32BPP | |
| 1211 | AVIVO_D1GRPH_CONTROL_32BPP_ARGB8888; | 1223 | AVIVO_D1GRPH_CONTROL_32BPP_ARGB8888; |
| 1224 | #ifdef __BIG_ENDIAN | ||
| 1225 | fb_swap = R600_D1GRPH_SWAP_ENDIAN_32BIT; | ||
| 1226 | #endif | ||
| 1212 | break; | 1227 | break; |
| 1213 | default: | 1228 | default: |
| 1214 | DRM_ERROR("Unsupported screen depth %d\n", | 1229 | DRM_ERROR("Unsupported screen depth %d\n", |
| @@ -1248,6 +1263,8 @@ static int avivo_crtc_do_set_base(struct drm_crtc *crtc, | |||
| 1248 | WREG32(AVIVO_D1GRPH_SECONDARY_SURFACE_ADDRESS + | 1263 | WREG32(AVIVO_D1GRPH_SECONDARY_SURFACE_ADDRESS + |
| 1249 | radeon_crtc->crtc_offset, (u32) fb_location); | 1264 | radeon_crtc->crtc_offset, (u32) fb_location); |
| 1250 | WREG32(AVIVO_D1GRPH_CONTROL + radeon_crtc->crtc_offset, fb_format); | 1265 | WREG32(AVIVO_D1GRPH_CONTROL + radeon_crtc->crtc_offset, fb_format); |
| 1266 | if (rdev->family >= CHIP_R600) | ||
| 1267 | WREG32(R600_D1GRPH_SWAP_CONTROL + radeon_crtc->crtc_offset, fb_swap); | ||
| 1251 | 1268 | ||
| 1252 | WREG32(AVIVO_D1GRPH_SURFACE_OFFSET_X + radeon_crtc->crtc_offset, 0); | 1269 | WREG32(AVIVO_D1GRPH_SURFACE_OFFSET_X + radeon_crtc->crtc_offset, 0); |
| 1253 | WREG32(AVIVO_D1GRPH_SURFACE_OFFSET_Y + radeon_crtc->crtc_offset, 0); | 1270 | WREG32(AVIVO_D1GRPH_SURFACE_OFFSET_Y + radeon_crtc->crtc_offset, 0); |
diff --git a/drivers/gpu/drm/radeon/atombios_dp.c b/drivers/gpu/drm/radeon/atombios_dp.c index 4e7778d44b8..695de9a3850 100644 --- a/drivers/gpu/drm/radeon/atombios_dp.c +++ b/drivers/gpu/drm/radeon/atombios_dp.c | |||
| @@ -187,9 +187,9 @@ static int dp_link_clock_for_mode_clock(u8 dpcd[DP_DPCD_SIZE], int mode_clock) | |||
| 187 | int dp_mode_valid(u8 dpcd[DP_DPCD_SIZE], int mode_clock) | 187 | int dp_mode_valid(u8 dpcd[DP_DPCD_SIZE], int mode_clock) |
| 188 | { | 188 | { |
| 189 | int lanes = dp_lanes_for_mode_clock(dpcd, mode_clock); | 189 | int lanes = dp_lanes_for_mode_clock(dpcd, mode_clock); |
| 190 | int bw = dp_lanes_for_mode_clock(dpcd, mode_clock); | 190 | int dp_clock = dp_link_clock_for_mode_clock(dpcd, mode_clock); |
| 191 | 191 | ||
| 192 | if ((lanes == 0) || (bw == 0)) | 192 | if ((lanes == 0) || (dp_clock == 0)) |
| 193 | return MODE_CLOCK_HIGH; | 193 | return MODE_CLOCK_HIGH; |
| 194 | 194 | ||
| 195 | return MODE_OK; | 195 | return MODE_OK; |
diff --git a/drivers/gpu/drm/radeon/evergreen_blit_kms.c b/drivers/gpu/drm/radeon/evergreen_blit_kms.c index b758dc7f2f2..d4d4db49a8b 100644 --- a/drivers/gpu/drm/radeon/evergreen_blit_kms.c +++ b/drivers/gpu/drm/radeon/evergreen_blit_kms.c | |||
| @@ -232,7 +232,7 @@ draw_auto(struct radeon_device *rdev) | |||
| 232 | 232 | ||
| 233 | } | 233 | } |
| 234 | 234 | ||
| 235 | /* emits 30 */ | 235 | /* emits 34 */ |
| 236 | static void | 236 | static void |
| 237 | set_default_state(struct radeon_device *rdev) | 237 | set_default_state(struct radeon_device *rdev) |
| 238 | { | 238 | { |
| @@ -245,6 +245,8 @@ set_default_state(struct radeon_device *rdev) | |||
| 245 | int num_hs_threads, num_ls_threads; | 245 | int num_hs_threads, num_ls_threads; |
| 246 | int num_ps_stack_entries, num_vs_stack_entries, num_gs_stack_entries, num_es_stack_entries; | 246 | int num_ps_stack_entries, num_vs_stack_entries, num_gs_stack_entries, num_es_stack_entries; |
| 247 | int num_hs_stack_entries, num_ls_stack_entries; | 247 | int num_hs_stack_entries, num_ls_stack_entries; |
| 248 | u64 gpu_addr; | ||
| 249 | int dwords; | ||
| 248 | 250 | ||
| 249 | switch (rdev->family) { | 251 | switch (rdev->family) { |
| 250 | case CHIP_CEDAR: | 252 | case CHIP_CEDAR: |
| @@ -497,6 +499,14 @@ set_default_state(struct radeon_device *rdev) | |||
| 497 | radeon_ring_write(rdev, 0x00000000); | 499 | radeon_ring_write(rdev, 0x00000000); |
| 498 | radeon_ring_write(rdev, 0x00000000); | 500 | radeon_ring_write(rdev, 0x00000000); |
| 499 | 501 | ||
| 502 | /* emit an IB pointing at default state */ | ||
| 503 | dwords = ALIGN(rdev->r600_blit.state_len, 0x10); | ||
| 504 | gpu_addr = rdev->r600_blit.shader_gpu_addr + rdev->r600_blit.state_offset; | ||
| 505 | radeon_ring_write(rdev, PACKET3(PACKET3_INDIRECT_BUFFER, 2)); | ||
| 506 | radeon_ring_write(rdev, gpu_addr & 0xFFFFFFFC); | ||
| 507 | radeon_ring_write(rdev, upper_32_bits(gpu_addr) & 0xFF); | ||
| 508 | radeon_ring_write(rdev, dwords); | ||
| 509 | |||
| 500 | } | 510 | } |
| 501 | 511 | ||
| 502 | static inline uint32_t i2f(uint32_t input) | 512 | static inline uint32_t i2f(uint32_t input) |
| @@ -527,8 +537,10 @@ static inline uint32_t i2f(uint32_t input) | |||
| 527 | int evergreen_blit_init(struct radeon_device *rdev) | 537 | int evergreen_blit_init(struct radeon_device *rdev) |
| 528 | { | 538 | { |
| 529 | u32 obj_size; | 539 | u32 obj_size; |
| 530 | int r; | 540 | int r, dwords; |
| 531 | void *ptr; | 541 | void *ptr; |
| 542 | u32 packet2s[16]; | ||
| 543 | int num_packet2s = 0; | ||
| 532 | 544 | ||
| 533 | /* pin copy shader into vram if already initialized */ | 545 | /* pin copy shader into vram if already initialized */ |
| 534 | if (rdev->r600_blit.shader_obj) | 546 | if (rdev->r600_blit.shader_obj) |
| @@ -536,8 +548,17 @@ int evergreen_blit_init(struct radeon_device *rdev) | |||
| 536 | 548 | ||
| 537 | mutex_init(&rdev->r600_blit.mutex); | 549 | mutex_init(&rdev->r600_blit.mutex); |
| 538 | rdev->r600_blit.state_offset = 0; | 550 | rdev->r600_blit.state_offset = 0; |
| 539 | rdev->r600_blit.state_len = 0; | 551 | |
| 540 | obj_size = 0; | 552 | rdev->r600_blit.state_len = evergreen_default_size; |
| 553 | |||
| 554 | dwords = rdev->r600_blit.state_len; | ||
| 555 | while (dwords & 0xf) { | ||
| 556 | packet2s[num_packet2s++] = PACKET2(0); | ||
| 557 | dwords++; | ||
| 558 | } | ||
| 559 | |||
| 560 | obj_size = dwords * 4; | ||
| 561 | obj_size = ALIGN(obj_size, 256); | ||
| 541 | 562 | ||
| 542 | rdev->r600_blit.vs_offset = obj_size; | 563 | rdev->r600_blit.vs_offset = obj_size; |
| 543 | obj_size += evergreen_vs_size * 4; | 564 | obj_size += evergreen_vs_size * 4; |
| @@ -567,6 +588,12 @@ int evergreen_blit_init(struct radeon_device *rdev) | |||
| 567 | return r; | 588 | return r; |
| 568 | } | 589 | } |
| 569 | 590 | ||
| 591 | memcpy_toio(ptr + rdev->r600_blit.state_offset, | ||
| 592 | evergreen_default_state, rdev->r600_blit.state_len * 4); | ||
| 593 | |||
| 594 | if (num_packet2s) | ||
| 595 | memcpy_toio(ptr + rdev->r600_blit.state_offset + (rdev->r600_blit.state_len * 4), | ||
| 596 | packet2s, num_packet2s * 4); | ||
| 570 | memcpy(ptr + rdev->r600_blit.vs_offset, evergreen_vs, evergreen_vs_size * 4); | 597 | memcpy(ptr + rdev->r600_blit.vs_offset, evergreen_vs, evergreen_vs_size * 4); |
| 571 | memcpy(ptr + rdev->r600_blit.ps_offset, evergreen_ps, evergreen_ps_size * 4); | 598 | memcpy(ptr + rdev->r600_blit.ps_offset, evergreen_ps, evergreen_ps_size * 4); |
| 572 | radeon_bo_kunmap(rdev->r600_blit.shader_obj); | 599 | radeon_bo_kunmap(rdev->r600_blit.shader_obj); |
| @@ -652,7 +679,7 @@ int evergreen_blit_prepare_copy(struct radeon_device *rdev, int size_bytes) | |||
| 652 | /* calculate number of loops correctly */ | 679 | /* calculate number of loops correctly */ |
| 653 | ring_size = num_loops * dwords_per_loop; | 680 | ring_size = num_loops * dwords_per_loop; |
| 654 | /* set default + shaders */ | 681 | /* set default + shaders */ |
| 655 | ring_size += 46; /* shaders + def state */ | 682 | ring_size += 50; /* shaders + def state */ |
| 656 | ring_size += 10; /* fence emit for VB IB */ | 683 | ring_size += 10; /* fence emit for VB IB */ |
| 657 | ring_size += 5; /* done copy */ | 684 | ring_size += 5; /* done copy */ |
| 658 | ring_size += 10; /* fence emit for done copy */ | 685 | ring_size += 10; /* fence emit for done copy */ |
| @@ -660,7 +687,7 @@ int evergreen_blit_prepare_copy(struct radeon_device *rdev, int size_bytes) | |||
| 660 | if (r) | 687 | if (r) |
| 661 | return r; | 688 | return r; |
| 662 | 689 | ||
| 663 | set_default_state(rdev); /* 30 */ | 690 | set_default_state(rdev); /* 34 */ |
| 664 | set_shaders(rdev); /* 16 */ | 691 | set_shaders(rdev); /* 16 */ |
| 665 | return 0; | 692 | return 0; |
| 666 | } | 693 | } |
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c index 5968dde243e..5f15820efe1 100644 --- a/drivers/gpu/drm/radeon/r100.c +++ b/drivers/gpu/drm/radeon/r100.c | |||
| @@ -1031,8 +1031,8 @@ int r100_cp_init(struct radeon_device *rdev, unsigned ring_size) | |||
| 1031 | WREG32(RADEON_CP_CSQ_MODE, | 1031 | WREG32(RADEON_CP_CSQ_MODE, |
| 1032 | REG_SET(RADEON_INDIRECT2_START, indirect2_start) | | 1032 | REG_SET(RADEON_INDIRECT2_START, indirect2_start) | |
| 1033 | REG_SET(RADEON_INDIRECT1_START, indirect1_start)); | 1033 | REG_SET(RADEON_INDIRECT1_START, indirect1_start)); |
| 1034 | WREG32(0x718, 0); | 1034 | WREG32(RADEON_CP_RB_WPTR_DELAY, 0); |
| 1035 | WREG32(0x744, 0x00004D4D); | 1035 | WREG32(RADEON_CP_CSQ_MODE, 0x00004D4D); |
| 1036 | WREG32(RADEON_CP_CSQ_CNTL, RADEON_CSQ_PRIBM_INDBM); | 1036 | WREG32(RADEON_CP_CSQ_CNTL, RADEON_CSQ_PRIBM_INDBM); |
| 1037 | radeon_ring_start(rdev); | 1037 | radeon_ring_start(rdev); |
| 1038 | r = radeon_ring_test(rdev); | 1038 | r = radeon_ring_test(rdev); |
| @@ -2347,10 +2347,10 @@ void r100_vga_set_state(struct radeon_device *rdev, bool state) | |||
| 2347 | 2347 | ||
| 2348 | temp = RREG32(RADEON_CONFIG_CNTL); | 2348 | temp = RREG32(RADEON_CONFIG_CNTL); |
| 2349 | if (state == false) { | 2349 | if (state == false) { |
| 2350 | temp &= ~(1<<8); | 2350 | temp &= ~RADEON_CFG_VGA_RAM_EN; |
| 2351 | temp |= (1<<9); | 2351 | temp |= RADEON_CFG_VGA_IO_DIS; |
| 2352 | } else { | 2352 | } else { |
| 2353 | temp &= ~(1<<9); | 2353 | temp &= ~RADEON_CFG_VGA_IO_DIS; |
| 2354 | } | 2354 | } |
| 2355 | WREG32(RADEON_CONFIG_CNTL, temp); | 2355 | WREG32(RADEON_CONFIG_CNTL, temp); |
| 2356 | } | 2356 | } |
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c index cf862ca580b..55fe5ba7def 100644 --- a/drivers/gpu/drm/radeon/r300.c +++ b/drivers/gpu/drm/radeon/r300.c | |||
| @@ -69,6 +69,9 @@ void rv370_pcie_gart_tlb_flush(struct radeon_device *rdev) | |||
| 69 | mb(); | 69 | mb(); |
| 70 | } | 70 | } |
| 71 | 71 | ||
| 72 | #define R300_PTE_WRITEABLE (1 << 2) | ||
| 73 | #define R300_PTE_READABLE (1 << 3) | ||
| 74 | |||
| 72 | int rv370_pcie_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr) | 75 | int rv370_pcie_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr) |
| 73 | { | 76 | { |
| 74 | void __iomem *ptr = (void *)rdev->gart.table.vram.ptr; | 77 | void __iomem *ptr = (void *)rdev->gart.table.vram.ptr; |
| @@ -78,7 +81,7 @@ int rv370_pcie_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr) | |||
| 78 | } | 81 | } |
| 79 | addr = (lower_32_bits(addr) >> 8) | | 82 | addr = (lower_32_bits(addr) >> 8) | |
| 80 | ((upper_32_bits(addr) & 0xff) << 24) | | 83 | ((upper_32_bits(addr) & 0xff) << 24) | |
| 81 | 0xc; | 84 | R300_PTE_WRITEABLE | R300_PTE_READABLE; |
| 82 | /* on x86 we want this to be CPU endian, on powerpc | 85 | /* on x86 we want this to be CPU endian, on powerpc |
| 83 | * on powerpc without HW swappers, it'll get swapped on way | 86 | * on powerpc without HW swappers, it'll get swapped on way |
| 84 | * into VRAM - so no need for cpu_to_le32 on VRAM tables */ | 87 | * into VRAM - so no need for cpu_to_le32 on VRAM tables */ |
| @@ -135,7 +138,7 @@ int rv370_pcie_gart_enable(struct radeon_device *rdev) | |||
| 135 | WREG32_PCIE(RADEON_PCIE_TX_DISCARD_RD_ADDR_LO, rdev->mc.vram_start); | 138 | WREG32_PCIE(RADEON_PCIE_TX_DISCARD_RD_ADDR_LO, rdev->mc.vram_start); |
| 136 | WREG32_PCIE(RADEON_PCIE_TX_DISCARD_RD_ADDR_HI, 0); | 139 | WREG32_PCIE(RADEON_PCIE_TX_DISCARD_RD_ADDR_HI, 0); |
| 137 | /* Clear error */ | 140 | /* Clear error */ |
| 138 | WREG32_PCIE(0x18, 0); | 141 | WREG32_PCIE(RADEON_PCIE_TX_GART_ERROR, 0); |
| 139 | tmp = RREG32_PCIE(RADEON_PCIE_TX_GART_CNTL); | 142 | tmp = RREG32_PCIE(RADEON_PCIE_TX_GART_CNTL); |
| 140 | tmp |= RADEON_PCIE_TX_GART_EN; | 143 | tmp |= RADEON_PCIE_TX_GART_EN; |
| 141 | tmp |= RADEON_PCIE_TX_GART_UNMAPPED_ACCESS_DISCARD; | 144 | tmp |= RADEON_PCIE_TX_GART_UNMAPPED_ACCESS_DISCARD; |
diff --git a/drivers/gpu/drm/radeon/r420.c b/drivers/gpu/drm/radeon/r420.c index c387346f93a..0b59ed7c7d2 100644 --- a/drivers/gpu/drm/radeon/r420.c +++ b/drivers/gpu/drm/radeon/r420.c | |||
| @@ -96,7 +96,7 @@ void r420_pipes_init(struct radeon_device *rdev) | |||
| 96 | "programming pipes. Bad things might happen.\n"); | 96 | "programming pipes. Bad things might happen.\n"); |
| 97 | } | 97 | } |
| 98 | /* get max number of pipes */ | 98 | /* get max number of pipes */ |
| 99 | gb_pipe_select = RREG32(0x402C); | 99 | gb_pipe_select = RREG32(R400_GB_PIPE_SELECT); |
| 100 | num_pipes = ((gb_pipe_select >> 12) & 3) + 1; | 100 | num_pipes = ((gb_pipe_select >> 12) & 3) + 1; |
| 101 | 101 | ||
| 102 | /* SE chips have 1 pipe */ | 102 | /* SE chips have 1 pipe */ |
diff --git a/drivers/gpu/drm/radeon/r520.c b/drivers/gpu/drm/radeon/r520.c index 3c8677f9e38..2ce80d97656 100644 --- a/drivers/gpu/drm/radeon/r520.c +++ b/drivers/gpu/drm/radeon/r520.c | |||
| @@ -79,8 +79,8 @@ static void r520_gpu_init(struct radeon_device *rdev) | |||
| 79 | WREG32(0x4128, 0xFF); | 79 | WREG32(0x4128, 0xFF); |
| 80 | } | 80 | } |
| 81 | r420_pipes_init(rdev); | 81 | r420_pipes_init(rdev); |
| 82 | gb_pipe_select = RREG32(0x402C); | 82 | gb_pipe_select = RREG32(R400_GB_PIPE_SELECT); |
| 83 | tmp = RREG32(0x170C); | 83 | tmp = RREG32(R300_DST_PIPE_CONFIG); |
| 84 | pipe_select_current = (tmp >> 2) & 3; | 84 | pipe_select_current = (tmp >> 2) & 3; |
| 85 | tmp = (1 << pipe_select_current) | | 85 | tmp = (1 << pipe_select_current) | |
| 86 | (((gb_pipe_select >> 8) & 0xF) << 4); | 86 | (((gb_pipe_select >> 8) & 0xF) << 4); |
diff --git a/drivers/gpu/drm/radeon/r600_reg.h b/drivers/gpu/drm/radeon/r600_reg.h index 33cda016b08..f869897c745 100644 --- a/drivers/gpu/drm/radeon/r600_reg.h +++ b/drivers/gpu/drm/radeon/r600_reg.h | |||
| @@ -81,7 +81,11 @@ | |||
| 81 | #define R600_MEDIUM_VID_LOWER_GPIO_CNTL 0x720 | 81 | #define R600_MEDIUM_VID_LOWER_GPIO_CNTL 0x720 |
| 82 | #define R600_LOW_VID_LOWER_GPIO_CNTL 0x724 | 82 | #define R600_LOW_VID_LOWER_GPIO_CNTL 0x724 |
| 83 | 83 | ||
| 84 | 84 | #define R600_D1GRPH_SWAP_CONTROL 0x610C | |
| 85 | # define R600_D1GRPH_SWAP_ENDIAN_NONE (0 << 0) | ||
| 86 | # define R600_D1GRPH_SWAP_ENDIAN_16BIT (1 << 0) | ||
| 87 | # define R600_D1GRPH_SWAP_ENDIAN_32BIT (2 << 0) | ||
| 88 | # define R600_D1GRPH_SWAP_ENDIAN_64BIT (3 << 0) | ||
| 85 | 89 | ||
| 86 | #define R600_HDP_NONSURFACE_BASE 0x2c04 | 90 | #define R600_HDP_NONSURFACE_BASE 0x2c04 |
| 87 | 91 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c index 8fd184286c0..5e90984d5ad 100644 --- a/drivers/gpu/drm/radeon/radeon_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_encoders.c | |||
| @@ -641,7 +641,7 @@ atombios_get_encoder_mode(struct drm_encoder *encoder) | |||
| 641 | switch (connector->connector_type) { | 641 | switch (connector->connector_type) { |
| 642 | case DRM_MODE_CONNECTOR_DVII: | 642 | case DRM_MODE_CONNECTOR_DVII: |
| 643 | case DRM_MODE_CONNECTOR_HDMIB: /* HDMI-B is basically DL-DVI; analog works fine */ | 643 | case DRM_MODE_CONNECTOR_HDMIB: /* HDMI-B is basically DL-DVI; analog works fine */ |
| 644 | if (drm_detect_monitor_audio(radeon_connector->edid)) { | 644 | if (drm_detect_monitor_audio(radeon_connector->edid) && radeon_audio) { |
| 645 | /* fix me */ | 645 | /* fix me */ |
| 646 | if (ASIC_IS_DCE4(rdev)) | 646 | if (ASIC_IS_DCE4(rdev)) |
| 647 | return ATOM_ENCODER_MODE_DVI; | 647 | return ATOM_ENCODER_MODE_DVI; |
| @@ -655,7 +655,7 @@ atombios_get_encoder_mode(struct drm_encoder *encoder) | |||
| 655 | case DRM_MODE_CONNECTOR_DVID: | 655 | case DRM_MODE_CONNECTOR_DVID: |
| 656 | case DRM_MODE_CONNECTOR_HDMIA: | 656 | case DRM_MODE_CONNECTOR_HDMIA: |
| 657 | default: | 657 | default: |
| 658 | if (drm_detect_monitor_audio(radeon_connector->edid)) { | 658 | if (drm_detect_monitor_audio(radeon_connector->edid) && radeon_audio) { |
| 659 | /* fix me */ | 659 | /* fix me */ |
| 660 | if (ASIC_IS_DCE4(rdev)) | 660 | if (ASIC_IS_DCE4(rdev)) |
| 661 | return ATOM_ENCODER_MODE_DVI; | 661 | return ATOM_ENCODER_MODE_DVI; |
| @@ -673,7 +673,7 @@ atombios_get_encoder_mode(struct drm_encoder *encoder) | |||
| 673 | if ((dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) || | 673 | if ((dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) || |
| 674 | (dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_eDP)) | 674 | (dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_eDP)) |
| 675 | return ATOM_ENCODER_MODE_DP; | 675 | return ATOM_ENCODER_MODE_DP; |
| 676 | else if (drm_detect_monitor_audio(radeon_connector->edid)) { | 676 | else if (drm_detect_monitor_audio(radeon_connector->edid) && radeon_audio) { |
| 677 | /* fix me */ | 677 | /* fix me */ |
| 678 | if (ASIC_IS_DCE4(rdev)) | 678 | if (ASIC_IS_DCE4(rdev)) |
| 679 | return ATOM_ENCODER_MODE_DVI; | 679 | return ATOM_ENCODER_MODE_DVI; |
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c index 98321298cff..8387d32caaa 100644 --- a/drivers/gpu/drm/radeon/radeon_kms.c +++ b/drivers/gpu/drm/radeon/radeon_kms.c | |||
| @@ -247,6 +247,8 @@ void radeon_driver_preclose_kms(struct drm_device *dev, | |||
| 247 | struct radeon_device *rdev = dev->dev_private; | 247 | struct radeon_device *rdev = dev->dev_private; |
| 248 | if (rdev->hyperz_filp == file_priv) | 248 | if (rdev->hyperz_filp == file_priv) |
| 249 | rdev->hyperz_filp = NULL; | 249 | rdev->hyperz_filp = NULL; |
| 250 | if (rdev->cmask_filp == file_priv) | ||
| 251 | rdev->cmask_filp = NULL; | ||
| 250 | } | 252 | } |
| 251 | 253 | ||
| 252 | /* | 254 | /* |
diff --git a/drivers/gpu/drm/radeon/radeon_reg.h b/drivers/gpu/drm/radeon/radeon_reg.h index 3cd4dace57c..ec93a75369e 100644 --- a/drivers/gpu/drm/radeon/radeon_reg.h +++ b/drivers/gpu/drm/radeon/radeon_reg.h | |||
| @@ -375,6 +375,8 @@ | |||
| 375 | #define RADEON_CONFIG_APER_SIZE 0x0108 | 375 | #define RADEON_CONFIG_APER_SIZE 0x0108 |
| 376 | #define RADEON_CONFIG_BONDS 0x00e8 | 376 | #define RADEON_CONFIG_BONDS 0x00e8 |
| 377 | #define RADEON_CONFIG_CNTL 0x00e0 | 377 | #define RADEON_CONFIG_CNTL 0x00e0 |
| 378 | # define RADEON_CFG_VGA_RAM_EN (1 << 8) | ||
| 379 | # define RADEON_CFG_VGA_IO_DIS (1 << 9) | ||
| 378 | # define RADEON_CFG_ATI_REV_A11 (0 << 16) | 380 | # define RADEON_CFG_ATI_REV_A11 (0 << 16) |
| 379 | # define RADEON_CFG_ATI_REV_A12 (1 << 16) | 381 | # define RADEON_CFG_ATI_REV_A12 (1 << 16) |
| 380 | # define RADEON_CFG_ATI_REV_A13 (2 << 16) | 382 | # define RADEON_CFG_ATI_REV_A13 (2 << 16) |
diff --git a/drivers/gpu/drm/radeon/rs400.c b/drivers/gpu/drm/radeon/rs400.c index 5512e4e5e63..c76283d9eb3 100644 --- a/drivers/gpu/drm/radeon/rs400.c +++ b/drivers/gpu/drm/radeon/rs400.c | |||
| @@ -203,6 +203,9 @@ void rs400_gart_fini(struct radeon_device *rdev) | |||
| 203 | radeon_gart_table_ram_free(rdev); | 203 | radeon_gart_table_ram_free(rdev); |
| 204 | } | 204 | } |
| 205 | 205 | ||
| 206 | #define RS400_PTE_WRITEABLE (1 << 2) | ||
| 207 | #define RS400_PTE_READABLE (1 << 3) | ||
| 208 | |||
| 206 | int rs400_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr) | 209 | int rs400_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr) |
| 207 | { | 210 | { |
| 208 | uint32_t entry; | 211 | uint32_t entry; |
| @@ -213,7 +216,7 @@ int rs400_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr) | |||
| 213 | 216 | ||
| 214 | entry = (lower_32_bits(addr) & PAGE_MASK) | | 217 | entry = (lower_32_bits(addr) & PAGE_MASK) | |
| 215 | ((upper_32_bits(addr) & 0xff) << 4) | | 218 | ((upper_32_bits(addr) & 0xff) << 4) | |
| 216 | 0xc; | 219 | RS400_PTE_WRITEABLE | RS400_PTE_READABLE; |
| 217 | entry = cpu_to_le32(entry); | 220 | entry = cpu_to_le32(entry); |
| 218 | rdev->gart.table.ram.ptr[i] = entry; | 221 | rdev->gart.table.ram.ptr[i] = entry; |
| 219 | return 0; | 222 | return 0; |
| @@ -226,8 +229,8 @@ int rs400_mc_wait_for_idle(struct radeon_device *rdev) | |||
| 226 | 229 | ||
| 227 | for (i = 0; i < rdev->usec_timeout; i++) { | 230 | for (i = 0; i < rdev->usec_timeout; i++) { |
| 228 | /* read MC_STATUS */ | 231 | /* read MC_STATUS */ |
| 229 | tmp = RREG32(0x0150); | 232 | tmp = RREG32(RADEON_MC_STATUS); |
| 230 | if (tmp & (1 << 2)) { | 233 | if (tmp & RADEON_MC_IDLE) { |
| 231 | return 0; | 234 | return 0; |
| 232 | } | 235 | } |
| 233 | DRM_UDELAY(1); | 236 | DRM_UDELAY(1); |
| @@ -241,7 +244,7 @@ void rs400_gpu_init(struct radeon_device *rdev) | |||
| 241 | r420_pipes_init(rdev); | 244 | r420_pipes_init(rdev); |
| 242 | if (rs400_mc_wait_for_idle(rdev)) { | 245 | if (rs400_mc_wait_for_idle(rdev)) { |
| 243 | printk(KERN_WARNING "rs400: Failed to wait MC idle while " | 246 | printk(KERN_WARNING "rs400: Failed to wait MC idle while " |
| 244 | "programming pipes. Bad things might happen. %08x\n", RREG32(0x150)); | 247 | "programming pipes. Bad things might happen. %08x\n", RREG32(RADEON_MC_STATUS)); |
| 245 | } | 248 | } |
| 246 | } | 249 | } |
| 247 | 250 | ||
| @@ -300,9 +303,9 @@ static int rs400_debugfs_gart_info(struct seq_file *m, void *data) | |||
| 300 | seq_printf(m, "MCCFG_AGP_BASE_2 0x%08x\n", tmp); | 303 | seq_printf(m, "MCCFG_AGP_BASE_2 0x%08x\n", tmp); |
| 301 | tmp = RREG32_MC(RS690_MCCFG_AGP_LOCATION); | 304 | tmp = RREG32_MC(RS690_MCCFG_AGP_LOCATION); |
| 302 | seq_printf(m, "MCCFG_AGP_LOCATION 0x%08x\n", tmp); | 305 | seq_printf(m, "MCCFG_AGP_LOCATION 0x%08x\n", tmp); |
| 303 | tmp = RREG32_MC(0x100); | 306 | tmp = RREG32_MC(RS690_MCCFG_FB_LOCATION); |
| 304 | seq_printf(m, "MCCFG_FB_LOCATION 0x%08x\n", tmp); | 307 | seq_printf(m, "MCCFG_FB_LOCATION 0x%08x\n", tmp); |
| 305 | tmp = RREG32(0x134); | 308 | tmp = RREG32(RS690_HDP_FB_LOCATION); |
| 306 | seq_printf(m, "HDP_FB_LOCATION 0x%08x\n", tmp); | 309 | seq_printf(m, "HDP_FB_LOCATION 0x%08x\n", tmp); |
| 307 | } else { | 310 | } else { |
| 308 | tmp = RREG32(RADEON_AGP_BASE); | 311 | tmp = RREG32(RADEON_AGP_BASE); |
diff --git a/drivers/gpu/drm/radeon/rv515.c b/drivers/gpu/drm/radeon/rv515.c index 5d569f41f4a..64b57af9371 100644 --- a/drivers/gpu/drm/radeon/rv515.c +++ b/drivers/gpu/drm/radeon/rv515.c | |||
| @@ -69,13 +69,13 @@ void rv515_ring_start(struct radeon_device *rdev) | |||
| 69 | ISYNC_CPSCRATCH_IDLEGUI); | 69 | ISYNC_CPSCRATCH_IDLEGUI); |
| 70 | radeon_ring_write(rdev, PACKET0(WAIT_UNTIL, 0)); | 70 | radeon_ring_write(rdev, PACKET0(WAIT_UNTIL, 0)); |
| 71 | radeon_ring_write(rdev, WAIT_2D_IDLECLEAN | WAIT_3D_IDLECLEAN); | 71 | radeon_ring_write(rdev, WAIT_2D_IDLECLEAN | WAIT_3D_IDLECLEAN); |
| 72 | radeon_ring_write(rdev, PACKET0(0x170C, 0)); | 72 | radeon_ring_write(rdev, PACKET0(R300_DST_PIPE_CONFIG, 0)); |
| 73 | radeon_ring_write(rdev, 1 << 31); | 73 | radeon_ring_write(rdev, R300_PIPE_AUTO_CONFIG); |
| 74 | radeon_ring_write(rdev, PACKET0(GB_SELECT, 0)); | 74 | radeon_ring_write(rdev, PACKET0(GB_SELECT, 0)); |
| 75 | radeon_ring_write(rdev, 0); | 75 | radeon_ring_write(rdev, 0); |
| 76 | radeon_ring_write(rdev, PACKET0(GB_ENABLE, 0)); | 76 | radeon_ring_write(rdev, PACKET0(GB_ENABLE, 0)); |
| 77 | radeon_ring_write(rdev, 0); | 77 | radeon_ring_write(rdev, 0); |
| 78 | radeon_ring_write(rdev, PACKET0(0x42C8, 0)); | 78 | radeon_ring_write(rdev, PACKET0(R500_SU_REG_DEST, 0)); |
| 79 | radeon_ring_write(rdev, (1 << rdev->num_gb_pipes) - 1); | 79 | radeon_ring_write(rdev, (1 << rdev->num_gb_pipes) - 1); |
| 80 | radeon_ring_write(rdev, PACKET0(VAP_INDEX_OFFSET, 0)); | 80 | radeon_ring_write(rdev, PACKET0(VAP_INDEX_OFFSET, 0)); |
| 81 | radeon_ring_write(rdev, 0); | 81 | radeon_ring_write(rdev, 0); |
| @@ -153,8 +153,8 @@ void rv515_gpu_init(struct radeon_device *rdev) | |||
| 153 | } | 153 | } |
| 154 | rv515_vga_render_disable(rdev); | 154 | rv515_vga_render_disable(rdev); |
| 155 | r420_pipes_init(rdev); | 155 | r420_pipes_init(rdev); |
| 156 | gb_pipe_select = RREG32(0x402C); | 156 | gb_pipe_select = RREG32(R400_GB_PIPE_SELECT); |
| 157 | tmp = RREG32(0x170C); | 157 | tmp = RREG32(R300_DST_PIPE_CONFIG); |
| 158 | pipe_select_current = (tmp >> 2) & 3; | 158 | pipe_select_current = (tmp >> 2) & 3; |
| 159 | tmp = (1 << pipe_select_current) | | 159 | tmp = (1 << pipe_select_current) | |
| 160 | (((gb_pipe_select >> 8) & 0xF) << 4); | 160 | (((gb_pipe_select >> 8) & 0xF) << 4); |
diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c index 939476659ad..ac471b77c18 100644 --- a/drivers/input/keyboard/tegra-kbc.c +++ b/drivers/input/keyboard/tegra-kbc.c | |||
| @@ -86,7 +86,7 @@ static const u32 tegra_kbc_default_keymap[] = { | |||
| 86 | KEY(0, 5, KEY_Z), | 86 | KEY(0, 5, KEY_Z), |
| 87 | KEY(0, 7, KEY_FN), | 87 | KEY(0, 7, KEY_FN), |
| 88 | 88 | ||
| 89 | KEY(1, 7, KEY_MENU), | 89 | KEY(1, 7, KEY_LEFTMETA), |
| 90 | 90 | ||
| 91 | KEY(2, 6, KEY_RIGHTALT), | 91 | KEY(2, 6, KEY_RIGHTALT), |
| 92 | KEY(2, 7, KEY_LEFTALT), | 92 | KEY(2, 7, KEY_LEFTALT), |
| @@ -355,8 +355,8 @@ static void tegra_kbc_config_pins(struct tegra_kbc *kbc) | |||
| 355 | for (i = 0; i < KBC_MAX_GPIO; i++) { | 355 | for (i = 0; i < KBC_MAX_GPIO; i++) { |
| 356 | u32 r_shft = 5 * (i % 6); | 356 | u32 r_shft = 5 * (i % 6); |
| 357 | u32 c_shft = 4 * (i % 8); | 357 | u32 c_shft = 4 * (i % 8); |
| 358 | u32 r_mask = 0x1f << r_shift; | 358 | u32 r_mask = 0x1f << r_shft; |
| 359 | u32 c_mask = 0x0f << c_shift; | 359 | u32 c_mask = 0x0f << c_shft; |
| 360 | u32 r_offs = (i / 6) * 4 + KBC_ROW_CFG0_0; | 360 | u32 r_offs = (i / 6) * 4 + KBC_ROW_CFG0_0; |
| 361 | u32 c_offs = (i / 8) * 4 + KBC_COL_CFG0_0; | 361 | u32 c_offs = (i / 8) * 4 + KBC_COL_CFG0_0; |
| 362 | u32 row_cfg = readl(kbc->mmio + r_offs); | 362 | u32 row_cfg = readl(kbc->mmio + r_offs); |
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index da392c22fc6..aa186cf6c51 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c | |||
| @@ -755,23 +755,26 @@ static int synaptics_reconnect(struct psmouse *psmouse) | |||
| 755 | { | 755 | { |
| 756 | struct synaptics_data *priv = psmouse->private; | 756 | struct synaptics_data *priv = psmouse->private; |
| 757 | struct synaptics_data old_priv = *priv; | 757 | struct synaptics_data old_priv = *priv; |
| 758 | int retry = 0; | ||
| 759 | int error; | ||
| 758 | 760 | ||
| 759 | psmouse_reset(psmouse); | 761 | do { |
| 762 | psmouse_reset(psmouse); | ||
| 763 | error = synaptics_detect(psmouse, 0); | ||
| 764 | } while (error && ++retry < 3); | ||
| 760 | 765 | ||
| 761 | if (synaptics_detect(psmouse, 0)) | 766 | if (error) |
| 762 | return -1; | 767 | return -1; |
| 763 | 768 | ||
| 769 | if (retry > 1) | ||
| 770 | printk(KERN_DEBUG "Synaptics reconnected after %d tries\n", | ||
| 771 | retry); | ||
| 772 | |||
| 764 | if (synaptics_query_hardware(psmouse)) { | 773 | if (synaptics_query_hardware(psmouse)) { |
| 765 | printk(KERN_ERR "Unable to query Synaptics hardware.\n"); | 774 | printk(KERN_ERR "Unable to query Synaptics hardware.\n"); |
| 766 | return -1; | 775 | return -1; |
| 767 | } | 776 | } |
| 768 | 777 | ||
| 769 | if (old_priv.identity != priv->identity || | ||
| 770 | old_priv.model_id != priv->model_id || | ||
| 771 | old_priv.capabilities != priv->capabilities || | ||
| 772 | old_priv.ext_cap != priv->ext_cap) | ||
| 773 | return -1; | ||
| 774 | |||
| 775 | if (synaptics_set_absolute_mode(psmouse)) { | 778 | if (synaptics_set_absolute_mode(psmouse)) { |
| 776 | printk(KERN_ERR "Unable to initialize Synaptics hardware.\n"); | 779 | printk(KERN_ERR "Unable to initialize Synaptics hardware.\n"); |
| 777 | return -1; | 780 | return -1; |
| @@ -782,6 +785,19 @@ static int synaptics_reconnect(struct psmouse *psmouse) | |||
| 782 | return -1; | 785 | return -1; |
| 783 | } | 786 | } |
| 784 | 787 | ||
| 788 | if (old_priv.identity != priv->identity || | ||
| 789 | old_priv.model_id != priv->model_id || | ||
| 790 | old_priv.capabilities != priv->capabilities || | ||
| 791 | old_priv.ext_cap != priv->ext_cap) { | ||
| 792 | printk(KERN_ERR "Synaptics hardware appears to be different: " | ||
| 793 | "id(%ld-%ld), model(%ld-%ld), caps(%lx-%lx), ext(%lx-%lx).\n", | ||
| 794 | old_priv.identity, priv->identity, | ||
| 795 | old_priv.model_id, priv->model_id, | ||
| 796 | old_priv.capabilities, priv->capabilities, | ||
| 797 | old_priv.ext_cap, priv->ext_cap); | ||
| 798 | return -1; | ||
| 799 | } | ||
| 800 | |||
| 785 | return 0; | 801 | return 0; |
| 786 | } | 802 | } |
| 787 | 803 | ||
diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c index 72be8a02118..512a2f4ada0 100644 --- a/drivers/media/rc/rc-main.c +++ b/drivers/media/rc/rc-main.c | |||
| @@ -458,21 +458,27 @@ static int ir_getkeycode(struct input_dev *idev, | |||
| 458 | index = ir_lookup_by_scancode(rc_map, scancode); | 458 | index = ir_lookup_by_scancode(rc_map, scancode); |
| 459 | } | 459 | } |
| 460 | 460 | ||
| 461 | if (index >= rc_map->len) { | 461 | if (index < rc_map->len) { |
| 462 | if (!(ke->flags & INPUT_KEYMAP_BY_INDEX)) | 462 | entry = &rc_map->scan[index]; |
| 463 | IR_dprintk(1, "unknown key for scancode 0x%04x\n", | 463 | |
| 464 | scancode); | 464 | ke->index = index; |
| 465 | ke->keycode = entry->keycode; | ||
| 466 | ke->len = sizeof(entry->scancode); | ||
| 467 | memcpy(ke->scancode, &entry->scancode, sizeof(entry->scancode)); | ||
| 468 | |||
| 469 | } else if (!(ke->flags & INPUT_KEYMAP_BY_INDEX)) { | ||
| 470 | /* | ||
| 471 | * We do not really know the valid range of scancodes | ||
| 472 | * so let's respond with KEY_RESERVED to anything we | ||
| 473 | * do not have mapping for [yet]. | ||
| 474 | */ | ||
| 475 | ke->index = index; | ||
| 476 | ke->keycode = KEY_RESERVED; | ||
| 477 | } else { | ||
| 465 | retval = -EINVAL; | 478 | retval = -EINVAL; |
| 466 | goto out; | 479 | goto out; |
| 467 | } | 480 | } |
| 468 | 481 | ||
| 469 | entry = &rc_map->scan[index]; | ||
| 470 | |||
| 471 | ke->index = index; | ||
| 472 | ke->keycode = entry->keycode; | ||
| 473 | ke->len = sizeof(entry->scancode); | ||
| 474 | memcpy(ke->scancode, &entry->scancode, sizeof(entry->scancode)); | ||
| 475 | |||
| 476 | retval = 0; | 482 | retval = 0; |
| 477 | 483 | ||
| 478 | out: | 484 | out: |
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c index f49e49dc592..5ebe280225d 100644 --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c | |||
| @@ -672,33 +672,7 @@ static int io_init(struct ubi_device *ubi) | |||
| 672 | ubi->nor_flash = 1; | 672 | ubi->nor_flash = 1; |
| 673 | } | 673 | } |
| 674 | 674 | ||
| 675 | /* | 675 | ubi->min_io_size = ubi->mtd->writesize; |
| 676 | * Set UBI min. I/O size (@ubi->min_io_size). We use @mtd->writebufsize | ||
| 677 | * for these purposes, not @mtd->writesize. At the moment this does not | ||
| 678 | * matter for NAND, because currently @mtd->writebufsize is equivalent to | ||
| 679 | * @mtd->writesize for all NANDs. However, some CFI NOR flashes may | ||
| 680 | * have @mtd->writebufsize which is multiple of @mtd->writesize. | ||
| 681 | * | ||
| 682 | * The reason we use @mtd->writebufsize for @ubi->min_io_size is that | ||
| 683 | * UBI and UBIFS recovery algorithms rely on the fact that if there was | ||
| 684 | * an unclean power cut, then we can find offset of the last corrupted | ||
| 685 | * node, align the offset to @ubi->min_io_size, read the rest of the | ||
| 686 | * eraseblock starting from this offset, and check whether there are | ||
| 687 | * only 0xFF bytes. If yes, then we are probably dealing with a | ||
| 688 | * corruption caused by a power cut, if not, then this is probably some | ||
| 689 | * severe corruption. | ||
| 690 | * | ||
| 691 | * Thus, we have to use the maximum write unit size of the flash, which | ||
| 692 | * is @mtd->writebufsize, because @mtd->writesize is the minimum write | ||
| 693 | * size, not the maximum. | ||
| 694 | */ | ||
| 695 | if (ubi->mtd->type == MTD_NANDFLASH) | ||
| 696 | ubi_assert(ubi->mtd->writebufsize == ubi->mtd->writesize); | ||
| 697 | else if (ubi->mtd->type == MTD_NORFLASH) | ||
| 698 | ubi_assert(ubi->mtd->writebufsize % ubi->mtd->writesize == 0); | ||
| 699 | |||
| 700 | ubi->min_io_size = ubi->mtd->writebufsize; | ||
| 701 | |||
| 702 | ubi->hdrs_min_io_size = ubi->mtd->writesize >> ubi->mtd->subpage_sft; | 676 | ubi->hdrs_min_io_size = ubi->mtd->writesize >> ubi->mtd->subpage_sft; |
| 703 | 677 | ||
| 704 | /* | 678 | /* |
diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c index f374c5961b3..a91d510a798 100644 --- a/drivers/platform/x86/intel_scu_ipc.c +++ b/drivers/platform/x86/intel_scu_ipc.c | |||
| @@ -26,7 +26,6 @@ | |||
| 26 | #include <linux/sfi.h> | 26 | #include <linux/sfi.h> |
| 27 | #include <asm/mrst.h> | 27 | #include <asm/mrst.h> |
| 28 | #include <asm/intel_scu_ipc.h> | 28 | #include <asm/intel_scu_ipc.h> |
| 29 | #include <asm/mrst.h> | ||
| 30 | 29 | ||
| 31 | /* IPC defines the following message types */ | 30 | /* IPC defines the following message types */ |
| 32 | #define IPCMSG_WATCHDOG_TIMER 0xF8 /* Set Kernel Watchdog Threshold */ | 31 | #define IPCMSG_WATCHDOG_TIMER 0xF8 /* Set Kernel Watchdog Threshold */ |
diff --git a/drivers/staging/ath6kl/miscdrv/ar3kps/ar3kpsconfig.c b/drivers/staging/ath6kl/miscdrv/ar3kps/ar3kpsconfig.c index 0e298dba9fc..29b8ab44ea4 100644 --- a/drivers/staging/ath6kl/miscdrv/ar3kps/ar3kpsconfig.c +++ b/drivers/staging/ath6kl/miscdrv/ar3kps/ar3kpsconfig.c | |||
| @@ -360,8 +360,8 @@ int PSSendOps(void *arg) | |||
| 360 | status = 1; | 360 | status = 1; |
| 361 | goto complete; | 361 | goto complete; |
| 362 | } | 362 | } |
| 363 | len = (firmware->size > MAX_BDADDR_FORMAT_LENGTH)? MAX_BDADDR_FORMAT_LENGTH: firmware->size; | 363 | len = min(firmware->size, MAX_BDADDR_FORMAT_LENGTH - 1); |
| 364 | memcpy(config_bdaddr, firmware->data,len); | 364 | memcpy(config_bdaddr, firmware->data, len); |
| 365 | config_bdaddr[len] = '\0'; | 365 | config_bdaddr[len] = '\0'; |
| 366 | write_bdaddr(hdev,config_bdaddr,BDADDR_TYPE_STRING); | 366 | write_bdaddr(hdev,config_bdaddr,BDADDR_TYPE_STRING); |
| 367 | A_RELEASE_FIRMWARE(firmware); | 367 | A_RELEASE_FIRMWARE(firmware); |
diff --git a/drivers/staging/brcm80211/sys/wl_mac80211.c b/drivers/staging/brcm80211/sys/wl_mac80211.c index bdd629d72a7..f1235884cc5 100644 --- a/drivers/staging/brcm80211/sys/wl_mac80211.c +++ b/drivers/staging/brcm80211/sys/wl_mac80211.c | |||
| @@ -209,11 +209,8 @@ static void wl_ops_stop(struct ieee80211_hw *hw) | |||
| 209 | struct wl_info *wl = hw->priv; | 209 | struct wl_info *wl = hw->priv; |
| 210 | ASSERT(wl); | 210 | ASSERT(wl); |
| 211 | WL_LOCK(wl); | 211 | WL_LOCK(wl); |
| 212 | wl_down(wl); | ||
| 213 | ieee80211_stop_queues(hw); | 212 | ieee80211_stop_queues(hw); |
| 214 | WL_UNLOCK(wl); | 213 | WL_UNLOCK(wl); |
| 215 | |||
| 216 | return; | ||
| 217 | } | 214 | } |
| 218 | 215 | ||
| 219 | static int | 216 | static int |
| @@ -246,7 +243,14 @@ wl_ops_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) | |||
| 246 | static void | 243 | static void |
| 247 | wl_ops_remove_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) | 244 | wl_ops_remove_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) |
| 248 | { | 245 | { |
| 249 | return; | 246 | struct wl_info *wl; |
| 247 | |||
| 248 | wl = HW_TO_WL(hw); | ||
| 249 | |||
| 250 | /* put driver in down state */ | ||
| 251 | WL_LOCK(wl); | ||
| 252 | wl_down(wl); | ||
| 253 | WL_UNLOCK(wl); | ||
| 250 | } | 254 | } |
| 251 | 255 | ||
| 252 | static int | 256 | static int |
| @@ -779,7 +783,7 @@ static struct wl_info *wl_attach(u16 vendor, u16 device, unsigned long regs, | |||
| 779 | wl_found++; | 783 | wl_found++; |
| 780 | return wl; | 784 | return wl; |
| 781 | 785 | ||
| 782 | fail: | 786 | fail: |
| 783 | wl_free(wl); | 787 | wl_free(wl); |
| 784 | fail1: | 788 | fail1: |
| 785 | return NULL; | 789 | return NULL; |
| @@ -1090,7 +1094,6 @@ wl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 1090 | return 0; | 1094 | return 0; |
| 1091 | } | 1095 | } |
| 1092 | 1096 | ||
| 1093 | #ifdef LINUXSTA_PS | ||
| 1094 | static int wl_suspend(struct pci_dev *pdev, pm_message_t state) | 1097 | static int wl_suspend(struct pci_dev *pdev, pm_message_t state) |
| 1095 | { | 1098 | { |
| 1096 | struct wl_info *wl; | 1099 | struct wl_info *wl; |
| @@ -1105,11 +1108,12 @@ static int wl_suspend(struct pci_dev *pdev, pm_message_t state) | |||
| 1105 | return -ENODEV; | 1108 | return -ENODEV; |
| 1106 | } | 1109 | } |
| 1107 | 1110 | ||
| 1111 | /* only need to flag hw is down for proper resume */ | ||
| 1108 | WL_LOCK(wl); | 1112 | WL_LOCK(wl); |
| 1109 | wl_down(wl); | ||
| 1110 | wl->pub->hw_up = false; | 1113 | wl->pub->hw_up = false; |
| 1111 | WL_UNLOCK(wl); | 1114 | WL_UNLOCK(wl); |
| 1112 | pci_save_state(pdev, wl->pci_psstate); | 1115 | |
| 1116 | pci_save_state(pdev); | ||
| 1113 | pci_disable_device(pdev); | 1117 | pci_disable_device(pdev); |
| 1114 | return pci_set_power_state(pdev, PCI_D3hot); | 1118 | return pci_set_power_state(pdev, PCI_D3hot); |
| 1115 | } | 1119 | } |
| @@ -1133,7 +1137,7 @@ static int wl_resume(struct pci_dev *pdev) | |||
| 1133 | if (err) | 1137 | if (err) |
| 1134 | return err; | 1138 | return err; |
| 1135 | 1139 | ||
| 1136 | pci_restore_state(pdev, wl->pci_psstate); | 1140 | pci_restore_state(pdev); |
| 1137 | 1141 | ||
| 1138 | err = pci_enable_device(pdev); | 1142 | err = pci_enable_device(pdev); |
| 1139 | if (err) | 1143 | if (err) |
| @@ -1145,13 +1149,12 @@ static int wl_resume(struct pci_dev *pdev) | |||
| 1145 | if ((val & 0x0000ff00) != 0) | 1149 | if ((val & 0x0000ff00) != 0) |
| 1146 | pci_write_config_dword(pdev, 0x40, val & 0xffff00ff); | 1150 | pci_write_config_dword(pdev, 0x40, val & 0xffff00ff); |
| 1147 | 1151 | ||
| 1148 | WL_LOCK(wl); | 1152 | /* |
| 1149 | err = wl_up(wl); | 1153 | * done. driver will be put in up state |
| 1150 | WL_UNLOCK(wl); | 1154 | * in wl_ops_add_interface() call. |
| 1151 | 1155 | */ | |
| 1152 | return err; | 1156 | return err; |
| 1153 | } | 1157 | } |
| 1154 | #endif /* LINUXSTA_PS */ | ||
| 1155 | 1158 | ||
| 1156 | static void wl_remove(struct pci_dev *pdev) | 1159 | static void wl_remove(struct pci_dev *pdev) |
| 1157 | { | 1160 | { |
| @@ -1184,14 +1187,12 @@ static void wl_remove(struct pci_dev *pdev) | |||
| 1184 | } | 1187 | } |
| 1185 | 1188 | ||
| 1186 | static struct pci_driver wl_pci_driver = { | 1189 | static struct pci_driver wl_pci_driver = { |
| 1187 | .name = "brcm80211", | 1190 | .name = "brcm80211", |
| 1188 | .probe = wl_pci_probe, | 1191 | .probe = wl_pci_probe, |
| 1189 | #ifdef LINUXSTA_PS | 1192 | .suspend = wl_suspend, |
| 1190 | .suspend = wl_suspend, | 1193 | .resume = wl_resume, |
| 1191 | .resume = wl_resume, | 1194 | .remove = __devexit_p(wl_remove), |
| 1192 | #endif /* LINUXSTA_PS */ | 1195 | .id_table = wl_id_table, |
| 1193 | .remove = __devexit_p(wl_remove), | ||
| 1194 | .id_table = wl_id_table, | ||
| 1195 | }; | 1196 | }; |
| 1196 | 1197 | ||
| 1197 | /** | 1198 | /** |
diff --git a/drivers/staging/brcm80211/sys/wlc_mac80211.c b/drivers/staging/brcm80211/sys/wlc_mac80211.c index 1d5d01ac0a9..a1303863686 100644 --- a/drivers/staging/brcm80211/sys/wlc_mac80211.c +++ b/drivers/staging/brcm80211/sys/wlc_mac80211.c | |||
| @@ -5126,7 +5126,6 @@ wlc_sendpkt_mac80211(struct wlc_info *wlc, struct sk_buff *sdu, | |||
| 5126 | fifo = prio2fifo[prio]; | 5126 | fifo = prio2fifo[prio]; |
| 5127 | 5127 | ||
| 5128 | ASSERT((uint) skb_headroom(sdu) >= TXOFF); | 5128 | ASSERT((uint) skb_headroom(sdu) >= TXOFF); |
| 5129 | ASSERT(!(sdu->cloned)); | ||
| 5130 | ASSERT(!(sdu->next)); | 5129 | ASSERT(!(sdu->next)); |
| 5131 | ASSERT(!(sdu->prev)); | 5130 | ASSERT(!(sdu->prev)); |
| 5132 | ASSERT(fifo < NFIFO); | 5131 | ASSERT(fifo < NFIFO); |
diff --git a/drivers/staging/comedi/drivers/ni_labpc.c b/drivers/staging/comedi/drivers/ni_labpc.c index 4d1868d04ba..0728c3c0cb0 100644 --- a/drivers/staging/comedi/drivers/ni_labpc.c +++ b/drivers/staging/comedi/drivers/ni_labpc.c | |||
| @@ -575,7 +575,8 @@ int labpc_common_attach(struct comedi_device *dev, unsigned long iobase, | |||
| 575 | /* grab our IRQ */ | 575 | /* grab our IRQ */ |
| 576 | if (irq) { | 576 | if (irq) { |
| 577 | isr_flags = 0; | 577 | isr_flags = 0; |
| 578 | if (thisboard->bustype == pci_bustype) | 578 | if (thisboard->bustype == pci_bustype |
| 579 | || thisboard->bustype == pcmcia_bustype) | ||
| 579 | isr_flags |= IRQF_SHARED; | 580 | isr_flags |= IRQF_SHARED; |
| 580 | if (request_irq(irq, labpc_interrupt, isr_flags, | 581 | if (request_irq(irq, labpc_interrupt, isr_flags, |
| 581 | driver_labpc.driver_name, dev)) { | 582 | driver_labpc.driver_name, dev)) { |
diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c index b3d05fcfe6d..4fb809485d9 100644 --- a/drivers/staging/hv/blkvsc_drv.c +++ b/drivers/staging/hv/blkvsc_drv.c | |||
| @@ -368,6 +368,7 @@ static int blkvsc_probe(struct device *device) | |||
| 368 | blkdev->gd->first_minor = 0; | 368 | blkdev->gd->first_minor = 0; |
| 369 | blkdev->gd->fops = &block_ops; | 369 | blkdev->gd->fops = &block_ops; |
| 370 | blkdev->gd->private_data = blkdev; | 370 | blkdev->gd->private_data = blkdev; |
| 371 | blkdev->gd->driverfs_dev = &(blkdev->device_ctx->device); | ||
| 371 | sprintf(blkdev->gd->disk_name, "hd%c", 'a' + devnum); | 372 | sprintf(blkdev->gd->disk_name, "hd%c", 'a' + devnum); |
| 372 | 373 | ||
| 373 | blkvsc_do_inquiry(blkdev); | 374 | blkvsc_do_inquiry(blkdev); |
diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c index df9cd131e95..0edbe7483a4 100644 --- a/drivers/staging/hv/netvsc.c +++ b/drivers/staging/hv/netvsc.c | |||
| @@ -1279,7 +1279,7 @@ static void netvsc_channel_cb(void *context) | |||
| 1279 | /* ASSERT(device); */ | 1279 | /* ASSERT(device); */ |
| 1280 | 1280 | ||
| 1281 | packet = kzalloc(NETVSC_PACKET_SIZE * sizeof(unsigned char), | 1281 | packet = kzalloc(NETVSC_PACKET_SIZE * sizeof(unsigned char), |
| 1282 | GFP_KERNEL); | 1282 | GFP_ATOMIC); |
| 1283 | if (!packet) | 1283 | if (!packet) |
| 1284 | return; | 1284 | return; |
| 1285 | buffer = packet; | 1285 | buffer = packet; |
diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c index 0147b407512..54706a16dc0 100644 --- a/drivers/staging/hv/netvsc_drv.c +++ b/drivers/staging/hv/netvsc_drv.c | |||
| @@ -358,7 +358,6 @@ static int netvsc_probe(struct device *device) | |||
| 358 | 358 | ||
| 359 | /* Set initial state */ | 359 | /* Set initial state */ |
| 360 | netif_carrier_off(net); | 360 | netif_carrier_off(net); |
| 361 | netif_stop_queue(net); | ||
| 362 | 361 | ||
| 363 | net_device_ctx = netdev_priv(net); | 362 | net_device_ctx = netdev_priv(net); |
| 364 | net_device_ctx->device_ctx = device_ctx; | 363 | net_device_ctx->device_ctx = device_ctx; |
diff --git a/drivers/staging/iio/adc/ad7476_core.c b/drivers/staging/iio/adc/ad7476_core.c index deb68c8a6e1..b8b54da67c6 100644 --- a/drivers/staging/iio/adc/ad7476_core.c +++ b/drivers/staging/iio/adc/ad7476_core.c | |||
| @@ -68,7 +68,7 @@ static ssize_t ad7476_show_scale(struct device *dev, | |||
| 68 | /* Corresponds to Vref / 2^(bits) */ | 68 | /* Corresponds to Vref / 2^(bits) */ |
| 69 | unsigned int scale_uv = (st->int_vref_mv * 1000) >> st->chip_info->bits; | 69 | unsigned int scale_uv = (st->int_vref_mv * 1000) >> st->chip_info->bits; |
| 70 | 70 | ||
| 71 | return sprintf(buf, "%d.%d\n", scale_uv / 1000, scale_uv % 1000); | 71 | return sprintf(buf, "%d.%03d\n", scale_uv / 1000, scale_uv % 1000); |
| 72 | } | 72 | } |
| 73 | static IIO_DEVICE_ATTR(in_scale, S_IRUGO, ad7476_show_scale, NULL, 0); | 73 | static IIO_DEVICE_ATTR(in_scale, S_IRUGO, ad7476_show_scale, NULL, 0); |
| 74 | 74 | ||
diff --git a/drivers/staging/iio/adc/ad7887_core.c b/drivers/staging/iio/adc/ad7887_core.c index 685908995d4..5d85efab658 100644 --- a/drivers/staging/iio/adc/ad7887_core.c +++ b/drivers/staging/iio/adc/ad7887_core.c | |||
| @@ -68,7 +68,7 @@ static ssize_t ad7887_show_scale(struct device *dev, | |||
| 68 | /* Corresponds to Vref / 2^(bits) */ | 68 | /* Corresponds to Vref / 2^(bits) */ |
| 69 | unsigned int scale_uv = (st->int_vref_mv * 1000) >> st->chip_info->bits; | 69 | unsigned int scale_uv = (st->int_vref_mv * 1000) >> st->chip_info->bits; |
| 70 | 70 | ||
| 71 | return sprintf(buf, "%d.%d\n", scale_uv / 1000, scale_uv % 1000); | 71 | return sprintf(buf, "%d.%03d\n", scale_uv / 1000, scale_uv % 1000); |
| 72 | } | 72 | } |
| 73 | static IIO_DEVICE_ATTR(in_scale, S_IRUGO, ad7887_show_scale, NULL, 0); | 73 | static IIO_DEVICE_ATTR(in_scale, S_IRUGO, ad7887_show_scale, NULL, 0); |
| 74 | 74 | ||
diff --git a/drivers/staging/iio/adc/ad799x_core.c b/drivers/staging/iio/adc/ad799x_core.c index 6309d521a86..89ccf375a18 100644 --- a/drivers/staging/iio/adc/ad799x_core.c +++ b/drivers/staging/iio/adc/ad799x_core.c | |||
| @@ -432,7 +432,7 @@ static ssize_t ad799x_show_scale(struct device *dev, | |||
| 432 | /* Corresponds to Vref / 2^(bits) */ | 432 | /* Corresponds to Vref / 2^(bits) */ |
| 433 | unsigned int scale_uv = (st->int_vref_mv * 1000) >> st->chip_info->bits; | 433 | unsigned int scale_uv = (st->int_vref_mv * 1000) >> st->chip_info->bits; |
| 434 | 434 | ||
| 435 | return sprintf(buf, "%d.%d\n", scale_uv / 1000, scale_uv % 1000); | 435 | return sprintf(buf, "%d.%03d\n", scale_uv / 1000, scale_uv % 1000); |
| 436 | } | 436 | } |
| 437 | 437 | ||
| 438 | static IIO_DEVICE_ATTR(in_scale, S_IRUGO, ad799x_show_scale, NULL, 0); | 438 | static IIO_DEVICE_ATTR(in_scale, S_IRUGO, ad799x_show_scale, NULL, 0); |
diff --git a/drivers/staging/iio/dac/ad5446.c b/drivers/staging/iio/dac/ad5446.c index e3387cd3114..0f87ecac82f 100644 --- a/drivers/staging/iio/dac/ad5446.c +++ b/drivers/staging/iio/dac/ad5446.c | |||
| @@ -87,7 +87,7 @@ static ssize_t ad5446_show_scale(struct device *dev, | |||
| 87 | /* Corresponds to Vref / 2^(bits) */ | 87 | /* Corresponds to Vref / 2^(bits) */ |
| 88 | unsigned int scale_uv = (st->vref_mv * 1000) >> st->chip_info->bits; | 88 | unsigned int scale_uv = (st->vref_mv * 1000) >> st->chip_info->bits; |
| 89 | 89 | ||
| 90 | return sprintf(buf, "%d.%d\n", scale_uv / 1000, scale_uv % 1000); | 90 | return sprintf(buf, "%d.%03d\n", scale_uv / 1000, scale_uv % 1000); |
| 91 | } | 91 | } |
| 92 | static IIO_DEVICE_ATTR(out_scale, S_IRUGO, ad5446_show_scale, NULL, 0); | 92 | static IIO_DEVICE_ATTR(out_scale, S_IRUGO, ad5446_show_scale, NULL, 0); |
| 93 | 93 | ||
diff --git a/drivers/staging/rt2860/rt_main_dev.c b/drivers/staging/rt2860/rt_main_dev.c index 701561d6b6f..236dd36d349 100644 --- a/drivers/staging/rt2860/rt_main_dev.c +++ b/drivers/staging/rt2860/rt_main_dev.c | |||
| @@ -484,8 +484,6 @@ struct net_device *RtmpPhyNetDevInit(struct rt_rtmp_adapter *pAd, | |||
| 484 | net_dev->ml_priv = (void *)pAd; | 484 | net_dev->ml_priv = (void *)pAd; |
| 485 | pAd->net_dev = net_dev; | 485 | pAd->net_dev = net_dev; |
| 486 | 486 | ||
| 487 | netif_stop_queue(net_dev); | ||
| 488 | |||
| 489 | return net_dev; | 487 | return net_dev; |
| 490 | 488 | ||
| 491 | } | 489 | } |
diff --git a/drivers/staging/rt2860/usb_main_dev.c b/drivers/staging/rt2860/usb_main_dev.c index ee68d51caa4..322bf49ee90 100644 --- a/drivers/staging/rt2860/usb_main_dev.c +++ b/drivers/staging/rt2860/usb_main_dev.c | |||
| @@ -106,6 +106,7 @@ struct usb_device_id rtusb_usb_id[] = { | |||
| 106 | {USB_DEVICE(0x0411, 0x016f)}, /* MelCo.,Inc. WLI-UC-G301N */ | 106 | {USB_DEVICE(0x0411, 0x016f)}, /* MelCo.,Inc. WLI-UC-G301N */ |
| 107 | {USB_DEVICE(0x1737, 0x0070)}, /* Linksys WUSB100 */ | 107 | {USB_DEVICE(0x1737, 0x0070)}, /* Linksys WUSB100 */ |
| 108 | {USB_DEVICE(0x1737, 0x0071)}, /* Linksys WUSB600N */ | 108 | {USB_DEVICE(0x1737, 0x0071)}, /* Linksys WUSB600N */ |
| 109 | {USB_DEVICE(0x1737, 0x0078)}, /* Linksys WUSB100v2 */ | ||
| 109 | {USB_DEVICE(0x0411, 0x00e8)}, /* Buffalo WLI-UC-G300N */ | 110 | {USB_DEVICE(0x0411, 0x00e8)}, /* Buffalo WLI-UC-G300N */ |
| 110 | {USB_DEVICE(0x050d, 0x815c)}, /* Belkin F5D8053 */ | 111 | {USB_DEVICE(0x050d, 0x815c)}, /* Belkin F5D8053 */ |
| 111 | {USB_DEVICE(0x100D, 0x9031)}, /* Motorola 2770 */ | 112 | {USB_DEVICE(0x100D, 0x9031)}, /* Motorola 2770 */ |
diff --git a/drivers/staging/rtl8712/hal_init.c b/drivers/staging/rtl8712/hal_init.c index 32088a641eb..84be383abec 100644 --- a/drivers/staging/rtl8712/hal_init.c +++ b/drivers/staging/rtl8712/hal_init.c | |||
| @@ -128,12 +128,13 @@ static u8 rtl8712_dl_fw(struct _adapter *padapter) | |||
| 128 | u8 *ptmpchar = NULL, *ppayload, *ptr; | 128 | u8 *ptmpchar = NULL, *ppayload, *ptr; |
| 129 | struct tx_desc *ptx_desc; | 129 | struct tx_desc *ptx_desc; |
| 130 | u32 txdscp_sz = sizeof(struct tx_desc); | 130 | u32 txdscp_sz = sizeof(struct tx_desc); |
| 131 | u8 ret = _FAIL; | ||
| 131 | 132 | ||
| 132 | ulfilelength = rtl871x_open_fw(padapter, &phfwfile_hdl, &pmappedfw); | 133 | ulfilelength = rtl871x_open_fw(padapter, &phfwfile_hdl, &pmappedfw); |
| 133 | if (pmappedfw && (ulfilelength > 0)) { | 134 | if (pmappedfw && (ulfilelength > 0)) { |
| 134 | update_fwhdr(&fwhdr, pmappedfw); | 135 | update_fwhdr(&fwhdr, pmappedfw); |
| 135 | if (chk_fwhdr(&fwhdr, ulfilelength) == _FAIL) | 136 | if (chk_fwhdr(&fwhdr, ulfilelength) == _FAIL) |
| 136 | goto exit_fail; | 137 | goto firmware_rel; |
| 137 | fill_fwpriv(padapter, &fwhdr.fwpriv); | 138 | fill_fwpriv(padapter, &fwhdr.fwpriv); |
| 138 | /* firmware check ok */ | 139 | /* firmware check ok */ |
| 139 | maxlen = (fwhdr.img_IMEM_size > fwhdr.img_SRAM_size) ? | 140 | maxlen = (fwhdr.img_IMEM_size > fwhdr.img_SRAM_size) ? |
| @@ -141,7 +142,7 @@ static u8 rtl8712_dl_fw(struct _adapter *padapter) | |||
| 141 | maxlen += txdscp_sz; | 142 | maxlen += txdscp_sz; |
| 142 | ptmpchar = _malloc(maxlen + FWBUFF_ALIGN_SZ); | 143 | ptmpchar = _malloc(maxlen + FWBUFF_ALIGN_SZ); |
| 143 | if (ptmpchar == NULL) | 144 | if (ptmpchar == NULL) |
| 144 | return _FAIL; | 145 | goto firmware_rel; |
| 145 | 146 | ||
| 146 | ptx_desc = (struct tx_desc *)(ptmpchar + FWBUFF_ALIGN_SZ - | 147 | ptx_desc = (struct tx_desc *)(ptmpchar + FWBUFF_ALIGN_SZ - |
| 147 | ((addr_t)(ptmpchar) & (FWBUFF_ALIGN_SZ - 1))); | 148 | ((addr_t)(ptmpchar) & (FWBUFF_ALIGN_SZ - 1))); |
| @@ -273,11 +274,13 @@ static u8 rtl8712_dl_fw(struct _adapter *padapter) | |||
| 273 | goto exit_fail; | 274 | goto exit_fail; |
| 274 | } else | 275 | } else |
| 275 | goto exit_fail; | 276 | goto exit_fail; |
| 276 | return _SUCCESS; | 277 | ret = _SUCCESS; |
| 277 | 278 | ||
| 278 | exit_fail: | 279 | exit_fail: |
| 279 | kfree(ptmpchar); | 280 | kfree(ptmpchar); |
| 280 | return _FAIL; | 281 | firmware_rel: |
| 282 | release_firmware((struct firmware *)phfwfile_hdl); | ||
| 283 | return ret; | ||
| 281 | } | 284 | } |
| 282 | 285 | ||
| 283 | uint rtl8712_hal_init(struct _adapter *padapter) | 286 | uint rtl8712_hal_init(struct _adapter *padapter) |
diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c index a692ee88b9e..21ce2af447b 100644 --- a/drivers/staging/rtl8712/usb_intf.c +++ b/drivers/staging/rtl8712/usb_intf.c | |||
| @@ -47,54 +47,123 @@ static int r871xu_drv_init(struct usb_interface *pusb_intf, | |||
| 47 | static void r871xu_dev_remove(struct usb_interface *pusb_intf); | 47 | static void r871xu_dev_remove(struct usb_interface *pusb_intf); |
| 48 | 48 | ||
| 49 | static struct usb_device_id rtl871x_usb_id_tbl[] = { | 49 | static struct usb_device_id rtl871x_usb_id_tbl[] = { |
| 50 | /*92SU | 50 | |
| 51 | * Realtek */ | 51 | /* RTL8188SU */ |
| 52 | {USB_DEVICE(0x0bda, 0x8171)}, | 52 | /* Realtek */ |
| 53 | {USB_DEVICE(0x0bda, 0x8172)}, | 53 | {USB_DEVICE(0x0BDA, 0x8171)}, |
| 54 | {USB_DEVICE(0x0bda, 0x8173)}, | 54 | {USB_DEVICE(0x0bda, 0x8173)}, |
| 55 | {USB_DEVICE(0x0bda, 0x8174)}, | ||
| 56 | {USB_DEVICE(0x0bda, 0x8712)}, | 55 | {USB_DEVICE(0x0bda, 0x8712)}, |
| 57 | {USB_DEVICE(0x0bda, 0x8713)}, | 56 | {USB_DEVICE(0x0bda, 0x8713)}, |
| 58 | {USB_DEVICE(0x0bda, 0xC512)}, | 57 | {USB_DEVICE(0x0bda, 0xC512)}, |
| 59 | /* Abocom */ | 58 | /* Abocom */ |
| 60 | {USB_DEVICE(0x07B8, 0x8188)}, | 59 | {USB_DEVICE(0x07B8, 0x8188)}, |
| 60 | /* ASUS */ | ||
| 61 | {USB_DEVICE(0x0B05, 0x1786)}, | ||
| 62 | {USB_DEVICE(0x0B05, 0x1791)}, /* 11n mode disable */ | ||
| 63 | /* Belkin */ | ||
| 64 | {USB_DEVICE(0x050D, 0x945A)}, | ||
| 61 | /* Corega */ | 65 | /* Corega */ |
| 62 | {USB_DEVICE(0x07aa, 0x0047)}, | 66 | {USB_DEVICE(0x07AA, 0x0047)}, |
| 63 | /* Dlink */ | 67 | /* D-Link */ |
| 64 | {USB_DEVICE(0x07d1, 0x3303)}, | 68 | {USB_DEVICE(0x2001, 0x3306)}, |
| 65 | {USB_DEVICE(0x07d1, 0x3302)}, | 69 | {USB_DEVICE(0x07D1, 0x3306)}, /* 11n mode disable */ |
| 66 | {USB_DEVICE(0x07d1, 0x3300)}, | 70 | /* Edimax */ |
| 67 | /* Dlink for Skyworth */ | 71 | {USB_DEVICE(0x7392, 0x7611)}, |
| 68 | {USB_DEVICE(0x14b2, 0x3300)}, | ||
| 69 | {USB_DEVICE(0x14b2, 0x3301)}, | ||
| 70 | {USB_DEVICE(0x14b2, 0x3302)}, | ||
| 71 | /* EnGenius */ | 72 | /* EnGenius */ |
| 72 | {USB_DEVICE(0x1740, 0x9603)}, | 73 | {USB_DEVICE(0x1740, 0x9603)}, |
| 73 | {USB_DEVICE(0x1740, 0x9605)}, | 74 | /* Hawking */ |
| 75 | {USB_DEVICE(0x0E66, 0x0016)}, | ||
| 76 | /* Hercules */ | ||
| 77 | {USB_DEVICE(0x06F8, 0xE034)}, | ||
| 78 | {USB_DEVICE(0x06F8, 0xE032)}, | ||
| 79 | /* Logitec */ | ||
| 80 | {USB_DEVICE(0x0789, 0x0167)}, | ||
| 81 | /* PCI */ | ||
| 82 | {USB_DEVICE(0x2019, 0xAB28)}, | ||
| 83 | {USB_DEVICE(0x2019, 0xED16)}, | ||
| 84 | /* Sitecom */ | ||
| 85 | {USB_DEVICE(0x0DF6, 0x0057)}, | ||
| 86 | {USB_DEVICE(0x0DF6, 0x0045)}, | ||
| 87 | {USB_DEVICE(0x0DF6, 0x0059)}, /* 11n mode disable */ | ||
| 88 | {USB_DEVICE(0x0DF6, 0x004B)}, | ||
| 89 | {USB_DEVICE(0x0DF6, 0x0063)}, | ||
| 90 | /* Sweex */ | ||
| 91 | {USB_DEVICE(0x177F, 0x0154)}, | ||
| 92 | /* Thinkware */ | ||
| 93 | {USB_DEVICE(0x0BDA, 0x5077)}, | ||
| 94 | /* Toshiba */ | ||
| 95 | {USB_DEVICE(0x1690, 0x0752)}, | ||
| 96 | /* - */ | ||
| 97 | {USB_DEVICE(0x20F4, 0x646B)}, | ||
| 98 | {USB_DEVICE(0x083A, 0xC512)}, | ||
| 99 | |||
| 100 | /* RTL8191SU */ | ||
| 101 | /* Realtek */ | ||
| 102 | {USB_DEVICE(0x0BDA, 0x8172)}, | ||
| 103 | /* Amigo */ | ||
| 104 | {USB_DEVICE(0x0EB0, 0x9061)}, | ||
| 105 | /* ASUS/EKB */ | ||
| 106 | {USB_DEVICE(0x0BDA, 0x8172)}, | ||
| 107 | {USB_DEVICE(0x13D3, 0x3323)}, | ||
| 108 | {USB_DEVICE(0x13D3, 0x3311)}, /* 11n mode disable */ | ||
| 109 | {USB_DEVICE(0x13D3, 0x3342)}, | ||
| 110 | /* ASUS/EKBLenovo */ | ||
| 111 | {USB_DEVICE(0x13D3, 0x3333)}, | ||
| 112 | {USB_DEVICE(0x13D3, 0x3334)}, | ||
| 113 | {USB_DEVICE(0x13D3, 0x3335)}, /* 11n mode disable */ | ||
| 114 | {USB_DEVICE(0x13D3, 0x3336)}, /* 11n mode disable */ | ||
| 115 | /* ASUS/Media BOX */ | ||
| 116 | {USB_DEVICE(0x13D3, 0x3309)}, | ||
| 74 | /* Belkin */ | 117 | /* Belkin */ |
| 75 | {USB_DEVICE(0x050d, 0x815F)}, | 118 | {USB_DEVICE(0x050D, 0x815F)}, |
| 76 | {USB_DEVICE(0x050d, 0x945A)}, | 119 | /* D-Link */ |
| 77 | {USB_DEVICE(0x050d, 0x845A)}, | 120 | {USB_DEVICE(0x07D1, 0x3302)}, |
| 78 | /* Guillemot */ | 121 | {USB_DEVICE(0x07D1, 0x3300)}, |
| 79 | {USB_DEVICE(0x06f8, 0xe031)}, | 122 | {USB_DEVICE(0x07D1, 0x3303)}, |
| 80 | /* Edimax */ | 123 | /* Edimax */ |
| 81 | {USB_DEVICE(0x7392, 0x7611)}, | ||
| 82 | {USB_DEVICE(0x7392, 0x7612)}, | 124 | {USB_DEVICE(0x7392, 0x7612)}, |
| 83 | {USB_DEVICE(0x7392, 0x7622)}, | 125 | /* EnGenius */ |
| 84 | /* Sitecom */ | 126 | {USB_DEVICE(0x1740, 0x9605)}, |
| 85 | {USB_DEVICE(0x0DF6, 0x0045)}, | 127 | /* Guillemot */ |
| 128 | {USB_DEVICE(0x06F8, 0xE031)}, | ||
| 86 | /* Hawking */ | 129 | /* Hawking */ |
| 87 | {USB_DEVICE(0x0E66, 0x0015)}, | 130 | {USB_DEVICE(0x0E66, 0x0015)}, |
| 88 | {USB_DEVICE(0x0E66, 0x0016)}, | 131 | /* Mediao */ |
| 89 | {USB_DEVICE(0x0b05, 0x1786)}, | ||
| 90 | {USB_DEVICE(0x0b05, 0x1791)}, /* 11n mode disable */ | ||
| 91 | |||
| 92 | {USB_DEVICE(0x13D3, 0x3306)}, | 132 | {USB_DEVICE(0x13D3, 0x3306)}, |
| 93 | {USB_DEVICE(0x13D3, 0x3309)}, | 133 | /* PCI */ |
| 134 | {USB_DEVICE(0x2019, 0xED18)}, | ||
| 135 | {USB_DEVICE(0x2019, 0x4901)}, | ||
| 136 | /* Sitecom */ | ||
| 137 | {USB_DEVICE(0x0DF6, 0x0058)}, | ||
| 138 | {USB_DEVICE(0x0DF6, 0x0049)}, | ||
| 139 | {USB_DEVICE(0x0DF6, 0x004C)}, | ||
| 140 | {USB_DEVICE(0x0DF6, 0x0064)}, | ||
| 141 | /* Skyworth */ | ||
| 142 | {USB_DEVICE(0x14b2, 0x3300)}, | ||
| 143 | {USB_DEVICE(0x14b2, 0x3301)}, | ||
| 144 | {USB_DEVICE(0x14B2, 0x3302)}, | ||
| 145 | /* - */ | ||
| 146 | {USB_DEVICE(0x04F2, 0xAFF2)}, | ||
| 147 | {USB_DEVICE(0x04F2, 0xAFF5)}, | ||
| 148 | {USB_DEVICE(0x04F2, 0xAFF6)}, | ||
| 149 | {USB_DEVICE(0x13D3, 0x3339)}, | ||
| 150 | {USB_DEVICE(0x13D3, 0x3340)}, /* 11n mode disable */ | ||
| 151 | {USB_DEVICE(0x13D3, 0x3341)}, /* 11n mode disable */ | ||
| 94 | {USB_DEVICE(0x13D3, 0x3310)}, | 152 | {USB_DEVICE(0x13D3, 0x3310)}, |
| 95 | {USB_DEVICE(0x13D3, 0x3311)}, /* 11n mode disable */ | ||
| 96 | {USB_DEVICE(0x13D3, 0x3325)}, | 153 | {USB_DEVICE(0x13D3, 0x3325)}, |
| 97 | {USB_DEVICE(0x083A, 0xC512)}, | 154 | |
| 155 | /* RTL8192SU */ | ||
| 156 | /* Realtek */ | ||
| 157 | {USB_DEVICE(0x0BDA, 0x8174)}, | ||
| 158 | {USB_DEVICE(0x0BDA, 0x8174)}, | ||
| 159 | /* Belkin */ | ||
| 160 | {USB_DEVICE(0x050D, 0x845A)}, | ||
| 161 | /* Corega */ | ||
| 162 | {USB_DEVICE(0x07AA, 0x0051)}, | ||
| 163 | /* Edimax */ | ||
| 164 | {USB_DEVICE(0x7392, 0x7622)}, | ||
| 165 | /* NEC */ | ||
| 166 | {USB_DEVICE(0x0409, 0x02B6)}, | ||
| 98 | {} | 167 | {} |
| 99 | }; | 168 | }; |
| 100 | 169 | ||
| @@ -103,8 +172,20 @@ MODULE_DEVICE_TABLE(usb, rtl871x_usb_id_tbl); | |||
| 103 | static struct specific_device_id specific_device_id_tbl[] = { | 172 | static struct specific_device_id specific_device_id_tbl[] = { |
| 104 | {.idVendor = 0x0b05, .idProduct = 0x1791, | 173 | {.idVendor = 0x0b05, .idProduct = 0x1791, |
| 105 | .flags = SPEC_DEV_ID_DISABLE_HT}, | 174 | .flags = SPEC_DEV_ID_DISABLE_HT}, |
| 175 | {.idVendor = 0x0df6, .idProduct = 0x0059, | ||
| 176 | .flags = SPEC_DEV_ID_DISABLE_HT}, | ||
| 177 | {.idVendor = 0x13d3, .idProduct = 0x3306, | ||
| 178 | .flags = SPEC_DEV_ID_DISABLE_HT}, | ||
| 106 | {.idVendor = 0x13D3, .idProduct = 0x3311, | 179 | {.idVendor = 0x13D3, .idProduct = 0x3311, |
| 107 | .flags = SPEC_DEV_ID_DISABLE_HT}, | 180 | .flags = SPEC_DEV_ID_DISABLE_HT}, |
| 181 | {.idVendor = 0x13d3, .idProduct = 0x3335, | ||
| 182 | .flags = SPEC_DEV_ID_DISABLE_HT}, | ||
| 183 | {.idVendor = 0x13d3, .idProduct = 0x3336, | ||
| 184 | .flags = SPEC_DEV_ID_DISABLE_HT}, | ||
| 185 | {.idVendor = 0x13d3, .idProduct = 0x3340, | ||
| 186 | .flags = SPEC_DEV_ID_DISABLE_HT}, | ||
| 187 | {.idVendor = 0x13d3, .idProduct = 0x3341, | ||
| 188 | .flags = SPEC_DEV_ID_DISABLE_HT}, | ||
| 108 | {} | 189 | {} |
| 109 | }; | 190 | }; |
| 110 | 191 | ||
diff --git a/drivers/staging/speakup/kobjects.c b/drivers/staging/speakup/kobjects.c index 408bb9b3303..07a7f543259 100644 --- a/drivers/staging/speakup/kobjects.c +++ b/drivers/staging/speakup/kobjects.c | |||
| @@ -332,7 +332,7 @@ static ssize_t silent_store(struct kobject *kobj, struct kobj_attribute *attr, | |||
| 332 | unsigned long flags; | 332 | unsigned long flags; |
| 333 | 333 | ||
| 334 | len = strlen(buf); | 334 | len = strlen(buf); |
| 335 | if (len > 0 || len < 3) { | 335 | if (len > 0 && len < 3) { |
| 336 | ch = buf[0]; | 336 | ch = buf[0]; |
| 337 | if (ch == '\n') | 337 | if (ch == '\n') |
| 338 | ch = '0'; | 338 | ch = '0'; |
diff --git a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c index e8f047e86a3..80183a7e662 100644 --- a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c +++ b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c | |||
| @@ -986,12 +986,6 @@ static int __devinit synaptics_rmi4_probe | |||
| 986 | input_set_abs_params(rmi4_data->input_dev, ABS_MT_TOUCH_MAJOR, 0, | 986 | input_set_abs_params(rmi4_data->input_dev, ABS_MT_TOUCH_MAJOR, 0, |
| 987 | MAX_TOUCH_MAJOR, 0, 0); | 987 | MAX_TOUCH_MAJOR, 0, 0); |
| 988 | 988 | ||
| 989 | retval = input_register_device(rmi4_data->input_dev); | ||
| 990 | if (retval) { | ||
| 991 | dev_err(&client->dev, "%s:input register failed\n", __func__); | ||
| 992 | goto err_input_register; | ||
| 993 | } | ||
| 994 | |||
| 995 | /* Clear interrupts */ | 989 | /* Clear interrupts */ |
| 996 | synaptics_rmi4_i2c_block_read(rmi4_data, | 990 | synaptics_rmi4_i2c_block_read(rmi4_data, |
| 997 | rmi4_data->fn01_data_base_addr + 1, intr_status, | 991 | rmi4_data->fn01_data_base_addr + 1, intr_status, |
| @@ -1003,15 +997,20 @@ static int __devinit synaptics_rmi4_probe | |||
| 1003 | if (retval) { | 997 | if (retval) { |
| 1004 | dev_err(&client->dev, "%s:Unable to get attn irq %d\n", | 998 | dev_err(&client->dev, "%s:Unable to get attn irq %d\n", |
| 1005 | __func__, platformdata->irq_number); | 999 | __func__, platformdata->irq_number); |
| 1006 | goto err_request_irq; | 1000 | goto err_unset_clientdata; |
| 1001 | } | ||
| 1002 | |||
| 1003 | retval = input_register_device(rmi4_data->input_dev); | ||
| 1004 | if (retval) { | ||
| 1005 | dev_err(&client->dev, "%s:input register failed\n", __func__); | ||
| 1006 | goto err_free_irq; | ||
| 1007 | } | 1007 | } |
| 1008 | 1008 | ||
| 1009 | return retval; | 1009 | return retval; |
| 1010 | 1010 | ||
| 1011 | err_request_irq: | 1011 | err_free_irq: |
| 1012 | free_irq(platformdata->irq_number, rmi4_data); | 1012 | free_irq(platformdata->irq_number, rmi4_data); |
| 1013 | input_unregister_device(rmi4_data->input_dev); | 1013 | err_unset_clientdata: |
| 1014 | err_input_register: | ||
| 1015 | i2c_set_clientdata(client, NULL); | 1014 | i2c_set_clientdata(client, NULL); |
| 1016 | err_query_dev: | 1015 | err_query_dev: |
| 1017 | if (platformdata->regulator_en) { | 1016 | if (platformdata->regulator_en) { |
diff --git a/drivers/staging/tidspbridge/core/io_sm.c b/drivers/staging/tidspbridge/core/io_sm.c index 571864555dd..27e0aa81a58 100644 --- a/drivers/staging/tidspbridge/core/io_sm.c +++ b/drivers/staging/tidspbridge/core/io_sm.c | |||
| @@ -949,7 +949,7 @@ func_end: | |||
| 949 | * Calls the Bridge's CHNL_ISR to determine if this interrupt is ours, then | 949 | * Calls the Bridge's CHNL_ISR to determine if this interrupt is ours, then |
| 950 | * schedules a DPC to dispatch I/O. | 950 | * schedules a DPC to dispatch I/O. |
| 951 | */ | 951 | */ |
| 952 | void io_mbox_msg(u32 msg) | 952 | int io_mbox_msg(struct notifier_block *self, unsigned long len, void *msg) |
| 953 | { | 953 | { |
| 954 | struct io_mgr *pio_mgr; | 954 | struct io_mgr *pio_mgr; |
| 955 | struct dev_object *dev_obj; | 955 | struct dev_object *dev_obj; |
| @@ -959,9 +959,9 @@ void io_mbox_msg(u32 msg) | |||
| 959 | dev_get_io_mgr(dev_obj, &pio_mgr); | 959 | dev_get_io_mgr(dev_obj, &pio_mgr); |
| 960 | 960 | ||
| 961 | if (!pio_mgr) | 961 | if (!pio_mgr) |
| 962 | return; | 962 | return NOTIFY_BAD; |
| 963 | 963 | ||
| 964 | pio_mgr->intr_val = (u16)msg; | 964 | pio_mgr->intr_val = (u16)((u32)msg); |
| 965 | if (pio_mgr->intr_val & MBX_PM_CLASS) | 965 | if (pio_mgr->intr_val & MBX_PM_CLASS) |
| 966 | io_dispatch_pm(pio_mgr); | 966 | io_dispatch_pm(pio_mgr); |
| 967 | 967 | ||
| @@ -973,7 +973,7 @@ void io_mbox_msg(u32 msg) | |||
| 973 | spin_unlock_irqrestore(&pio_mgr->dpc_lock, flags); | 973 | spin_unlock_irqrestore(&pio_mgr->dpc_lock, flags); |
| 974 | tasklet_schedule(&pio_mgr->dpc_tasklet); | 974 | tasklet_schedule(&pio_mgr->dpc_tasklet); |
| 975 | } | 975 | } |
| 976 | return; | 976 | return NOTIFY_OK; |
| 977 | } | 977 | } |
| 978 | 978 | ||
| 979 | /* | 979 | /* |
diff --git a/drivers/staging/tidspbridge/core/tiomap3430.c b/drivers/staging/tidspbridge/core/tiomap3430.c index a3b0a183d57..a3f69f6f505 100644 --- a/drivers/staging/tidspbridge/core/tiomap3430.c +++ b/drivers/staging/tidspbridge/core/tiomap3430.c | |||
| @@ -223,6 +223,10 @@ static struct bridge_drv_interface drv_interface_fxns = { | |||
| 223 | bridge_msg_set_queue_id, | 223 | bridge_msg_set_queue_id, |
| 224 | }; | 224 | }; |
| 225 | 225 | ||
| 226 | static struct notifier_block dsp_mbox_notifier = { | ||
| 227 | .notifier_call = io_mbox_msg, | ||
| 228 | }; | ||
| 229 | |||
| 226 | static inline void flush_all(struct bridge_dev_context *dev_context) | 230 | static inline void flush_all(struct bridge_dev_context *dev_context) |
| 227 | { | 231 | { |
| 228 | if (dev_context->dw_brd_state == BRD_DSP_HIBERNATION || | 232 | if (dev_context->dw_brd_state == BRD_DSP_HIBERNATION || |
| @@ -553,7 +557,7 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt, | |||
| 553 | * Enable Mailbox events and also drain any pending | 557 | * Enable Mailbox events and also drain any pending |
| 554 | * stale messages. | 558 | * stale messages. |
| 555 | */ | 559 | */ |
| 556 | dev_context->mbox = omap_mbox_get("dsp"); | 560 | dev_context->mbox = omap_mbox_get("dsp", &dsp_mbox_notifier); |
| 557 | if (IS_ERR(dev_context->mbox)) { | 561 | if (IS_ERR(dev_context->mbox)) { |
| 558 | dev_context->mbox = NULL; | 562 | dev_context->mbox = NULL; |
| 559 | pr_err("%s: Failed to get dsp mailbox handle\n", | 563 | pr_err("%s: Failed to get dsp mailbox handle\n", |
| @@ -563,8 +567,6 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt, | |||
| 563 | 567 | ||
| 564 | } | 568 | } |
| 565 | if (!status) { | 569 | if (!status) { |
| 566 | dev_context->mbox->rxq->callback = (int (*)(void *))io_mbox_msg; | ||
| 567 | |||
| 568 | /*PM_IVA2GRPSEL_PER = 0xC0;*/ | 570 | /*PM_IVA2GRPSEL_PER = 0xC0;*/ |
| 569 | temp = readl(resources->dw_per_pm_base + 0xA8); | 571 | temp = readl(resources->dw_per_pm_base + 0xA8); |
| 570 | temp = (temp & 0xFFFFFF30) | 0xC0; | 572 | temp = (temp & 0xFFFFFF30) | 0xC0; |
| @@ -685,7 +687,7 @@ static int bridge_brd_stop(struct bridge_dev_context *dev_ctxt) | |||
| 685 | /* Disable the mailbox interrupts */ | 687 | /* Disable the mailbox interrupts */ |
| 686 | if (dev_context->mbox) { | 688 | if (dev_context->mbox) { |
| 687 | omap_mbox_disable_irq(dev_context->mbox, IRQ_RX); | 689 | omap_mbox_disable_irq(dev_context->mbox, IRQ_RX); |
| 688 | omap_mbox_put(dev_context->mbox); | 690 | omap_mbox_put(dev_context->mbox, &dsp_mbox_notifier); |
| 689 | dev_context->mbox = NULL; | 691 | dev_context->mbox = NULL; |
| 690 | } | 692 | } |
| 691 | /* Reset IVA2 clocks*/ | 693 | /* Reset IVA2 clocks*/ |
| @@ -786,10 +788,7 @@ static int bridge_dev_create(struct bridge_dev_context | |||
| 786 | 788 | ||
| 787 | pt_attrs = kzalloc(sizeof(struct pg_table_attrs), GFP_KERNEL); | 789 | pt_attrs = kzalloc(sizeof(struct pg_table_attrs), GFP_KERNEL); |
| 788 | if (pt_attrs != NULL) { | 790 | if (pt_attrs != NULL) { |
| 789 | /* Assuming that we use only DSP's memory map | 791 | pt_attrs->l1_size = SZ_16K; /* 4096 entries of 32 bits */ |
| 790 | * until 0x4000:0000 , we would need only 1024 | ||
| 791 | * L1 enties i.e L1 size = 4K */ | ||
| 792 | pt_attrs->l1_size = 0x1000; | ||
| 793 | align_size = pt_attrs->l1_size; | 792 | align_size = pt_attrs->l1_size; |
| 794 | /* Align sizes are expected to be power of 2 */ | 793 | /* Align sizes are expected to be power of 2 */ |
| 795 | /* we like to get aligned on L1 table size */ | 794 | /* we like to get aligned on L1 table size */ |
diff --git a/drivers/staging/tidspbridge/include/dspbridge/io_sm.h b/drivers/staging/tidspbridge/include/dspbridge/io_sm.h index 18aec55d864..8242c70e09d 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/io_sm.h +++ b/drivers/staging/tidspbridge/include/dspbridge/io_sm.h | |||
| @@ -72,22 +72,17 @@ extern void io_dpc(unsigned long ref_data); | |||
| 72 | /* | 72 | /* |
| 73 | * ======== io_mbox_msg ======== | 73 | * ======== io_mbox_msg ======== |
| 74 | * Purpose: | 74 | * Purpose: |
| 75 | * Main interrupt handler for the shared memory Bridge channel manager. | 75 | * Main message handler for the shared memory Bridge channel manager. |
| 76 | * Calls the Bridge's chnlsm_isr to determine if this interrupt is ours, | 76 | * Determine if this message is ours, then schedules a DPC to |
| 77 | * then schedules a DPC to dispatch I/O. | 77 | * dispatch I/O. |
| 78 | * Parameters: | 78 | * Parameters: |
| 79 | * ref_data: Pointer to the channel manager object for this board. | 79 | * self: Pointer to its own notifier_block struct. |
| 80 | * Set in an initial call to ISR_Install(). | 80 | * len: Length of message. |
| 81 | * msg: Message code received. | ||
| 81 | * Returns: | 82 | * Returns: |
| 82 | * TRUE if interrupt handled; FALSE otherwise. | 83 | * NOTIFY_OK if handled; NOTIFY_BAD otherwise. |
| 83 | * Requires: | ||
| 84 | * Must be in locked memory if executing in kernel mode. | ||
| 85 | * Must only call functions which are in locked memory if Kernel mode. | ||
| 86 | * Must only call asynchronous services. | ||
| 87 | * Interrupts are disabled and EOI for this interrupt has been sent. | ||
| 88 | * Ensures: | ||
| 89 | */ | 84 | */ |
| 90 | void io_mbox_msg(u32 msg); | 85 | int io_mbox_msg(struct notifier_block *self, unsigned long len, void *msg); |
| 91 | 86 | ||
| 92 | /* | 87 | /* |
| 93 | * ======== io_request_chnl ======== | 88 | * ======== io_request_chnl ======== |
diff --git a/drivers/staging/usbip/stub.h b/drivers/staging/usbip/stub.h index 30dbfb6d16f..d73267961ef 100644 --- a/drivers/staging/usbip/stub.h +++ b/drivers/staging/usbip/stub.h | |||
| @@ -32,6 +32,7 @@ | |||
| 32 | 32 | ||
| 33 | struct stub_device { | 33 | struct stub_device { |
| 34 | struct usb_interface *interface; | 34 | struct usb_interface *interface; |
| 35 | struct usb_device *udev; | ||
| 35 | struct list_head list; | 36 | struct list_head list; |
| 36 | 37 | ||
| 37 | struct usbip_device ud; | 38 | struct usbip_device ud; |
diff --git a/drivers/staging/usbip/stub_dev.c b/drivers/staging/usbip/stub_dev.c index b186b5fed2b..a7ce51cc890 100644 --- a/drivers/staging/usbip/stub_dev.c +++ b/drivers/staging/usbip/stub_dev.c | |||
| @@ -258,10 +258,11 @@ static void stub_shutdown_connection(struct usbip_device *ud) | |||
| 258 | static void stub_device_reset(struct usbip_device *ud) | 258 | static void stub_device_reset(struct usbip_device *ud) |
| 259 | { | 259 | { |
| 260 | struct stub_device *sdev = container_of(ud, struct stub_device, ud); | 260 | struct stub_device *sdev = container_of(ud, struct stub_device, ud); |
| 261 | struct usb_device *udev = interface_to_usbdev(sdev->interface); | 261 | struct usb_device *udev = sdev->udev; |
| 262 | int ret; | 262 | int ret; |
| 263 | 263 | ||
| 264 | usbip_udbg("device reset"); | 264 | usbip_udbg("device reset"); |
| 265 | |||
| 265 | ret = usb_lock_device_for_reset(udev, sdev->interface); | 266 | ret = usb_lock_device_for_reset(udev, sdev->interface); |
| 266 | if (ret < 0) { | 267 | if (ret < 0) { |
| 267 | dev_err(&udev->dev, "lock for reset\n"); | 268 | dev_err(&udev->dev, "lock for reset\n"); |
| @@ -309,7 +310,8 @@ static void stub_device_unusable(struct usbip_device *ud) | |||
| 309 | * | 310 | * |
| 310 | * Allocates and initializes a new stub_device struct. | 311 | * Allocates and initializes a new stub_device struct. |
| 311 | */ | 312 | */ |
| 312 | static struct stub_device *stub_device_alloc(struct usb_interface *interface) | 313 | static struct stub_device *stub_device_alloc(struct usb_device *udev, |
| 314 | struct usb_interface *interface) | ||
| 313 | { | 315 | { |
| 314 | struct stub_device *sdev; | 316 | struct stub_device *sdev; |
| 315 | int busnum = interface_to_busnum(interface); | 317 | int busnum = interface_to_busnum(interface); |
| @@ -324,7 +326,8 @@ static struct stub_device *stub_device_alloc(struct usb_interface *interface) | |||
| 324 | return NULL; | 326 | return NULL; |
| 325 | } | 327 | } |
| 326 | 328 | ||
| 327 | sdev->interface = interface; | 329 | sdev->interface = usb_get_intf(interface); |
| 330 | sdev->udev = usb_get_dev(udev); | ||
| 328 | 331 | ||
| 329 | /* | 332 | /* |
| 330 | * devid is defined with devnum when this driver is first allocated. | 333 | * devid is defined with devnum when this driver is first allocated. |
| @@ -450,11 +453,12 @@ static int stub_probe(struct usb_interface *interface, | |||
| 450 | return err; | 453 | return err; |
| 451 | } | 454 | } |
| 452 | 455 | ||
| 456 | usb_get_intf(interface); | ||
| 453 | return 0; | 457 | return 0; |
| 454 | } | 458 | } |
| 455 | 459 | ||
| 456 | /* ok. this is my device. */ | 460 | /* ok. this is my device. */ |
| 457 | sdev = stub_device_alloc(interface); | 461 | sdev = stub_device_alloc(udev, interface); |
| 458 | if (!sdev) | 462 | if (!sdev) |
| 459 | return -ENOMEM; | 463 | return -ENOMEM; |
| 460 | 464 | ||
| @@ -476,6 +480,8 @@ static int stub_probe(struct usb_interface *interface, | |||
| 476 | dev_err(&interface->dev, "create sysfs files for %s\n", | 480 | dev_err(&interface->dev, "create sysfs files for %s\n", |
| 477 | udev_busid); | 481 | udev_busid); |
| 478 | usb_set_intfdata(interface, NULL); | 482 | usb_set_intfdata(interface, NULL); |
| 483 | usb_put_intf(interface); | ||
| 484 | |||
| 479 | busid_priv->interf_count = 0; | 485 | busid_priv->interf_count = 0; |
| 480 | 486 | ||
| 481 | busid_priv->sdev = NULL; | 487 | busid_priv->sdev = NULL; |
| @@ -545,6 +551,7 @@ static void stub_disconnect(struct usb_interface *interface) | |||
| 545 | if (busid_priv->interf_count > 1) { | 551 | if (busid_priv->interf_count > 1) { |
| 546 | busid_priv->interf_count--; | 552 | busid_priv->interf_count--; |
| 547 | shutdown_busid(busid_priv); | 553 | shutdown_busid(busid_priv); |
| 554 | usb_put_intf(interface); | ||
| 548 | return; | 555 | return; |
| 549 | } | 556 | } |
| 550 | 557 | ||
| @@ -554,6 +561,9 @@ static void stub_disconnect(struct usb_interface *interface) | |||
| 554 | /* 1. shutdown the current connection */ | 561 | /* 1. shutdown the current connection */ |
| 555 | shutdown_busid(busid_priv); | 562 | shutdown_busid(busid_priv); |
| 556 | 563 | ||
| 564 | usb_put_dev(sdev->udev); | ||
| 565 | usb_put_intf(interface); | ||
| 566 | |||
| 557 | /* 3. free sdev */ | 567 | /* 3. free sdev */ |
| 558 | busid_priv->sdev = NULL; | 568 | busid_priv->sdev = NULL; |
| 559 | stub_device_free(sdev); | 569 | stub_device_free(sdev); |
diff --git a/drivers/staging/usbip/stub_rx.c b/drivers/staging/usbip/stub_rx.c index 3de6fd2539d..ae6ac82754a 100644 --- a/drivers/staging/usbip/stub_rx.c +++ b/drivers/staging/usbip/stub_rx.c | |||
| @@ -364,7 +364,7 @@ static struct stub_priv *stub_priv_alloc(struct stub_device *sdev, | |||
| 364 | 364 | ||
| 365 | static int get_pipe(struct stub_device *sdev, int epnum, int dir) | 365 | static int get_pipe(struct stub_device *sdev, int epnum, int dir) |
| 366 | { | 366 | { |
| 367 | struct usb_device *udev = interface_to_usbdev(sdev->interface); | 367 | struct usb_device *udev = sdev->udev; |
| 368 | struct usb_host_endpoint *ep; | 368 | struct usb_host_endpoint *ep; |
| 369 | struct usb_endpoint_descriptor *epd = NULL; | 369 | struct usb_endpoint_descriptor *epd = NULL; |
| 370 | 370 | ||
| @@ -484,7 +484,7 @@ static void stub_recv_cmd_submit(struct stub_device *sdev, | |||
| 484 | int ret; | 484 | int ret; |
| 485 | struct stub_priv *priv; | 485 | struct stub_priv *priv; |
| 486 | struct usbip_device *ud = &sdev->ud; | 486 | struct usbip_device *ud = &sdev->ud; |
| 487 | struct usb_device *udev = interface_to_usbdev(sdev->interface); | 487 | struct usb_device *udev = sdev->udev; |
| 488 | int pipe = get_pipe(sdev, pdu->base.ep, pdu->base.direction); | 488 | int pipe = get_pipe(sdev, pdu->base.ep, pdu->base.direction); |
| 489 | 489 | ||
| 490 | 490 | ||
diff --git a/drivers/staging/usbip/vhci.h b/drivers/staging/usbip/vhci.h index 41a1fe5138f..afc3b1a7188 100644 --- a/drivers/staging/usbip/vhci.h +++ b/drivers/staging/usbip/vhci.h | |||
| @@ -100,9 +100,6 @@ struct vhci_hcd { | |||
| 100 | * But, the index of this array begins from 0. | 100 | * But, the index of this array begins from 0. |
| 101 | */ | 101 | */ |
| 102 | struct vhci_device vdev[VHCI_NPORTS]; | 102 | struct vhci_device vdev[VHCI_NPORTS]; |
| 103 | |||
| 104 | /* vhci_device which has not been assiged its address yet */ | ||
| 105 | int pending_port; | ||
| 106 | }; | 103 | }; |
| 107 | 104 | ||
| 108 | 105 | ||
| @@ -119,6 +116,9 @@ void rh_port_disconnect(int rhport); | |||
| 119 | void vhci_rx_loop(struct usbip_task *ut); | 116 | void vhci_rx_loop(struct usbip_task *ut); |
| 120 | void vhci_tx_loop(struct usbip_task *ut); | 117 | void vhci_tx_loop(struct usbip_task *ut); |
| 121 | 118 | ||
| 119 | struct urb *pickup_urb_and_free_priv(struct vhci_device *vdev, | ||
| 120 | __u32 seqnum); | ||
| 121 | |||
| 122 | #define hardware (&the_controller->pdev.dev) | 122 | #define hardware (&the_controller->pdev.dev) |
| 123 | 123 | ||
| 124 | static inline struct vhci_device *port_to_vdev(__u32 port) | 124 | static inline struct vhci_device *port_to_vdev(__u32 port) |
diff --git a/drivers/staging/usbip/vhci_hcd.c b/drivers/staging/usbip/vhci_hcd.c index 08bd26a245d..a35fe61268d 100644 --- a/drivers/staging/usbip/vhci_hcd.c +++ b/drivers/staging/usbip/vhci_hcd.c | |||
| @@ -138,8 +138,6 @@ void rh_port_connect(int rhport, enum usb_device_speed speed) | |||
| 138 | * the_controller->vdev[rhport].ud.status = VDEV_CONNECT; | 138 | * the_controller->vdev[rhport].ud.status = VDEV_CONNECT; |
| 139 | * spin_unlock(&the_controller->vdev[rhport].ud.lock); */ | 139 | * spin_unlock(&the_controller->vdev[rhport].ud.lock); */ |
| 140 | 140 | ||
| 141 | the_controller->pending_port = rhport; | ||
| 142 | |||
| 143 | spin_unlock_irqrestore(&the_controller->lock, flags); | 141 | spin_unlock_irqrestore(&the_controller->lock, flags); |
| 144 | 142 | ||
| 145 | usb_hcd_poll_rh_status(vhci_to_hcd(the_controller)); | 143 | usb_hcd_poll_rh_status(vhci_to_hcd(the_controller)); |
| @@ -559,6 +557,7 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, | |||
| 559 | struct device *dev = &urb->dev->dev; | 557 | struct device *dev = &urb->dev->dev; |
| 560 | int ret = 0; | 558 | int ret = 0; |
| 561 | unsigned long flags; | 559 | unsigned long flags; |
| 560 | struct vhci_device *vdev; | ||
| 562 | 561 | ||
| 563 | usbip_dbg_vhci_hc("enter, usb_hcd %p urb %p mem_flags %d\n", | 562 | usbip_dbg_vhci_hc("enter, usb_hcd %p urb %p mem_flags %d\n", |
| 564 | hcd, urb, mem_flags); | 563 | hcd, urb, mem_flags); |
| @@ -574,6 +573,18 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, | |||
| 574 | return urb->status; | 573 | return urb->status; |
| 575 | } | 574 | } |
| 576 | 575 | ||
| 576 | vdev = port_to_vdev(urb->dev->portnum-1); | ||
| 577 | |||
| 578 | /* refuse enqueue for dead connection */ | ||
| 579 | spin_lock(&vdev->ud.lock); | ||
| 580 | if (vdev->ud.status == VDEV_ST_NULL || vdev->ud.status == VDEV_ST_ERROR) { | ||
| 581 | usbip_uerr("enqueue for inactive port %d\n", vdev->rhport); | ||
| 582 | spin_unlock(&vdev->ud.lock); | ||
| 583 | spin_unlock_irqrestore(&the_controller->lock, flags); | ||
| 584 | return -ENODEV; | ||
| 585 | } | ||
| 586 | spin_unlock(&vdev->ud.lock); | ||
| 587 | |||
| 577 | ret = usb_hcd_link_urb_to_ep(hcd, urb); | 588 | ret = usb_hcd_link_urb_to_ep(hcd, urb); |
| 578 | if (ret) | 589 | if (ret) |
| 579 | goto no_need_unlink; | 590 | goto no_need_unlink; |
| @@ -592,8 +603,6 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, | |||
| 592 | __u8 type = usb_pipetype(urb->pipe); | 603 | __u8 type = usb_pipetype(urb->pipe); |
| 593 | struct usb_ctrlrequest *ctrlreq = | 604 | struct usb_ctrlrequest *ctrlreq = |
| 594 | (struct usb_ctrlrequest *) urb->setup_packet; | 605 | (struct usb_ctrlrequest *) urb->setup_packet; |
| 595 | struct vhci_device *vdev = | ||
| 596 | port_to_vdev(the_controller->pending_port); | ||
| 597 | 606 | ||
| 598 | if (type != PIPE_CONTROL || !ctrlreq) { | 607 | if (type != PIPE_CONTROL || !ctrlreq) { |
| 599 | dev_err(dev, "invalid request to devnum 0\n"); | 608 | dev_err(dev, "invalid request to devnum 0\n"); |
| @@ -607,7 +616,9 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, | |||
| 607 | dev_info(dev, "SetAddress Request (%d) to port %d\n", | 616 | dev_info(dev, "SetAddress Request (%d) to port %d\n", |
| 608 | ctrlreq->wValue, vdev->rhport); | 617 | ctrlreq->wValue, vdev->rhport); |
| 609 | 618 | ||
| 610 | vdev->udev = urb->dev; | 619 | if (vdev->udev) |
| 620 | usb_put_dev(vdev->udev); | ||
| 621 | vdev->udev = usb_get_dev(urb->dev); | ||
| 611 | 622 | ||
| 612 | spin_lock(&vdev->ud.lock); | 623 | spin_lock(&vdev->ud.lock); |
| 613 | vdev->ud.status = VDEV_ST_USED; | 624 | vdev->ud.status = VDEV_ST_USED; |
| @@ -627,8 +638,9 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, | |||
| 627 | "Get_Descriptor to device 0 " | 638 | "Get_Descriptor to device 0 " |
| 628 | "(get max pipe size)\n"); | 639 | "(get max pipe size)\n"); |
| 629 | 640 | ||
| 630 | /* FIXME: reference count? (usb_get_dev()) */ | 641 | if (vdev->udev) |
| 631 | vdev->udev = urb->dev; | 642 | usb_put_dev(vdev->udev); |
| 643 | vdev->udev = usb_get_dev(urb->dev); | ||
| 632 | goto out; | 644 | goto out; |
| 633 | 645 | ||
| 634 | default: | 646 | default: |
| @@ -805,7 +817,6 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status) | |||
| 805 | return 0; | 817 | return 0; |
| 806 | } | 818 | } |
| 807 | 819 | ||
| 808 | |||
| 809 | static void vhci_device_unlink_cleanup(struct vhci_device *vdev) | 820 | static void vhci_device_unlink_cleanup(struct vhci_device *vdev) |
| 810 | { | 821 | { |
| 811 | struct vhci_unlink *unlink, *tmp; | 822 | struct vhci_unlink *unlink, *tmp; |
| @@ -813,11 +824,34 @@ static void vhci_device_unlink_cleanup(struct vhci_device *vdev) | |||
| 813 | spin_lock(&vdev->priv_lock); | 824 | spin_lock(&vdev->priv_lock); |
| 814 | 825 | ||
| 815 | list_for_each_entry_safe(unlink, tmp, &vdev->unlink_tx, list) { | 826 | list_for_each_entry_safe(unlink, tmp, &vdev->unlink_tx, list) { |
| 827 | usbip_uinfo("unlink cleanup tx %lu\n", unlink->unlink_seqnum); | ||
| 816 | list_del(&unlink->list); | 828 | list_del(&unlink->list); |
| 817 | kfree(unlink); | 829 | kfree(unlink); |
| 818 | } | 830 | } |
| 819 | 831 | ||
| 820 | list_for_each_entry_safe(unlink, tmp, &vdev->unlink_rx, list) { | 832 | list_for_each_entry_safe(unlink, tmp, &vdev->unlink_rx, list) { |
| 833 | struct urb *urb; | ||
| 834 | |||
| 835 | /* give back URB of unanswered unlink request */ | ||
| 836 | usbip_uinfo("unlink cleanup rx %lu\n", unlink->unlink_seqnum); | ||
| 837 | |||
| 838 | urb = pickup_urb_and_free_priv(vdev, unlink->unlink_seqnum); | ||
| 839 | if (!urb) { | ||
| 840 | usbip_uinfo("the urb (seqnum %lu) was already given back\n", | ||
| 841 | unlink->unlink_seqnum); | ||
| 842 | list_del(&unlink->list); | ||
| 843 | kfree(unlink); | ||
| 844 | continue; | ||
| 845 | } | ||
| 846 | |||
| 847 | urb->status = -ENODEV; | ||
| 848 | |||
| 849 | spin_lock(&the_controller->lock); | ||
| 850 | usb_hcd_unlink_urb_from_ep(vhci_to_hcd(the_controller), urb); | ||
| 851 | spin_unlock(&the_controller->lock); | ||
| 852 | |||
| 853 | usb_hcd_giveback_urb(vhci_to_hcd(the_controller), urb, urb->status); | ||
| 854 | |||
| 821 | list_del(&unlink->list); | 855 | list_del(&unlink->list); |
| 822 | kfree(unlink); | 856 | kfree(unlink); |
| 823 | } | 857 | } |
| @@ -887,6 +921,10 @@ static void vhci_device_reset(struct usbip_device *ud) | |||
| 887 | vdev->speed = 0; | 921 | vdev->speed = 0; |
| 888 | vdev->devid = 0; | 922 | vdev->devid = 0; |
| 889 | 923 | ||
| 924 | if (vdev->udev) | ||
| 925 | usb_put_dev(vdev->udev); | ||
| 926 | vdev->udev = NULL; | ||
| 927 | |||
| 890 | ud->tcp_socket = NULL; | 928 | ud->tcp_socket = NULL; |
| 891 | 929 | ||
| 892 | ud->status = VDEV_ST_NULL; | 930 | ud->status = VDEV_ST_NULL; |
diff --git a/drivers/staging/usbip/vhci_rx.c b/drivers/staging/usbip/vhci_rx.c index 8147d7202b2..bf699147094 100644 --- a/drivers/staging/usbip/vhci_rx.c +++ b/drivers/staging/usbip/vhci_rx.c | |||
| @@ -23,16 +23,14 @@ | |||
| 23 | #include "vhci.h" | 23 | #include "vhci.h" |
| 24 | 24 | ||
| 25 | 25 | ||
| 26 | /* get URB from transmitted urb queue */ | 26 | /* get URB from transmitted urb queue. caller must hold vdev->priv_lock */ |
| 27 | static struct urb *pickup_urb_and_free_priv(struct vhci_device *vdev, | 27 | struct urb *pickup_urb_and_free_priv(struct vhci_device *vdev, |
| 28 | __u32 seqnum) | 28 | __u32 seqnum) |
| 29 | { | 29 | { |
| 30 | struct vhci_priv *priv, *tmp; | 30 | struct vhci_priv *priv, *tmp; |
| 31 | struct urb *urb = NULL; | 31 | struct urb *urb = NULL; |
| 32 | int status; | 32 | int status; |
| 33 | 33 | ||
| 34 | spin_lock(&vdev->priv_lock); | ||
| 35 | |||
| 36 | list_for_each_entry_safe(priv, tmp, &vdev->priv_rx, list) { | 34 | list_for_each_entry_safe(priv, tmp, &vdev->priv_rx, list) { |
| 37 | if (priv->seqnum == seqnum) { | 35 | if (priv->seqnum == seqnum) { |
| 38 | urb = priv->urb; | 36 | urb = priv->urb; |
| @@ -63,8 +61,6 @@ static struct urb *pickup_urb_and_free_priv(struct vhci_device *vdev, | |||
| 63 | } | 61 | } |
| 64 | } | 62 | } |
| 65 | 63 | ||
| 66 | spin_unlock(&vdev->priv_lock); | ||
| 67 | |||
| 68 | return urb; | 64 | return urb; |
| 69 | } | 65 | } |
| 70 | 66 | ||
| @@ -74,9 +70,11 @@ static void vhci_recv_ret_submit(struct vhci_device *vdev, | |||
| 74 | struct usbip_device *ud = &vdev->ud; | 70 | struct usbip_device *ud = &vdev->ud; |
| 75 | struct urb *urb; | 71 | struct urb *urb; |
| 76 | 72 | ||
| 73 | spin_lock(&vdev->priv_lock); | ||
| 77 | 74 | ||
| 78 | urb = pickup_urb_and_free_priv(vdev, pdu->base.seqnum); | 75 | urb = pickup_urb_and_free_priv(vdev, pdu->base.seqnum); |
| 79 | 76 | ||
| 77 | spin_unlock(&vdev->priv_lock); | ||
| 80 | 78 | ||
| 81 | if (!urb) { | 79 | if (!urb) { |
| 82 | usbip_uerr("cannot find a urb of seqnum %u\n", | 80 | usbip_uerr("cannot find a urb of seqnum %u\n", |
| @@ -161,7 +159,12 @@ static void vhci_recv_ret_unlink(struct vhci_device *vdev, | |||
| 161 | return; | 159 | return; |
| 162 | } | 160 | } |
| 163 | 161 | ||
| 162 | spin_lock(&vdev->priv_lock); | ||
| 163 | |||
| 164 | urb = pickup_urb_and_free_priv(vdev, unlink->unlink_seqnum); | 164 | urb = pickup_urb_and_free_priv(vdev, unlink->unlink_seqnum); |
| 165 | |||
| 166 | spin_unlock(&vdev->priv_lock); | ||
| 167 | |||
| 165 | if (!urb) { | 168 | if (!urb) { |
| 166 | /* | 169 | /* |
| 167 | * I get the result of a unlink request. But, it seems that I | 170 | * I get the result of a unlink request. But, it seems that I |
| @@ -190,6 +193,19 @@ static void vhci_recv_ret_unlink(struct vhci_device *vdev, | |||
| 190 | return; | 193 | return; |
| 191 | } | 194 | } |
| 192 | 195 | ||
| 196 | static int vhci_priv_tx_empty(struct vhci_device *vdev) | ||
| 197 | { | ||
| 198 | int empty = 0; | ||
| 199 | |||
| 200 | spin_lock(&vdev->priv_lock); | ||
| 201 | |||
| 202 | empty = list_empty(&vdev->priv_rx); | ||
| 203 | |||
| 204 | spin_unlock(&vdev->priv_lock); | ||
| 205 | |||
| 206 | return empty; | ||
| 207 | } | ||
| 208 | |||
| 193 | /* recv a pdu */ | 209 | /* recv a pdu */ |
| 194 | static void vhci_rx_pdu(struct usbip_device *ud) | 210 | static void vhci_rx_pdu(struct usbip_device *ud) |
| 195 | { | 211 | { |
| @@ -202,11 +218,29 @@ static void vhci_rx_pdu(struct usbip_device *ud) | |||
| 202 | 218 | ||
| 203 | memset(&pdu, 0, sizeof(pdu)); | 219 | memset(&pdu, 0, sizeof(pdu)); |
| 204 | 220 | ||
| 205 | |||
| 206 | /* 1. receive a pdu header */ | 221 | /* 1. receive a pdu header */ |
| 207 | ret = usbip_xmit(0, ud->tcp_socket, (char *) &pdu, sizeof(pdu), 0); | 222 | ret = usbip_xmit(0, ud->tcp_socket, (char *) &pdu, sizeof(pdu), 0); |
| 223 | if (ret < 0) { | ||
| 224 | if (ret == -ECONNRESET) | ||
| 225 | usbip_uinfo("connection reset by peer\n"); | ||
| 226 | else if (ret == -EAGAIN) { | ||
| 227 | /* ignore if connection was idle */ | ||
| 228 | if (vhci_priv_tx_empty(vdev)) | ||
| 229 | return; | ||
| 230 | usbip_uinfo("connection timed out with pending urbs\n"); | ||
| 231 | } else if (ret != -ERESTARTSYS) | ||
| 232 | usbip_uinfo("xmit failed %d\n", ret); | ||
| 233 | |||
| 234 | usbip_event_add(ud, VDEV_EVENT_ERROR_TCP); | ||
| 235 | return; | ||
| 236 | } | ||
| 237 | if (ret == 0) { | ||
| 238 | usbip_uinfo("connection closed"); | ||
| 239 | usbip_event_add(ud, VDEV_EVENT_DOWN); | ||
| 240 | return; | ||
| 241 | } | ||
| 208 | if (ret != sizeof(pdu)) { | 242 | if (ret != sizeof(pdu)) { |
| 209 | usbip_uerr("receiving pdu failed! size is %d, should be %d\n", | 243 | usbip_uerr("received pdu size is %d, should be %d\n", |
| 210 | ret, (unsigned int)sizeof(pdu)); | 244 | ret, (unsigned int)sizeof(pdu)); |
| 211 | usbip_event_add(ud, VDEV_EVENT_ERROR_TCP); | 245 | usbip_event_add(ud, VDEV_EVENT_ERROR_TCP); |
| 212 | return; | 246 | return; |
diff --git a/drivers/staging/vme/bridges/Module.symvers b/drivers/staging/vme/bridges/Module.symvers deleted file mode 100644 index e69de29bb2d..00000000000 --- a/drivers/staging/vme/bridges/Module.symvers +++ /dev/null | |||
diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c index 7016fdd2509..e19b932492e 100644 --- a/drivers/staging/xgifb/vb_setmode.c +++ b/drivers/staging/xgifb/vb_setmode.c | |||
| @@ -3954,8 +3954,8 @@ void XGI_GetCRT2ResInfo(unsigned short ModeNo, unsigned short ModeIdIndex, | |||
| 3954 | unsigned char XGI_IsLCDDualLink(struct vb_device_info *pVBInfo) | 3954 | unsigned char XGI_IsLCDDualLink(struct vb_device_info *pVBInfo) |
| 3955 | { | 3955 | { |
| 3956 | 3956 | ||
| 3957 | if ((((pVBInfo->VBInfo & SetCRT2ToLCD) | SetCRT2ToLCDA)) | 3957 | if ((pVBInfo->VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) && |
| 3958 | && (pVBInfo->LCDInfo & SetLCDDualLink)) /* shampoo0129 */ | 3958 | (pVBInfo->LCDInfo & SetLCDDualLink)) /* shampoo0129 */ |
| 3959 | return 1; | 3959 | return 1; |
| 3960 | 3960 | ||
| 3961 | return 0; | 3961 | return 0; |
| @@ -8773,7 +8773,7 @@ unsigned short XGI_GetVCLK2Ptr(unsigned short ModeNo, | |||
| 8773 | 8773 | ||
| 8774 | if (pVBInfo->IF_DEF_LVDS == 0) { | 8774 | if (pVBInfo->IF_DEF_LVDS == 0) { |
| 8775 | CRT2Index = CRT2Index >> 6; /* for LCD */ | 8775 | CRT2Index = CRT2Index >> 6; /* for LCD */ |
| 8776 | if (((pVBInfo->VBInfo & SetCRT2ToLCD) | SetCRT2ToLCDA)) { /*301b*/ | 8776 | if (pVBInfo->VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { /*301b*/ |
| 8777 | if (pVBInfo->LCDResInfo != Panel1024x768) | 8777 | if (pVBInfo->LCDResInfo != Panel1024x768) |
| 8778 | VCLKIndex = LCDXlat2VCLK[CRT2Index]; | 8778 | VCLKIndex = LCDXlat2VCLK[CRT2Index]; |
| 8779 | else | 8779 | else |
diff --git a/drivers/tty/n_hdlc.c b/drivers/tty/n_hdlc.c index 47d32281032..52fc0c9a636 100644 --- a/drivers/tty/n_hdlc.c +++ b/drivers/tty/n_hdlc.c | |||
| @@ -581,8 +581,9 @@ static ssize_t n_hdlc_tty_read(struct tty_struct *tty, struct file *file, | |||
| 581 | __u8 __user *buf, size_t nr) | 581 | __u8 __user *buf, size_t nr) |
| 582 | { | 582 | { |
| 583 | struct n_hdlc *n_hdlc = tty2n_hdlc(tty); | 583 | struct n_hdlc *n_hdlc = tty2n_hdlc(tty); |
| 584 | int ret; | 584 | int ret = 0; |
| 585 | struct n_hdlc_buf *rbuf; | 585 | struct n_hdlc_buf *rbuf; |
| 586 | DECLARE_WAITQUEUE(wait, current); | ||
| 586 | 587 | ||
| 587 | if (debuglevel >= DEBUG_LEVEL_INFO) | 588 | if (debuglevel >= DEBUG_LEVEL_INFO) |
| 588 | printk("%s(%d)n_hdlc_tty_read() called\n",__FILE__,__LINE__); | 589 | printk("%s(%d)n_hdlc_tty_read() called\n",__FILE__,__LINE__); |
| @@ -598,57 +599,55 @@ static ssize_t n_hdlc_tty_read(struct tty_struct *tty, struct file *file, | |||
| 598 | return -EFAULT; | 599 | return -EFAULT; |
| 599 | } | 600 | } |
| 600 | 601 | ||
| 601 | tty_lock(); | 602 | add_wait_queue(&tty->read_wait, &wait); |
| 602 | 603 | ||
| 603 | for (;;) { | 604 | for (;;) { |
| 604 | if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) { | 605 | if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) { |
| 605 | tty_unlock(); | 606 | ret = -EIO; |
| 606 | return -EIO; | 607 | break; |
| 607 | } | 608 | } |
| 609 | if (tty_hung_up_p(file)) | ||
| 610 | break; | ||
| 608 | 611 | ||
| 609 | n_hdlc = tty2n_hdlc (tty); | 612 | set_current_state(TASK_INTERRUPTIBLE); |
| 610 | if (!n_hdlc || n_hdlc->magic != HDLC_MAGIC || | ||
| 611 | tty != n_hdlc->tty) { | ||
| 612 | tty_unlock(); | ||
| 613 | return 0; | ||
| 614 | } | ||
| 615 | 613 | ||
| 616 | rbuf = n_hdlc_buf_get(&n_hdlc->rx_buf_list); | 614 | rbuf = n_hdlc_buf_get(&n_hdlc->rx_buf_list); |
| 617 | if (rbuf) | 615 | if (rbuf) { |
| 616 | if (rbuf->count > nr) { | ||
| 617 | /* too large for caller's buffer */ | ||
| 618 | ret = -EOVERFLOW; | ||
| 619 | } else { | ||
| 620 | if (copy_to_user(buf, rbuf->buf, rbuf->count)) | ||
| 621 | ret = -EFAULT; | ||
| 622 | else | ||
| 623 | ret = rbuf->count; | ||
| 624 | } | ||
| 625 | |||
| 626 | if (n_hdlc->rx_free_buf_list.count > | ||
| 627 | DEFAULT_RX_BUF_COUNT) | ||
| 628 | kfree(rbuf); | ||
| 629 | else | ||
| 630 | n_hdlc_buf_put(&n_hdlc->rx_free_buf_list, rbuf); | ||
| 618 | break; | 631 | break; |
| 632 | } | ||
| 619 | 633 | ||
| 620 | /* no data */ | 634 | /* no data */ |
| 621 | if (file->f_flags & O_NONBLOCK) { | 635 | if (file->f_flags & O_NONBLOCK) { |
| 622 | tty_unlock(); | 636 | ret = -EAGAIN; |
| 623 | return -EAGAIN; | 637 | break; |
| 624 | } | 638 | } |
| 625 | 639 | ||
| 626 | interruptible_sleep_on (&tty->read_wait); | 640 | schedule(); |
| 641 | |||
| 627 | if (signal_pending(current)) { | 642 | if (signal_pending(current)) { |
| 628 | tty_unlock(); | 643 | ret = -EINTR; |
| 629 | return -EINTR; | 644 | break; |
| 630 | } | 645 | } |
| 631 | } | 646 | } |
| 632 | 647 | ||
| 633 | if (rbuf->count > nr) | 648 | remove_wait_queue(&tty->read_wait, &wait); |
| 634 | /* frame too large for caller's buffer (discard frame) */ | 649 | __set_current_state(TASK_RUNNING); |
| 635 | ret = -EOVERFLOW; | 650 | |
| 636 | else { | ||
| 637 | /* Copy the data to the caller's buffer */ | ||
| 638 | if (copy_to_user(buf, rbuf->buf, rbuf->count)) | ||
| 639 | ret = -EFAULT; | ||
| 640 | else | ||
| 641 | ret = rbuf->count; | ||
| 642 | } | ||
| 643 | |||
| 644 | /* return HDLC buffer to free list unless the free list */ | ||
| 645 | /* count has exceeded the default value, in which case the */ | ||
| 646 | /* buffer is freed back to the OS to conserve memory */ | ||
| 647 | if (n_hdlc->rx_free_buf_list.count > DEFAULT_RX_BUF_COUNT) | ||
| 648 | kfree(rbuf); | ||
| 649 | else | ||
| 650 | n_hdlc_buf_put(&n_hdlc->rx_free_buf_list,rbuf); | ||
| 651 | tty_unlock(); | ||
| 652 | return ret; | 651 | return ret; |
| 653 | 652 | ||
| 654 | } /* end of n_hdlc_tty_read() */ | 653 | } /* end of n_hdlc_tty_read() */ |
| @@ -691,14 +690,15 @@ static ssize_t n_hdlc_tty_write(struct tty_struct *tty, struct file *file, | |||
| 691 | count = maxframe; | 690 | count = maxframe; |
| 692 | } | 691 | } |
| 693 | 692 | ||
| 694 | tty_lock(); | ||
| 695 | |||
| 696 | add_wait_queue(&tty->write_wait, &wait); | 693 | add_wait_queue(&tty->write_wait, &wait); |
| 697 | set_current_state(TASK_INTERRUPTIBLE); | 694 | |
| 695 | for (;;) { | ||
| 696 | set_current_state(TASK_INTERRUPTIBLE); | ||
| 698 | 697 | ||
| 699 | /* Allocate transmit buffer */ | 698 | tbuf = n_hdlc_buf_get(&n_hdlc->tx_free_buf_list); |
| 700 | /* sleep until transmit buffer available */ | 699 | if (tbuf) |
| 701 | while (!(tbuf = n_hdlc_buf_get(&n_hdlc->tx_free_buf_list))) { | 700 | break; |
| 701 | |||
| 702 | if (file->f_flags & O_NONBLOCK) { | 702 | if (file->f_flags & O_NONBLOCK) { |
| 703 | error = -EAGAIN; | 703 | error = -EAGAIN; |
| 704 | break; | 704 | break; |
| @@ -719,7 +719,7 @@ static ssize_t n_hdlc_tty_write(struct tty_struct *tty, struct file *file, | |||
| 719 | } | 719 | } |
| 720 | } | 720 | } |
| 721 | 721 | ||
| 722 | set_current_state(TASK_RUNNING); | 722 | __set_current_state(TASK_RUNNING); |
| 723 | remove_wait_queue(&tty->write_wait, &wait); | 723 | remove_wait_queue(&tty->write_wait, &wait); |
| 724 | 724 | ||
| 725 | if (!error) { | 725 | if (!error) { |
| @@ -731,7 +731,7 @@ static ssize_t n_hdlc_tty_write(struct tty_struct *tty, struct file *file, | |||
| 731 | n_hdlc_buf_put(&n_hdlc->tx_buf_list,tbuf); | 731 | n_hdlc_buf_put(&n_hdlc->tx_buf_list,tbuf); |
| 732 | n_hdlc_send_frames(n_hdlc,tty); | 732 | n_hdlc_send_frames(n_hdlc,tty); |
| 733 | } | 733 | } |
| 734 | tty_unlock(); | 734 | |
| 735 | return error; | 735 | return error; |
| 736 | 736 | ||
| 737 | } /* end of n_hdlc_tty_write() */ | 737 | } /* end of n_hdlc_tty_write() */ |
diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c index b25e6e49053..3975df6f7fd 100644 --- a/drivers/tty/serial/8250.c +++ b/drivers/tty/serial/8250.c | |||
| @@ -236,7 +236,8 @@ static const struct serial8250_config uart_config[] = { | |||
| 236 | .fifo_size = 128, | 236 | .fifo_size = 128, |
| 237 | .tx_loadsz = 128, | 237 | .tx_loadsz = 128, |
| 238 | .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10, | 238 | .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10, |
| 239 | .flags = UART_CAP_FIFO | UART_CAP_EFR | UART_CAP_SLEEP, | 239 | /* UART_CAP_EFR breaks billionon CF bluetooth card. */ |
| 240 | .flags = UART_CAP_FIFO | UART_CAP_SLEEP, | ||
| 240 | }, | 241 | }, |
| 241 | [PORT_16654] = { | 242 | [PORT_16654] = { |
| 242 | .name = "ST16654", | 243 | .name = "ST16654", |
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig index b1682d7f1d8..2b8334601c8 100644 --- a/drivers/tty/serial/Kconfig +++ b/drivers/tty/serial/Kconfig | |||
| @@ -1518,6 +1518,7 @@ config SERIAL_BCM63XX_CONSOLE | |||
| 1518 | config SERIAL_GRLIB_GAISLER_APBUART | 1518 | config SERIAL_GRLIB_GAISLER_APBUART |
| 1519 | tristate "GRLIB APBUART serial support" | 1519 | tristate "GRLIB APBUART serial support" |
| 1520 | depends on OF | 1520 | depends on OF |
| 1521 | select SERIAL_CORE | ||
| 1521 | ---help--- | 1522 | ---help--- |
| 1522 | Add support for the GRLIB APBUART serial port. | 1523 | Add support for the GRLIB APBUART serial port. |
| 1523 | 1524 | ||
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index 6158eae0f64..0065da4b11c 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c | |||
| @@ -3257,7 +3257,7 @@ static ssize_t show_cons_active(struct device *dev, | |||
| 3257 | ssize_t count = 0; | 3257 | ssize_t count = 0; |
| 3258 | 3258 | ||
| 3259 | console_lock(); | 3259 | console_lock(); |
| 3260 | for (c = console_drivers; c; c = c->next) { | 3260 | for_each_console(c) { |
| 3261 | if (!c->device) | 3261 | if (!c->device) |
| 3262 | continue; | 3262 | continue; |
| 3263 | if (!c->write) | 3263 | if (!c->write) |
| @@ -3306,7 +3306,7 @@ int __init tty_init(void) | |||
| 3306 | if (IS_ERR(consdev)) | 3306 | if (IS_ERR(consdev)) |
| 3307 | consdev = NULL; | 3307 | consdev = NULL; |
| 3308 | else | 3308 | else |
| 3309 | device_create_file(consdev, &dev_attr_active); | 3309 | WARN_ON(device_create_file(consdev, &dev_attr_active) < 0); |
| 3310 | 3310 | ||
| 3311 | #ifdef CONFIG_VT | 3311 | #ifdef CONFIG_VT |
| 3312 | vty_init(&console_fops); | 3312 | vty_init(&console_fops); |
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index b230bd3f056..147ede3423d 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c | |||
| @@ -2994,7 +2994,7 @@ int __init vty_init(const struct file_operations *console_fops) | |||
| 2994 | if (IS_ERR(tty0dev)) | 2994 | if (IS_ERR(tty0dev)) |
| 2995 | tty0dev = NULL; | 2995 | tty0dev = NULL; |
| 2996 | else | 2996 | else |
| 2997 | device_create_file(tty0dev, &dev_attr_active); | 2997 | WARN_ON(device_create_file(tty0dev, &dev_attr_active) < 0); |
| 2998 | 2998 | ||
| 2999 | vcs_init(); | 2999 | vcs_init(); |
| 3000 | 3000 | ||
| @@ -3545,7 +3545,7 @@ int register_con_driver(const struct consw *csw, int first, int last) | |||
| 3545 | 3545 | ||
| 3546 | /* already registered */ | 3546 | /* already registered */ |
| 3547 | if (con_driver->con == csw) | 3547 | if (con_driver->con == csw) |
| 3548 | retval = -EINVAL; | 3548 | retval = -EBUSY; |
| 3549 | } | 3549 | } |
| 3550 | 3550 | ||
| 3551 | if (retval) | 3551 | if (retval) |
| @@ -3656,7 +3656,12 @@ int take_over_console(const struct consw *csw, int first, int last, int deflt) | |||
| 3656 | int err; | 3656 | int err; |
| 3657 | 3657 | ||
| 3658 | err = register_con_driver(csw, first, last); | 3658 | err = register_con_driver(csw, first, last); |
| 3659 | 3659 | /* if we get an busy error we still want to bind the console driver | |
| 3660 | * and return success, as we may have unbound the console driver | ||
| 3661 | Â * but not unregistered it. | ||
| 3662 | */ | ||
| 3663 | if (err == -EBUSY) | ||
| 3664 | err = 0; | ||
| 3660 | if (!err) | 3665 | if (!err) |
| 3661 | bind_con_driver(csw, first, last, deflt); | 3666 | bind_con_driver(csw, first, last, deflt); |
| 3662 | 3667 | ||
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index 6ee4451bfe2..47085e5879a 100644 --- a/drivers/usb/class/cdc-wdm.c +++ b/drivers/usb/class/cdc-wdm.c | |||
| @@ -342,7 +342,7 @@ static ssize_t wdm_write | |||
| 342 | goto outnp; | 342 | goto outnp; |
| 343 | } | 343 | } |
| 344 | 344 | ||
| 345 | if (!file->f_flags && O_NONBLOCK) | 345 | if (!(file->f_flags & O_NONBLOCK)) |
| 346 | r = wait_event_interruptible(desc->wait, !test_bit(WDM_IN_USE, | 346 | r = wait_event_interruptible(desc->wait, !test_bit(WDM_IN_USE, |
| 347 | &desc->flags)); | 347 | &desc->flags)); |
| 348 | else | 348 | else |
diff --git a/drivers/usb/core/endpoint.c b/drivers/usb/core/endpoint.c index 9da25056302..df502a98d0d 100644 --- a/drivers/usb/core/endpoint.c +++ b/drivers/usb/core/endpoint.c | |||
| @@ -192,12 +192,12 @@ int usb_create_ep_devs(struct device *parent, | |||
| 192 | ep_dev->dev.parent = parent; | 192 | ep_dev->dev.parent = parent; |
| 193 | ep_dev->dev.release = ep_device_release; | 193 | ep_dev->dev.release = ep_device_release; |
| 194 | dev_set_name(&ep_dev->dev, "ep_%02x", endpoint->desc.bEndpointAddress); | 194 | dev_set_name(&ep_dev->dev, "ep_%02x", endpoint->desc.bEndpointAddress); |
| 195 | device_enable_async_suspend(&ep_dev->dev); | ||
| 196 | 195 | ||
| 197 | retval = device_register(&ep_dev->dev); | 196 | retval = device_register(&ep_dev->dev); |
| 198 | if (retval) | 197 | if (retval) |
| 199 | goto error_register; | 198 | goto error_register; |
| 200 | 199 | ||
| 200 | device_enable_async_suspend(&ep_dev->dev); | ||
| 201 | endpoint->ep_dev = ep_dev; | 201 | endpoint->ep_dev = ep_dev; |
| 202 | return retval; | 202 | return retval; |
| 203 | 203 | ||
diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c index b55d46070a2..f71e8e307e0 100644 --- a/drivers/usb/core/hcd-pci.c +++ b/drivers/usb/core/hcd-pci.c | |||
| @@ -405,7 +405,12 @@ static int suspend_common(struct device *dev, bool do_wakeup) | |||
| 405 | return retval; | 405 | return retval; |
| 406 | } | 406 | } |
| 407 | 407 | ||
| 408 | synchronize_irq(pci_dev->irq); | 408 | /* If MSI-X is enabled, the driver will have synchronized all vectors |
| 409 | * in pci_suspend(). If MSI or legacy PCI is enabled, that will be | ||
| 410 | * synchronized here. | ||
| 411 | */ | ||
| 412 | if (!hcd->msix_enabled) | ||
| 413 | synchronize_irq(pci_dev->irq); | ||
| 409 | 414 | ||
| 410 | /* Downstream ports from this root hub should already be quiesced, so | 415 | /* Downstream ports from this root hub should already be quiesced, so |
| 411 | * there will be no DMA activity. Now we can shut down the upstream | 416 | * there will be no DMA activity. Now we can shut down the upstream |
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index b98efae6a1c..4310cc4b1cb 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
| @@ -676,6 +676,8 @@ static void hub_init_func3(struct work_struct *ws); | |||
| 676 | static void hub_activate(struct usb_hub *hub, enum hub_activation_type type) | 676 | static void hub_activate(struct usb_hub *hub, enum hub_activation_type type) |
| 677 | { | 677 | { |
| 678 | struct usb_device *hdev = hub->hdev; | 678 | struct usb_device *hdev = hub->hdev; |
| 679 | struct usb_hcd *hcd; | ||
| 680 | int ret; | ||
| 679 | int port1; | 681 | int port1; |
| 680 | int status; | 682 | int status; |
| 681 | bool need_debounce_delay = false; | 683 | bool need_debounce_delay = false; |
| @@ -714,6 +716,25 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type) | |||
| 714 | usb_autopm_get_interface_no_resume( | 716 | usb_autopm_get_interface_no_resume( |
| 715 | to_usb_interface(hub->intfdev)); | 717 | to_usb_interface(hub->intfdev)); |
| 716 | return; /* Continues at init2: below */ | 718 | return; /* Continues at init2: below */ |
| 719 | } else if (type == HUB_RESET_RESUME) { | ||
| 720 | /* The internal host controller state for the hub device | ||
| 721 | * may be gone after a host power loss on system resume. | ||
| 722 | * Update the device's info so the HW knows it's a hub. | ||
| 723 | */ | ||
| 724 | hcd = bus_to_hcd(hdev->bus); | ||
| 725 | if (hcd->driver->update_hub_device) { | ||
| 726 | ret = hcd->driver->update_hub_device(hcd, hdev, | ||
| 727 | &hub->tt, GFP_NOIO); | ||
| 728 | if (ret < 0) { | ||
| 729 | dev_err(hub->intfdev, "Host not " | ||
| 730 | "accepting hub info " | ||
| 731 | "update.\n"); | ||
| 732 | dev_err(hub->intfdev, "LS/FS devices " | ||
| 733 | "and hubs may not work " | ||
| 734 | "under this hub\n."); | ||
| 735 | } | ||
| 736 | } | ||
| 737 | hub_power_on(hub, true); | ||
| 717 | } else { | 738 | } else { |
| 718 | hub_power_on(hub, true); | 739 | hub_power_on(hub, true); |
| 719 | } | 740 | } |
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index 1dc9739277b..06bb9d4587e 100644 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig | |||
| @@ -509,7 +509,7 @@ config USB_LANGWELL | |||
| 509 | select USB_GADGET_SELECTED | 509 | select USB_GADGET_SELECTED |
| 510 | 510 | ||
| 511 | config USB_GADGET_EG20T | 511 | config USB_GADGET_EG20T |
| 512 | boolean "Intel EG20T(Topcliff) USB Device controller" | 512 | boolean "Intel EG20T PCH/OKI SEMICONDUCTOR ML7213 IOH UDC" |
| 513 | depends on PCI | 513 | depends on PCI |
| 514 | select USB_GADGET_DUALSPEED | 514 | select USB_GADGET_DUALSPEED |
| 515 | help | 515 | help |
| @@ -525,6 +525,11 @@ config USB_GADGET_EG20T | |||
| 525 | This driver dose not support interrupt transfer or isochronous | 525 | This driver dose not support interrupt transfer or isochronous |
| 526 | transfer modes. | 526 | transfer modes. |
| 527 | 527 | ||
| 528 | This driver also can be used for OKI SEMICONDUCTOR's ML7213 which is | ||
| 529 | for IVI(In-Vehicle Infotainment) use. | ||
| 530 | ML7213 is companion chip for Intel Atom E6xx series. | ||
| 531 | ML7213 is completely compatible for Intel EG20T PCH. | ||
| 532 | |||
| 528 | config USB_EG20T | 533 | config USB_EG20T |
| 529 | tristate | 534 | tristate |
| 530 | depends on USB_GADGET_EG20T | 535 | depends on USB_GADGET_EG20T |
diff --git a/drivers/usb/gadget/ci13xxx_udc.c b/drivers/usb/gadget/ci13xxx_udc.c index 31656a2b4ab..a1c67ae1572 100644 --- a/drivers/usb/gadget/ci13xxx_udc.c +++ b/drivers/usb/gadget/ci13xxx_udc.c | |||
| @@ -76,10 +76,21 @@ static DEFINE_SPINLOCK(udc_lock); | |||
| 76 | 76 | ||
| 77 | /* control endpoint description */ | 77 | /* control endpoint description */ |
| 78 | static const struct usb_endpoint_descriptor | 78 | static const struct usb_endpoint_descriptor |
| 79 | ctrl_endpt_desc = { | 79 | ctrl_endpt_out_desc = { |
| 80 | .bLength = USB_DT_ENDPOINT_SIZE, | 80 | .bLength = USB_DT_ENDPOINT_SIZE, |
| 81 | .bDescriptorType = USB_DT_ENDPOINT, | 81 | .bDescriptorType = USB_DT_ENDPOINT, |
| 82 | 82 | ||
| 83 | .bEndpointAddress = USB_DIR_OUT, | ||
| 84 | .bmAttributes = USB_ENDPOINT_XFER_CONTROL, | ||
| 85 | .wMaxPacketSize = cpu_to_le16(CTRL_PAYLOAD_MAX), | ||
| 86 | }; | ||
| 87 | |||
| 88 | static const struct usb_endpoint_descriptor | ||
| 89 | ctrl_endpt_in_desc = { | ||
| 90 | .bLength = USB_DT_ENDPOINT_SIZE, | ||
| 91 | .bDescriptorType = USB_DT_ENDPOINT, | ||
| 92 | |||
| 93 | .bEndpointAddress = USB_DIR_IN, | ||
| 83 | .bmAttributes = USB_ENDPOINT_XFER_CONTROL, | 94 | .bmAttributes = USB_ENDPOINT_XFER_CONTROL, |
| 84 | .wMaxPacketSize = cpu_to_le16(CTRL_PAYLOAD_MAX), | 95 | .wMaxPacketSize = cpu_to_le16(CTRL_PAYLOAD_MAX), |
| 85 | }; | 96 | }; |
| @@ -265,10 +276,10 @@ static int hw_device_init(void __iomem *base) | |||
| 265 | hw_bank.size /= sizeof(u32); | 276 | hw_bank.size /= sizeof(u32); |
| 266 | 277 | ||
| 267 | reg = hw_aread(ABS_DCCPARAMS, DCCPARAMS_DEN) >> ffs_nr(DCCPARAMS_DEN); | 278 | reg = hw_aread(ABS_DCCPARAMS, DCCPARAMS_DEN) >> ffs_nr(DCCPARAMS_DEN); |
| 268 | if (reg == 0 || reg > ENDPT_MAX) | 279 | hw_ep_max = reg * 2; /* cache hw ENDPT_MAX */ |
| 269 | return -ENODEV; | ||
| 270 | 280 | ||
| 271 | hw_ep_max = reg; /* cache hw ENDPT_MAX */ | 281 | if (hw_ep_max == 0 || hw_ep_max > ENDPT_MAX) |
| 282 | return -ENODEV; | ||
| 272 | 283 | ||
| 273 | /* setup lock mode ? */ | 284 | /* setup lock mode ? */ |
| 274 | 285 | ||
| @@ -1197,16 +1208,17 @@ static ssize_t show_qheads(struct device *dev, struct device_attribute *attr, | |||
| 1197 | } | 1208 | } |
| 1198 | 1209 | ||
| 1199 | spin_lock_irqsave(udc->lock, flags); | 1210 | spin_lock_irqsave(udc->lock, flags); |
| 1200 | for (i = 0; i < hw_ep_max; i++) { | 1211 | for (i = 0; i < hw_ep_max/2; i++) { |
| 1201 | struct ci13xxx_ep *mEp = &udc->ci13xxx_ep[i]; | 1212 | struct ci13xxx_ep *mEpRx = &udc->ci13xxx_ep[i]; |
| 1213 | struct ci13xxx_ep *mEpTx = &udc->ci13xxx_ep[i + hw_ep_max/2]; | ||
| 1202 | n += scnprintf(buf + n, PAGE_SIZE - n, | 1214 | n += scnprintf(buf + n, PAGE_SIZE - n, |
| 1203 | "EP=%02i: RX=%08X TX=%08X\n", | 1215 | "EP=%02i: RX=%08X TX=%08X\n", |
| 1204 | i, (u32)mEp->qh[RX].dma, (u32)mEp->qh[TX].dma); | 1216 | i, (u32)mEpRx->qh.dma, (u32)mEpTx->qh.dma); |
| 1205 | for (j = 0; j < (sizeof(struct ci13xxx_qh)/sizeof(u32)); j++) { | 1217 | for (j = 0; j < (sizeof(struct ci13xxx_qh)/sizeof(u32)); j++) { |
| 1206 | n += scnprintf(buf + n, PAGE_SIZE - n, | 1218 | n += scnprintf(buf + n, PAGE_SIZE - n, |
| 1207 | " %04X: %08X %08X\n", j, | 1219 | " %04X: %08X %08X\n", j, |
| 1208 | *((u32 *)mEp->qh[RX].ptr + j), | 1220 | *((u32 *)mEpRx->qh.ptr + j), |
| 1209 | *((u32 *)mEp->qh[TX].ptr + j)); | 1221 | *((u32 *)mEpTx->qh.ptr + j)); |
| 1210 | } | 1222 | } |
| 1211 | } | 1223 | } |
| 1212 | spin_unlock_irqrestore(udc->lock, flags); | 1224 | spin_unlock_irqrestore(udc->lock, flags); |
| @@ -1293,7 +1305,7 @@ static ssize_t show_requests(struct device *dev, struct device_attribute *attr, | |||
| 1293 | unsigned long flags; | 1305 | unsigned long flags; |
| 1294 | struct list_head *ptr = NULL; | 1306 | struct list_head *ptr = NULL; |
| 1295 | struct ci13xxx_req *req = NULL; | 1307 | struct ci13xxx_req *req = NULL; |
| 1296 | unsigned i, j, k, n = 0, qSize = sizeof(struct ci13xxx_td)/sizeof(u32); | 1308 | unsigned i, j, n = 0, qSize = sizeof(struct ci13xxx_td)/sizeof(u32); |
| 1297 | 1309 | ||
| 1298 | dbg_trace("[%s] %p\n", __func__, buf); | 1310 | dbg_trace("[%s] %p\n", __func__, buf); |
| 1299 | if (attr == NULL || buf == NULL) { | 1311 | if (attr == NULL || buf == NULL) { |
| @@ -1303,22 +1315,20 @@ static ssize_t show_requests(struct device *dev, struct device_attribute *attr, | |||
| 1303 | 1315 | ||
| 1304 | spin_lock_irqsave(udc->lock, flags); | 1316 | spin_lock_irqsave(udc->lock, flags); |
| 1305 | for (i = 0; i < hw_ep_max; i++) | 1317 | for (i = 0; i < hw_ep_max; i++) |
| 1306 | for (k = RX; k <= TX; k++) | 1318 | list_for_each(ptr, &udc->ci13xxx_ep[i].qh.queue) |
| 1307 | list_for_each(ptr, &udc->ci13xxx_ep[i].qh[k].queue) | 1319 | { |
| 1308 | { | 1320 | req = list_entry(ptr, struct ci13xxx_req, queue); |
| 1309 | req = list_entry(ptr, | 1321 | |
| 1310 | struct ci13xxx_req, queue); | 1322 | n += scnprintf(buf + n, PAGE_SIZE - n, |
| 1323 | "EP=%02i: TD=%08X %s\n", | ||
| 1324 | i % hw_ep_max/2, (u32)req->dma, | ||
| 1325 | ((i < hw_ep_max/2) ? "RX" : "TX")); | ||
| 1311 | 1326 | ||
| 1327 | for (j = 0; j < qSize; j++) | ||
| 1312 | n += scnprintf(buf + n, PAGE_SIZE - n, | 1328 | n += scnprintf(buf + n, PAGE_SIZE - n, |
| 1313 | "EP=%02i: TD=%08X %s\n", | 1329 | " %04X: %08X\n", j, |
| 1314 | i, (u32)req->dma, | 1330 | *((u32 *)req->ptr + j)); |
| 1315 | ((k == RX) ? "RX" : "TX")); | 1331 | } |
| 1316 | |||
| 1317 | for (j = 0; j < qSize; j++) | ||
| 1318 | n += scnprintf(buf + n, PAGE_SIZE - n, | ||
| 1319 | " %04X: %08X\n", j, | ||
| 1320 | *((u32 *)req->ptr + j)); | ||
| 1321 | } | ||
| 1322 | spin_unlock_irqrestore(udc->lock, flags); | 1332 | spin_unlock_irqrestore(udc->lock, flags); |
| 1323 | 1333 | ||
| 1324 | return n; | 1334 | return n; |
| @@ -1467,12 +1477,12 @@ static int _hardware_enqueue(struct ci13xxx_ep *mEp, struct ci13xxx_req *mReq) | |||
| 1467 | * At this point it's guaranteed exclusive access to qhead | 1477 | * At this point it's guaranteed exclusive access to qhead |
| 1468 | * (endpt is not primed) so it's no need to use tripwire | 1478 | * (endpt is not primed) so it's no need to use tripwire |
| 1469 | */ | 1479 | */ |
| 1470 | mEp->qh[mEp->dir].ptr->td.next = mReq->dma; /* TERMINATE = 0 */ | 1480 | mEp->qh.ptr->td.next = mReq->dma; /* TERMINATE = 0 */ |
| 1471 | mEp->qh[mEp->dir].ptr->td.token &= ~TD_STATUS; /* clear status */ | 1481 | mEp->qh.ptr->td.token &= ~TD_STATUS; /* clear status */ |
| 1472 | if (mReq->req.zero == 0) | 1482 | if (mReq->req.zero == 0) |
| 1473 | mEp->qh[mEp->dir].ptr->cap |= QH_ZLT; | 1483 | mEp->qh.ptr->cap |= QH_ZLT; |
| 1474 | else | 1484 | else |
| 1475 | mEp->qh[mEp->dir].ptr->cap &= ~QH_ZLT; | 1485 | mEp->qh.ptr->cap &= ~QH_ZLT; |
| 1476 | 1486 | ||
| 1477 | wmb(); /* synchronize before ep prime */ | 1487 | wmb(); /* synchronize before ep prime */ |
| 1478 | 1488 | ||
| @@ -1542,11 +1552,11 @@ __acquires(mEp->lock) | |||
| 1542 | 1552 | ||
| 1543 | hw_ep_flush(mEp->num, mEp->dir); | 1553 | hw_ep_flush(mEp->num, mEp->dir); |
| 1544 | 1554 | ||
| 1545 | while (!list_empty(&mEp->qh[mEp->dir].queue)) { | 1555 | while (!list_empty(&mEp->qh.queue)) { |
| 1546 | 1556 | ||
| 1547 | /* pop oldest request */ | 1557 | /* pop oldest request */ |
| 1548 | struct ci13xxx_req *mReq = \ | 1558 | struct ci13xxx_req *mReq = \ |
| 1549 | list_entry(mEp->qh[mEp->dir].queue.next, | 1559 | list_entry(mEp->qh.queue.next, |
| 1550 | struct ci13xxx_req, queue); | 1560 | struct ci13xxx_req, queue); |
| 1551 | list_del_init(&mReq->queue); | 1561 | list_del_init(&mReq->queue); |
| 1552 | mReq->req.status = -ESHUTDOWN; | 1562 | mReq->req.status = -ESHUTDOWN; |
| @@ -1571,8 +1581,6 @@ static int _gadget_stop_activity(struct usb_gadget *gadget) | |||
| 1571 | { | 1581 | { |
| 1572 | struct usb_ep *ep; | 1582 | struct usb_ep *ep; |
| 1573 | struct ci13xxx *udc = container_of(gadget, struct ci13xxx, gadget); | 1583 | struct ci13xxx *udc = container_of(gadget, struct ci13xxx, gadget); |
| 1574 | struct ci13xxx_ep *mEp = container_of(gadget->ep0, | ||
| 1575 | struct ci13xxx_ep, ep); | ||
| 1576 | 1584 | ||
| 1577 | trace("%p", gadget); | 1585 | trace("%p", gadget); |
| 1578 | 1586 | ||
| @@ -1583,7 +1591,8 @@ static int _gadget_stop_activity(struct usb_gadget *gadget) | |||
| 1583 | gadget_for_each_ep(ep, gadget) { | 1591 | gadget_for_each_ep(ep, gadget) { |
| 1584 | usb_ep_fifo_flush(ep); | 1592 | usb_ep_fifo_flush(ep); |
| 1585 | } | 1593 | } |
| 1586 | usb_ep_fifo_flush(gadget->ep0); | 1594 | usb_ep_fifo_flush(&udc->ep0out.ep); |
| 1595 | usb_ep_fifo_flush(&udc->ep0in.ep); | ||
| 1587 | 1596 | ||
| 1588 | udc->driver->disconnect(gadget); | 1597 | udc->driver->disconnect(gadget); |
| 1589 | 1598 | ||
| @@ -1591,11 +1600,12 @@ static int _gadget_stop_activity(struct usb_gadget *gadget) | |||
| 1591 | gadget_for_each_ep(ep, gadget) { | 1600 | gadget_for_each_ep(ep, gadget) { |
| 1592 | usb_ep_disable(ep); | 1601 | usb_ep_disable(ep); |
| 1593 | } | 1602 | } |
| 1594 | usb_ep_disable(gadget->ep0); | 1603 | usb_ep_disable(&udc->ep0out.ep); |
| 1604 | usb_ep_disable(&udc->ep0in.ep); | ||
| 1595 | 1605 | ||
| 1596 | if (mEp->status != NULL) { | 1606 | if (udc->status != NULL) { |
| 1597 | usb_ep_free_request(gadget->ep0, mEp->status); | 1607 | usb_ep_free_request(&udc->ep0in.ep, udc->status); |
| 1598 | mEp->status = NULL; | 1608 | udc->status = NULL; |
| 1599 | } | 1609 | } |
| 1600 | 1610 | ||
| 1601 | return 0; | 1611 | return 0; |
| @@ -1614,7 +1624,6 @@ static void isr_reset_handler(struct ci13xxx *udc) | |||
| 1614 | __releases(udc->lock) | 1624 | __releases(udc->lock) |
| 1615 | __acquires(udc->lock) | 1625 | __acquires(udc->lock) |
| 1616 | { | 1626 | { |
| 1617 | struct ci13xxx_ep *mEp = &udc->ci13xxx_ep[0]; | ||
| 1618 | int retval; | 1627 | int retval; |
| 1619 | 1628 | ||
| 1620 | trace("%p", udc); | 1629 | trace("%p", udc); |
| @@ -1635,11 +1644,15 @@ __acquires(udc->lock) | |||
| 1635 | if (retval) | 1644 | if (retval) |
| 1636 | goto done; | 1645 | goto done; |
| 1637 | 1646 | ||
| 1638 | retval = usb_ep_enable(&mEp->ep, &ctrl_endpt_desc); | 1647 | retval = usb_ep_enable(&udc->ep0out.ep, &ctrl_endpt_out_desc); |
| 1648 | if (retval) | ||
| 1649 | goto done; | ||
| 1650 | |||
| 1651 | retval = usb_ep_enable(&udc->ep0in.ep, &ctrl_endpt_in_desc); | ||
| 1639 | if (!retval) { | 1652 | if (!retval) { |
| 1640 | mEp->status = usb_ep_alloc_request(&mEp->ep, GFP_ATOMIC); | 1653 | udc->status = usb_ep_alloc_request(&udc->ep0in.ep, GFP_ATOMIC); |
| 1641 | if (mEp->status == NULL) { | 1654 | if (udc->status == NULL) { |
| 1642 | usb_ep_disable(&mEp->ep); | 1655 | usb_ep_disable(&udc->ep0out.ep); |
| 1643 | retval = -ENOMEM; | 1656 | retval = -ENOMEM; |
| 1644 | } | 1657 | } |
| 1645 | } | 1658 | } |
| @@ -1672,16 +1685,17 @@ static void isr_get_status_complete(struct usb_ep *ep, struct usb_request *req) | |||
| 1672 | 1685 | ||
| 1673 | /** | 1686 | /** |
| 1674 | * isr_get_status_response: get_status request response | 1687 | * isr_get_status_response: get_status request response |
| 1675 | * @ep: endpoint | 1688 | * @udc: udc struct |
| 1676 | * @setup: setup request packet | 1689 | * @setup: setup request packet |
| 1677 | * | 1690 | * |
| 1678 | * This function returns an error code | 1691 | * This function returns an error code |
| 1679 | */ | 1692 | */ |
| 1680 | static int isr_get_status_response(struct ci13xxx_ep *mEp, | 1693 | static int isr_get_status_response(struct ci13xxx *udc, |
| 1681 | struct usb_ctrlrequest *setup) | 1694 | struct usb_ctrlrequest *setup) |
| 1682 | __releases(mEp->lock) | 1695 | __releases(mEp->lock) |
| 1683 | __acquires(mEp->lock) | 1696 | __acquires(mEp->lock) |
| 1684 | { | 1697 | { |
| 1698 | struct ci13xxx_ep *mEp = &udc->ep0in; | ||
| 1685 | struct usb_request *req = NULL; | 1699 | struct usb_request *req = NULL; |
| 1686 | gfp_t gfp_flags = GFP_ATOMIC; | 1700 | gfp_t gfp_flags = GFP_ATOMIC; |
| 1687 | int dir, num, retval; | 1701 | int dir, num, retval; |
| @@ -1736,27 +1750,23 @@ __acquires(mEp->lock) | |||
| 1736 | 1750 | ||
| 1737 | /** | 1751 | /** |
| 1738 | * isr_setup_status_phase: queues the status phase of a setup transation | 1752 | * isr_setup_status_phase: queues the status phase of a setup transation |
| 1739 | * @mEp: endpoint | 1753 | * @udc: udc struct |
| 1740 | * | 1754 | * |
| 1741 | * This function returns an error code | 1755 | * This function returns an error code |
| 1742 | */ | 1756 | */ |
| 1743 | static int isr_setup_status_phase(struct ci13xxx_ep *mEp) | 1757 | static int isr_setup_status_phase(struct ci13xxx *udc) |
| 1744 | __releases(mEp->lock) | 1758 | __releases(mEp->lock) |
| 1745 | __acquires(mEp->lock) | 1759 | __acquires(mEp->lock) |
| 1746 | { | 1760 | { |
| 1747 | int retval; | 1761 | int retval; |
| 1762 | struct ci13xxx_ep *mEp; | ||
| 1748 | 1763 | ||
| 1749 | trace("%p", mEp); | 1764 | trace("%p", udc); |
| 1750 | |||
| 1751 | /* mEp is always valid & configured */ | ||
| 1752 | |||
| 1753 | if (mEp->type == USB_ENDPOINT_XFER_CONTROL) | ||
| 1754 | mEp->dir = (mEp->dir == TX) ? RX : TX; | ||
| 1755 | 1765 | ||
| 1756 | mEp->status->no_interrupt = 1; | 1766 | mEp = (udc->ep0_dir == TX) ? &udc->ep0out : &udc->ep0in; |
| 1757 | 1767 | ||
| 1758 | spin_unlock(mEp->lock); | 1768 | spin_unlock(mEp->lock); |
| 1759 | retval = usb_ep_queue(&mEp->ep, mEp->status, GFP_ATOMIC); | 1769 | retval = usb_ep_queue(&mEp->ep, udc->status, GFP_ATOMIC); |
| 1760 | spin_lock(mEp->lock); | 1770 | spin_lock(mEp->lock); |
| 1761 | 1771 | ||
| 1762 | return retval; | 1772 | return retval; |
| @@ -1778,11 +1788,11 @@ __acquires(mEp->lock) | |||
| 1778 | 1788 | ||
| 1779 | trace("%p", mEp); | 1789 | trace("%p", mEp); |
| 1780 | 1790 | ||
| 1781 | if (list_empty(&mEp->qh[mEp->dir].queue)) | 1791 | if (list_empty(&mEp->qh.queue)) |
| 1782 | return -EINVAL; | 1792 | return -EINVAL; |
| 1783 | 1793 | ||
| 1784 | /* pop oldest request */ | 1794 | /* pop oldest request */ |
| 1785 | mReq = list_entry(mEp->qh[mEp->dir].queue.next, | 1795 | mReq = list_entry(mEp->qh.queue.next, |
| 1786 | struct ci13xxx_req, queue); | 1796 | struct ci13xxx_req, queue); |
| 1787 | list_del_init(&mReq->queue); | 1797 | list_del_init(&mReq->queue); |
| 1788 | 1798 | ||
| @@ -1794,10 +1804,10 @@ __acquires(mEp->lock) | |||
| 1794 | 1804 | ||
| 1795 | dbg_done(_usb_addr(mEp), mReq->ptr->token, retval); | 1805 | dbg_done(_usb_addr(mEp), mReq->ptr->token, retval); |
| 1796 | 1806 | ||
| 1797 | if (!list_empty(&mEp->qh[mEp->dir].queue)) { | 1807 | if (!list_empty(&mEp->qh.queue)) { |
| 1798 | struct ci13xxx_req* mReqEnq; | 1808 | struct ci13xxx_req* mReqEnq; |
| 1799 | 1809 | ||
| 1800 | mReqEnq = list_entry(mEp->qh[mEp->dir].queue.next, | 1810 | mReqEnq = list_entry(mEp->qh.queue.next, |
| 1801 | struct ci13xxx_req, queue); | 1811 | struct ci13xxx_req, queue); |
| 1802 | _hardware_enqueue(mEp, mReqEnq); | 1812 | _hardware_enqueue(mEp, mReqEnq); |
| 1803 | } | 1813 | } |
| @@ -1836,16 +1846,14 @@ __acquires(udc->lock) | |||
| 1836 | int type, num, err = -EINVAL; | 1846 | int type, num, err = -EINVAL; |
| 1837 | struct usb_ctrlrequest req; | 1847 | struct usb_ctrlrequest req; |
| 1838 | 1848 | ||
| 1839 | |||
| 1840 | if (mEp->desc == NULL) | 1849 | if (mEp->desc == NULL) |
| 1841 | continue; /* not configured */ | 1850 | continue; /* not configured */ |
| 1842 | 1851 | ||
| 1843 | if ((mEp->dir == RX && hw_test_and_clear_complete(i)) || | 1852 | if (hw_test_and_clear_complete(i)) { |
| 1844 | (mEp->dir == TX && hw_test_and_clear_complete(i + 16))) { | ||
| 1845 | err = isr_tr_complete_low(mEp); | 1853 | err = isr_tr_complete_low(mEp); |
| 1846 | if (mEp->type == USB_ENDPOINT_XFER_CONTROL) { | 1854 | if (mEp->type == USB_ENDPOINT_XFER_CONTROL) { |
| 1847 | if (err > 0) /* needs status phase */ | 1855 | if (err > 0) /* needs status phase */ |
| 1848 | err = isr_setup_status_phase(mEp); | 1856 | err = isr_setup_status_phase(udc); |
| 1849 | if (err < 0) { | 1857 | if (err < 0) { |
| 1850 | dbg_event(_usb_addr(mEp), | 1858 | dbg_event(_usb_addr(mEp), |
| 1851 | "ERROR", err); | 1859 | "ERROR", err); |
| @@ -1866,15 +1874,22 @@ __acquires(udc->lock) | |||
| 1866 | continue; | 1874 | continue; |
| 1867 | } | 1875 | } |
| 1868 | 1876 | ||
| 1877 | /* | ||
| 1878 | * Flush data and handshake transactions of previous | ||
| 1879 | * setup packet. | ||
| 1880 | */ | ||
| 1881 | _ep_nuke(&udc->ep0out); | ||
| 1882 | _ep_nuke(&udc->ep0in); | ||
| 1883 | |||
| 1869 | /* read_setup_packet */ | 1884 | /* read_setup_packet */ |
| 1870 | do { | 1885 | do { |
| 1871 | hw_test_and_set_setup_guard(); | 1886 | hw_test_and_set_setup_guard(); |
| 1872 | memcpy(&req, &mEp->qh[RX].ptr->setup, sizeof(req)); | 1887 | memcpy(&req, &mEp->qh.ptr->setup, sizeof(req)); |
| 1873 | } while (!hw_test_and_clear_setup_guard()); | 1888 | } while (!hw_test_and_clear_setup_guard()); |
| 1874 | 1889 | ||
| 1875 | type = req.bRequestType; | 1890 | type = req.bRequestType; |
| 1876 | 1891 | ||
| 1877 | mEp->dir = (type & USB_DIR_IN) ? TX : RX; | 1892 | udc->ep0_dir = (type & USB_DIR_IN) ? TX : RX; |
| 1878 | 1893 | ||
| 1879 | dbg_setup(_usb_addr(mEp), &req); | 1894 | dbg_setup(_usb_addr(mEp), &req); |
| 1880 | 1895 | ||
| @@ -1895,7 +1910,7 @@ __acquires(udc->lock) | |||
| 1895 | if (err) | 1910 | if (err) |
| 1896 | break; | 1911 | break; |
| 1897 | } | 1912 | } |
| 1898 | err = isr_setup_status_phase(mEp); | 1913 | err = isr_setup_status_phase(udc); |
| 1899 | break; | 1914 | break; |
| 1900 | case USB_REQ_GET_STATUS: | 1915 | case USB_REQ_GET_STATUS: |
| 1901 | if (type != (USB_DIR_IN|USB_RECIP_DEVICE) && | 1916 | if (type != (USB_DIR_IN|USB_RECIP_DEVICE) && |
| @@ -1905,7 +1920,7 @@ __acquires(udc->lock) | |||
| 1905 | if (le16_to_cpu(req.wLength) != 2 || | 1920 | if (le16_to_cpu(req.wLength) != 2 || |
| 1906 | le16_to_cpu(req.wValue) != 0) | 1921 | le16_to_cpu(req.wValue) != 0) |
| 1907 | break; | 1922 | break; |
| 1908 | err = isr_get_status_response(mEp, &req); | 1923 | err = isr_get_status_response(udc, &req); |
| 1909 | break; | 1924 | break; |
| 1910 | case USB_REQ_SET_ADDRESS: | 1925 | case USB_REQ_SET_ADDRESS: |
| 1911 | if (type != (USB_DIR_OUT|USB_RECIP_DEVICE)) | 1926 | if (type != (USB_DIR_OUT|USB_RECIP_DEVICE)) |
| @@ -1916,7 +1931,7 @@ __acquires(udc->lock) | |||
| 1916 | err = hw_usb_set_address((u8)le16_to_cpu(req.wValue)); | 1931 | err = hw_usb_set_address((u8)le16_to_cpu(req.wValue)); |
| 1917 | if (err) | 1932 | if (err) |
| 1918 | break; | 1933 | break; |
| 1919 | err = isr_setup_status_phase(mEp); | 1934 | err = isr_setup_status_phase(udc); |
| 1920 | break; | 1935 | break; |
| 1921 | case USB_REQ_SET_FEATURE: | 1936 | case USB_REQ_SET_FEATURE: |
| 1922 | if (type != (USB_DIR_OUT|USB_RECIP_ENDPOINT) && | 1937 | if (type != (USB_DIR_OUT|USB_RECIP_ENDPOINT) && |
| @@ -1932,12 +1947,12 @@ __acquires(udc->lock) | |||
| 1932 | spin_lock(udc->lock); | 1947 | spin_lock(udc->lock); |
| 1933 | if (err) | 1948 | if (err) |
| 1934 | break; | 1949 | break; |
| 1935 | err = isr_setup_status_phase(mEp); | 1950 | err = isr_setup_status_phase(udc); |
| 1936 | break; | 1951 | break; |
| 1937 | default: | 1952 | default: |
| 1938 | delegate: | 1953 | delegate: |
| 1939 | if (req.wLength == 0) /* no data phase */ | 1954 | if (req.wLength == 0) /* no data phase */ |
| 1940 | mEp->dir = TX; | 1955 | udc->ep0_dir = TX; |
| 1941 | 1956 | ||
| 1942 | spin_unlock(udc->lock); | 1957 | spin_unlock(udc->lock); |
| 1943 | err = udc->driver->setup(&udc->gadget, &req); | 1958 | err = udc->driver->setup(&udc->gadget, &req); |
| @@ -1968,7 +1983,7 @@ static int ep_enable(struct usb_ep *ep, | |||
| 1968 | const struct usb_endpoint_descriptor *desc) | 1983 | const struct usb_endpoint_descriptor *desc) |
| 1969 | { | 1984 | { |
| 1970 | struct ci13xxx_ep *mEp = container_of(ep, struct ci13xxx_ep, ep); | 1985 | struct ci13xxx_ep *mEp = container_of(ep, struct ci13xxx_ep, ep); |
| 1971 | int direction, retval = 0; | 1986 | int retval = 0; |
| 1972 | unsigned long flags; | 1987 | unsigned long flags; |
| 1973 | 1988 | ||
| 1974 | trace("%p, %p", ep, desc); | 1989 | trace("%p, %p", ep, desc); |
| @@ -1982,7 +1997,7 @@ static int ep_enable(struct usb_ep *ep, | |||
| 1982 | 1997 | ||
| 1983 | mEp->desc = desc; | 1998 | mEp->desc = desc; |
| 1984 | 1999 | ||
| 1985 | if (!list_empty(&mEp->qh[mEp->dir].queue)) | 2000 | if (!list_empty(&mEp->qh.queue)) |
| 1986 | warn("enabling a non-empty endpoint!"); | 2001 | warn("enabling a non-empty endpoint!"); |
| 1987 | 2002 | ||
| 1988 | mEp->dir = usb_endpoint_dir_in(desc) ? TX : RX; | 2003 | mEp->dir = usb_endpoint_dir_in(desc) ? TX : RX; |
| @@ -1991,29 +2006,22 @@ static int ep_enable(struct usb_ep *ep, | |||
| 1991 | 2006 | ||
| 1992 | mEp->ep.maxpacket = __constant_le16_to_cpu(desc->wMaxPacketSize); | 2007 | mEp->ep.maxpacket = __constant_le16_to_cpu(desc->wMaxPacketSize); |
| 1993 | 2008 | ||
| 1994 | direction = mEp->dir; | 2009 | dbg_event(_usb_addr(mEp), "ENABLE", 0); |
| 1995 | do { | ||
| 1996 | dbg_event(_usb_addr(mEp), "ENABLE", 0); | ||
| 1997 | 2010 | ||
| 1998 | mEp->qh[mEp->dir].ptr->cap = 0; | 2011 | mEp->qh.ptr->cap = 0; |
| 1999 | 2012 | ||
| 2000 | if (mEp->type == USB_ENDPOINT_XFER_CONTROL) | 2013 | if (mEp->type == USB_ENDPOINT_XFER_CONTROL) |
| 2001 | mEp->qh[mEp->dir].ptr->cap |= QH_IOS; | 2014 | mEp->qh.ptr->cap |= QH_IOS; |
| 2002 | else if (mEp->type == USB_ENDPOINT_XFER_ISOC) | 2015 | else if (mEp->type == USB_ENDPOINT_XFER_ISOC) |
| 2003 | mEp->qh[mEp->dir].ptr->cap &= ~QH_MULT; | 2016 | mEp->qh.ptr->cap &= ~QH_MULT; |
| 2004 | else | 2017 | else |
| 2005 | mEp->qh[mEp->dir].ptr->cap &= ~QH_ZLT; | 2018 | mEp->qh.ptr->cap &= ~QH_ZLT; |
| 2006 | |||
| 2007 | mEp->qh[mEp->dir].ptr->cap |= | ||
| 2008 | (mEp->ep.maxpacket << ffs_nr(QH_MAX_PKT)) & QH_MAX_PKT; | ||
| 2009 | mEp->qh[mEp->dir].ptr->td.next |= TD_TERMINATE; /* needed? */ | ||
| 2010 | |||
| 2011 | retval |= hw_ep_enable(mEp->num, mEp->dir, mEp->type); | ||
| 2012 | 2019 | ||
| 2013 | if (mEp->type == USB_ENDPOINT_XFER_CONTROL) | 2020 | mEp->qh.ptr->cap |= |
| 2014 | mEp->dir = (mEp->dir == TX) ? RX : TX; | 2021 | (mEp->ep.maxpacket << ffs_nr(QH_MAX_PKT)) & QH_MAX_PKT; |
| 2022 | mEp->qh.ptr->td.next |= TD_TERMINATE; /* needed? */ | ||
| 2015 | 2023 | ||
| 2016 | } while (mEp->dir != direction); | 2024 | retval |= hw_ep_enable(mEp->num, mEp->dir, mEp->type); |
| 2017 | 2025 | ||
| 2018 | spin_unlock_irqrestore(mEp->lock, flags); | 2026 | spin_unlock_irqrestore(mEp->lock, flags); |
| 2019 | return retval; | 2027 | return retval; |
| @@ -2146,7 +2154,7 @@ static int ep_queue(struct usb_ep *ep, struct usb_request *req, | |||
| 2146 | spin_lock_irqsave(mEp->lock, flags); | 2154 | spin_lock_irqsave(mEp->lock, flags); |
| 2147 | 2155 | ||
| 2148 | if (mEp->type == USB_ENDPOINT_XFER_CONTROL && | 2156 | if (mEp->type == USB_ENDPOINT_XFER_CONTROL && |
| 2149 | !list_empty(&mEp->qh[mEp->dir].queue)) { | 2157 | !list_empty(&mEp->qh.queue)) { |
| 2150 | _ep_nuke(mEp); | 2158 | _ep_nuke(mEp); |
| 2151 | retval = -EOVERFLOW; | 2159 | retval = -EOVERFLOW; |
| 2152 | warn("endpoint ctrl %X nuked", _usb_addr(mEp)); | 2160 | warn("endpoint ctrl %X nuked", _usb_addr(mEp)); |
| @@ -2170,9 +2178,9 @@ static int ep_queue(struct usb_ep *ep, struct usb_request *req, | |||
| 2170 | /* push request */ | 2178 | /* push request */ |
| 2171 | mReq->req.status = -EINPROGRESS; | 2179 | mReq->req.status = -EINPROGRESS; |
| 2172 | mReq->req.actual = 0; | 2180 | mReq->req.actual = 0; |
| 2173 | list_add_tail(&mReq->queue, &mEp->qh[mEp->dir].queue); | 2181 | list_add_tail(&mReq->queue, &mEp->qh.queue); |
| 2174 | 2182 | ||
| 2175 | if (list_is_singular(&mEp->qh[mEp->dir].queue)) | 2183 | if (list_is_singular(&mEp->qh.queue)) |
| 2176 | retval = _hardware_enqueue(mEp, mReq); | 2184 | retval = _hardware_enqueue(mEp, mReq); |
| 2177 | 2185 | ||
| 2178 | if (retval == -EALREADY) { | 2186 | if (retval == -EALREADY) { |
| @@ -2199,7 +2207,7 @@ static int ep_dequeue(struct usb_ep *ep, struct usb_request *req) | |||
| 2199 | trace("%p, %p", ep, req); | 2207 | trace("%p, %p", ep, req); |
| 2200 | 2208 | ||
| 2201 | if (ep == NULL || req == NULL || mEp->desc == NULL || | 2209 | if (ep == NULL || req == NULL || mEp->desc == NULL || |
| 2202 | list_empty(&mReq->queue) || list_empty(&mEp->qh[mEp->dir].queue)) | 2210 | list_empty(&mReq->queue) || list_empty(&mEp->qh.queue)) |
| 2203 | return -EINVAL; | 2211 | return -EINVAL; |
| 2204 | 2212 | ||
| 2205 | spin_lock_irqsave(mEp->lock, flags); | 2213 | spin_lock_irqsave(mEp->lock, flags); |
| @@ -2244,7 +2252,7 @@ static int ep_set_halt(struct usb_ep *ep, int value) | |||
| 2244 | #ifndef STALL_IN | 2252 | #ifndef STALL_IN |
| 2245 | /* g_file_storage MS compliant but g_zero fails chapter 9 compliance */ | 2253 | /* g_file_storage MS compliant but g_zero fails chapter 9 compliance */ |
| 2246 | if (value && mEp->type == USB_ENDPOINT_XFER_BULK && mEp->dir == TX && | 2254 | if (value && mEp->type == USB_ENDPOINT_XFER_BULK && mEp->dir == TX && |
| 2247 | !list_empty(&mEp->qh[mEp->dir].queue)) { | 2255 | !list_empty(&mEp->qh.queue)) { |
| 2248 | spin_unlock_irqrestore(mEp->lock, flags); | 2256 | spin_unlock_irqrestore(mEp->lock, flags); |
| 2249 | return -EAGAIN; | 2257 | return -EAGAIN; |
| 2250 | } | 2258 | } |
| @@ -2355,7 +2363,7 @@ static int ci13xxx_vbus_session(struct usb_gadget *_gadget, int is_active) | |||
| 2355 | if (is_active) { | 2363 | if (is_active) { |
| 2356 | pm_runtime_get_sync(&_gadget->dev); | 2364 | pm_runtime_get_sync(&_gadget->dev); |
| 2357 | hw_device_reset(udc); | 2365 | hw_device_reset(udc); |
| 2358 | hw_device_state(udc->ci13xxx_ep[0].qh[RX].dma); | 2366 | hw_device_state(udc->ep0out.qh.dma); |
| 2359 | } else { | 2367 | } else { |
| 2360 | hw_device_state(0); | 2368 | hw_device_state(0); |
| 2361 | if (udc->udc_driver->notify_event) | 2369 | if (udc->udc_driver->notify_event) |
| @@ -2390,7 +2398,8 @@ int usb_gadget_probe_driver(struct usb_gadget_driver *driver, | |||
| 2390 | int (*bind)(struct usb_gadget *)) | 2398 | int (*bind)(struct usb_gadget *)) |
| 2391 | { | 2399 | { |
| 2392 | struct ci13xxx *udc = _udc; | 2400 | struct ci13xxx *udc = _udc; |
| 2393 | unsigned long i, k, flags; | 2401 | unsigned long flags; |
| 2402 | int i, j; | ||
| 2394 | int retval = -ENOMEM; | 2403 | int retval = -ENOMEM; |
| 2395 | 2404 | ||
| 2396 | trace("%p", driver); | 2405 | trace("%p", driver); |
| @@ -2427,45 +2436,46 @@ int usb_gadget_probe_driver(struct usb_gadget_driver *driver, | |||
| 2427 | 2436 | ||
| 2428 | info("hw_ep_max = %d", hw_ep_max); | 2437 | info("hw_ep_max = %d", hw_ep_max); |
| 2429 | 2438 | ||
| 2430 | udc->driver = driver; | ||
| 2431 | udc->gadget.dev.driver = NULL; | 2439 | udc->gadget.dev.driver = NULL; |
| 2432 | 2440 | ||
| 2433 | retval = 0; | 2441 | retval = 0; |
| 2434 | for (i = 0; i < hw_ep_max; i++) { | 2442 | for (i = 0; i < hw_ep_max/2; i++) { |
| 2435 | struct ci13xxx_ep *mEp = &udc->ci13xxx_ep[i]; | 2443 | for (j = RX; j <= TX; j++) { |
| 2444 | int k = i + j * hw_ep_max/2; | ||
| 2445 | struct ci13xxx_ep *mEp = &udc->ci13xxx_ep[k]; | ||
| 2436 | 2446 | ||
| 2437 | scnprintf(mEp->name, sizeof(mEp->name), "ep%i", (int)i); | 2447 | scnprintf(mEp->name, sizeof(mEp->name), "ep%i%s", i, |
| 2448 | (j == TX) ? "in" : "out"); | ||
| 2438 | 2449 | ||
| 2439 | mEp->lock = udc->lock; | 2450 | mEp->lock = udc->lock; |
| 2440 | mEp->device = &udc->gadget.dev; | 2451 | mEp->device = &udc->gadget.dev; |
| 2441 | mEp->td_pool = udc->td_pool; | 2452 | mEp->td_pool = udc->td_pool; |
| 2442 | 2453 | ||
| 2443 | mEp->ep.name = mEp->name; | 2454 | mEp->ep.name = mEp->name; |
| 2444 | mEp->ep.ops = &usb_ep_ops; | 2455 | mEp->ep.ops = &usb_ep_ops; |
| 2445 | mEp->ep.maxpacket = CTRL_PAYLOAD_MAX; | 2456 | mEp->ep.maxpacket = CTRL_PAYLOAD_MAX; |
| 2446 | 2457 | ||
| 2447 | /* this allocation cannot be random */ | 2458 | INIT_LIST_HEAD(&mEp->qh.queue); |
| 2448 | for (k = RX; k <= TX; k++) { | ||
| 2449 | INIT_LIST_HEAD(&mEp->qh[k].queue); | ||
| 2450 | spin_unlock_irqrestore(udc->lock, flags); | 2459 | spin_unlock_irqrestore(udc->lock, flags); |
| 2451 | mEp->qh[k].ptr = dma_pool_alloc(udc->qh_pool, | 2460 | mEp->qh.ptr = dma_pool_alloc(udc->qh_pool, GFP_KERNEL, |
| 2452 | GFP_KERNEL, | 2461 | &mEp->qh.dma); |
| 2453 | &mEp->qh[k].dma); | ||
| 2454 | spin_lock_irqsave(udc->lock, flags); | 2462 | spin_lock_irqsave(udc->lock, flags); |
| 2455 | if (mEp->qh[k].ptr == NULL) | 2463 | if (mEp->qh.ptr == NULL) |
| 2456 | retval = -ENOMEM; | 2464 | retval = -ENOMEM; |
| 2457 | else | 2465 | else |
| 2458 | memset(mEp->qh[k].ptr, 0, | 2466 | memset(mEp->qh.ptr, 0, sizeof(*mEp->qh.ptr)); |
| 2459 | sizeof(*mEp->qh[k].ptr)); | 2467 | |
| 2460 | } | 2468 | /* skip ep0 out and in endpoints */ |
| 2461 | if (i == 0) | 2469 | if (i == 0) |
| 2462 | udc->gadget.ep0 = &mEp->ep; | 2470 | continue; |
| 2463 | else | 2471 | |
| 2464 | list_add_tail(&mEp->ep.ep_list, &udc->gadget.ep_list); | 2472 | list_add_tail(&mEp->ep.ep_list, &udc->gadget.ep_list); |
| 2473 | } | ||
| 2465 | } | 2474 | } |
| 2466 | if (retval) | 2475 | if (retval) |
| 2467 | goto done; | 2476 | goto done; |
| 2468 | 2477 | ||
| 2478 | udc->gadget.ep0 = &udc->ep0in.ep; | ||
| 2469 | /* bind gadget */ | 2479 | /* bind gadget */ |
| 2470 | driver->driver.bus = NULL; | 2480 | driver->driver.bus = NULL; |
| 2471 | udc->gadget.dev.driver = &driver->driver; | 2481 | udc->gadget.dev.driver = &driver->driver; |
| @@ -2479,6 +2489,7 @@ int usb_gadget_probe_driver(struct usb_gadget_driver *driver, | |||
| 2479 | goto done; | 2489 | goto done; |
| 2480 | } | 2490 | } |
| 2481 | 2491 | ||
| 2492 | udc->driver = driver; | ||
| 2482 | pm_runtime_get_sync(&udc->gadget.dev); | 2493 | pm_runtime_get_sync(&udc->gadget.dev); |
| 2483 | if (udc->udc_driver->flags & CI13XXX_PULLUP_ON_VBUS) { | 2494 | if (udc->udc_driver->flags & CI13XXX_PULLUP_ON_VBUS) { |
| 2484 | if (udc->vbus_active) { | 2495 | if (udc->vbus_active) { |
| @@ -2490,14 +2501,12 @@ int usb_gadget_probe_driver(struct usb_gadget_driver *driver, | |||
| 2490 | } | 2501 | } |
| 2491 | } | 2502 | } |
| 2492 | 2503 | ||
| 2493 | retval = hw_device_state(udc->ci13xxx_ep[0].qh[RX].dma); | 2504 | retval = hw_device_state(udc->ep0out.qh.dma); |
| 2494 | if (retval) | 2505 | if (retval) |
| 2495 | pm_runtime_put_sync(&udc->gadget.dev); | 2506 | pm_runtime_put_sync(&udc->gadget.dev); |
| 2496 | 2507 | ||
| 2497 | done: | 2508 | done: |
| 2498 | spin_unlock_irqrestore(udc->lock, flags); | 2509 | spin_unlock_irqrestore(udc->lock, flags); |
| 2499 | if (retval) | ||
| 2500 | usb_gadget_unregister_driver(driver); | ||
| 2501 | return retval; | 2510 | return retval; |
| 2502 | } | 2511 | } |
| 2503 | EXPORT_SYMBOL(usb_gadget_probe_driver); | 2512 | EXPORT_SYMBOL(usb_gadget_probe_driver); |
| @@ -2510,7 +2519,7 @@ EXPORT_SYMBOL(usb_gadget_probe_driver); | |||
| 2510 | int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) | 2519 | int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) |
| 2511 | { | 2520 | { |
| 2512 | struct ci13xxx *udc = _udc; | 2521 | struct ci13xxx *udc = _udc; |
| 2513 | unsigned long i, k, flags; | 2522 | unsigned long i, flags; |
| 2514 | 2523 | ||
| 2515 | trace("%p", driver); | 2524 | trace("%p", driver); |
| 2516 | 2525 | ||
| @@ -2546,17 +2555,14 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) | |||
| 2546 | for (i = 0; i < hw_ep_max; i++) { | 2555 | for (i = 0; i < hw_ep_max; i++) { |
| 2547 | struct ci13xxx_ep *mEp = &udc->ci13xxx_ep[i]; | 2556 | struct ci13xxx_ep *mEp = &udc->ci13xxx_ep[i]; |
| 2548 | 2557 | ||
| 2549 | if (i == 0) | 2558 | if (!list_empty(&mEp->ep.ep_list)) |
| 2550 | udc->gadget.ep0 = NULL; | ||
| 2551 | else if (!list_empty(&mEp->ep.ep_list)) | ||
| 2552 | list_del_init(&mEp->ep.ep_list); | 2559 | list_del_init(&mEp->ep.ep_list); |
| 2553 | 2560 | ||
| 2554 | for (k = RX; k <= TX; k++) | 2561 | if (mEp->qh.ptr != NULL) |
| 2555 | if (mEp->qh[k].ptr != NULL) | 2562 | dma_pool_free(udc->qh_pool, mEp->qh.ptr, mEp->qh.dma); |
| 2556 | dma_pool_free(udc->qh_pool, | ||
| 2557 | mEp->qh[k].ptr, mEp->qh[k].dma); | ||
| 2558 | } | 2563 | } |
| 2559 | 2564 | ||
| 2565 | udc->gadget.ep0 = NULL; | ||
| 2560 | udc->driver = NULL; | 2566 | udc->driver = NULL; |
| 2561 | 2567 | ||
| 2562 | spin_unlock_irqrestore(udc->lock, flags); | 2568 | spin_unlock_irqrestore(udc->lock, flags); |
diff --git a/drivers/usb/gadget/ci13xxx_udc.h b/drivers/usb/gadget/ci13xxx_udc.h index f61fed07f76..a2492b65f98 100644 --- a/drivers/usb/gadget/ci13xxx_udc.h +++ b/drivers/usb/gadget/ci13xxx_udc.h | |||
| @@ -20,7 +20,7 @@ | |||
| 20 | * DEFINE | 20 | * DEFINE |
| 21 | *****************************************************************************/ | 21 | *****************************************************************************/ |
| 22 | #define CI13XXX_PAGE_SIZE 4096ul /* page size for TD's */ | 22 | #define CI13XXX_PAGE_SIZE 4096ul /* page size for TD's */ |
| 23 | #define ENDPT_MAX (16) | 23 | #define ENDPT_MAX (32) |
| 24 | #define CTRL_PAYLOAD_MAX (64) | 24 | #define CTRL_PAYLOAD_MAX (64) |
| 25 | #define RX (0) /* similar to USB_DIR_OUT but can be used as an index */ | 25 | #define RX (0) /* similar to USB_DIR_OUT but can be used as an index */ |
| 26 | #define TX (1) /* similar to USB_DIR_IN but can be used as an index */ | 26 | #define TX (1) /* similar to USB_DIR_IN but can be used as an index */ |
| @@ -88,8 +88,7 @@ struct ci13xxx_ep { | |||
| 88 | struct list_head queue; | 88 | struct list_head queue; |
| 89 | struct ci13xxx_qh *ptr; | 89 | struct ci13xxx_qh *ptr; |
| 90 | dma_addr_t dma; | 90 | dma_addr_t dma; |
| 91 | } qh[2]; | 91 | } qh; |
| 92 | struct usb_request *status; | ||
| 93 | int wedge; | 92 | int wedge; |
| 94 | 93 | ||
| 95 | /* global resources */ | 94 | /* global resources */ |
| @@ -119,9 +118,13 @@ struct ci13xxx { | |||
| 119 | 118 | ||
| 120 | struct dma_pool *qh_pool; /* DMA pool for queue heads */ | 119 | struct dma_pool *qh_pool; /* DMA pool for queue heads */ |
| 121 | struct dma_pool *td_pool; /* DMA pool for transfer descs */ | 120 | struct dma_pool *td_pool; /* DMA pool for transfer descs */ |
| 121 | struct usb_request *status; /* ep0 status request */ | ||
| 122 | 122 | ||
| 123 | struct usb_gadget gadget; /* USB slave device */ | 123 | struct usb_gadget gadget; /* USB slave device */ |
| 124 | struct ci13xxx_ep ci13xxx_ep[ENDPT_MAX]; /* extended endpts */ | 124 | struct ci13xxx_ep ci13xxx_ep[ENDPT_MAX]; /* extended endpts */ |
| 125 | u32 ep0_dir; /* ep0 direction */ | ||
| 126 | #define ep0out ci13xxx_ep[0] | ||
| 127 | #define ep0in ci13xxx_ep[16] | ||
| 125 | 128 | ||
| 126 | struct usb_gadget_driver *driver; /* 3rd party gadget driver */ | 129 | struct usb_gadget_driver *driver; /* 3rd party gadget driver */ |
| 127 | struct ci13xxx_udc_driver *udc_driver; /* device controller driver */ | 130 | struct ci13xxx_udc_driver *udc_driver; /* device controller driver */ |
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index f6ff8456d52..1ba4befe336 100644 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c | |||
| @@ -928,8 +928,9 @@ unknown: | |||
| 928 | */ | 928 | */ |
| 929 | switch (ctrl->bRequestType & USB_RECIP_MASK) { | 929 | switch (ctrl->bRequestType & USB_RECIP_MASK) { |
| 930 | case USB_RECIP_INTERFACE: | 930 | case USB_RECIP_INTERFACE: |
| 931 | if (cdev->config) | 931 | if (!cdev->config || w_index >= MAX_CONFIG_INTERFACES) |
| 932 | f = cdev->config->interface[intf]; | 932 | break; |
| 933 | f = cdev->config->interface[intf]; | ||
| 933 | break; | 934 | break; |
| 934 | 935 | ||
| 935 | case USB_RECIP_ENDPOINT: | 936 | case USB_RECIP_ENDPOINT: |
diff --git a/drivers/usb/gadget/pch_udc.c b/drivers/usb/gadget/pch_udc.c index 0c8dd81dddc..b120dbb64d0 100644 --- a/drivers/usb/gadget/pch_udc.c +++ b/drivers/usb/gadget/pch_udc.c | |||
| @@ -198,10 +198,10 @@ | |||
| 198 | #define PCH_UDC_BRLEN 0x0F /* Burst length */ | 198 | #define PCH_UDC_BRLEN 0x0F /* Burst length */ |
| 199 | #define PCH_UDC_THLEN 0x1F /* Threshold length */ | 199 | #define PCH_UDC_THLEN 0x1F /* Threshold length */ |
| 200 | /* Value of EP Buffer Size */ | 200 | /* Value of EP Buffer Size */ |
| 201 | #define UDC_EP0IN_BUFF_SIZE 64 | 201 | #define UDC_EP0IN_BUFF_SIZE 16 |
| 202 | #define UDC_EPIN_BUFF_SIZE 512 | 202 | #define UDC_EPIN_BUFF_SIZE 256 |
| 203 | #define UDC_EP0OUT_BUFF_SIZE 64 | 203 | #define UDC_EP0OUT_BUFF_SIZE 16 |
| 204 | #define UDC_EPOUT_BUFF_SIZE 512 | 204 | #define UDC_EPOUT_BUFF_SIZE 256 |
| 205 | /* Value of EP maximum packet size */ | 205 | /* Value of EP maximum packet size */ |
| 206 | #define UDC_EP0IN_MAX_PKT_SIZE 64 | 206 | #define UDC_EP0IN_MAX_PKT_SIZE 64 |
| 207 | #define UDC_EP0OUT_MAX_PKT_SIZE 64 | 207 | #define UDC_EP0OUT_MAX_PKT_SIZE 64 |
| @@ -351,7 +351,7 @@ struct pch_udc_dev { | |||
| 351 | struct pci_pool *data_requests; | 351 | struct pci_pool *data_requests; |
| 352 | struct pci_pool *stp_requests; | 352 | struct pci_pool *stp_requests; |
| 353 | dma_addr_t dma_addr; | 353 | dma_addr_t dma_addr; |
| 354 | unsigned long ep0out_buf[64]; | 354 | void *ep0out_buf; |
| 355 | struct usb_ctrlrequest setup_data; | 355 | struct usb_ctrlrequest setup_data; |
| 356 | unsigned long phys_addr; | 356 | unsigned long phys_addr; |
| 357 | void __iomem *base_addr; | 357 | void __iomem *base_addr; |
| @@ -361,6 +361,8 @@ struct pch_udc_dev { | |||
| 361 | 361 | ||
| 362 | #define PCH_UDC_PCI_BAR 1 | 362 | #define PCH_UDC_PCI_BAR 1 |
| 363 | #define PCI_DEVICE_ID_INTEL_EG20T_UDC 0x8808 | 363 | #define PCI_DEVICE_ID_INTEL_EG20T_UDC 0x8808 |
| 364 | #define PCI_VENDOR_ID_ROHM 0x10DB | ||
| 365 | #define PCI_DEVICE_ID_ML7213_IOH_UDC 0x801D | ||
| 364 | 366 | ||
| 365 | static const char ep0_string[] = "ep0in"; | 367 | static const char ep0_string[] = "ep0in"; |
| 366 | static DEFINE_SPINLOCK(udc_stall_spinlock); /* stall spin lock */ | 368 | static DEFINE_SPINLOCK(udc_stall_spinlock); /* stall spin lock */ |
| @@ -1219,11 +1221,11 @@ static void complete_req(struct pch_udc_ep *ep, struct pch_udc_request *req, | |||
| 1219 | dev = ep->dev; | 1221 | dev = ep->dev; |
| 1220 | if (req->dma_mapped) { | 1222 | if (req->dma_mapped) { |
| 1221 | if (ep->in) | 1223 | if (ep->in) |
| 1222 | pci_unmap_single(dev->pdev, req->req.dma, | 1224 | dma_unmap_single(&dev->pdev->dev, req->req.dma, |
| 1223 | req->req.length, PCI_DMA_TODEVICE); | 1225 | req->req.length, DMA_TO_DEVICE); |
| 1224 | else | 1226 | else |
| 1225 | pci_unmap_single(dev->pdev, req->req.dma, | 1227 | dma_unmap_single(&dev->pdev->dev, req->req.dma, |
| 1226 | req->req.length, PCI_DMA_FROMDEVICE); | 1228 | req->req.length, DMA_FROM_DEVICE); |
| 1227 | req->dma_mapped = 0; | 1229 | req->dma_mapped = 0; |
| 1228 | req->req.dma = DMA_ADDR_INVALID; | 1230 | req->req.dma = DMA_ADDR_INVALID; |
| 1229 | } | 1231 | } |
| @@ -1414,7 +1416,6 @@ static void pch_udc_start_rxrequest(struct pch_udc_ep *ep, | |||
| 1414 | 1416 | ||
| 1415 | pch_udc_clear_dma(ep->dev, DMA_DIR_RX); | 1417 | pch_udc_clear_dma(ep->dev, DMA_DIR_RX); |
| 1416 | td_data = req->td_data; | 1418 | td_data = req->td_data; |
| 1417 | ep->td_data = req->td_data; | ||
| 1418 | /* Set the status bits for all descriptors */ | 1419 | /* Set the status bits for all descriptors */ |
| 1419 | while (1) { | 1420 | while (1) { |
| 1420 | td_data->status = (td_data->status & ~PCH_UDC_BUFF_STS) | | 1421 | td_data->status = (td_data->status & ~PCH_UDC_BUFF_STS) | |
| @@ -1613,15 +1614,19 @@ static int pch_udc_pcd_queue(struct usb_ep *usbep, struct usb_request *usbreq, | |||
| 1613 | if (usbreq->length && | 1614 | if (usbreq->length && |
| 1614 | ((usbreq->dma == DMA_ADDR_INVALID) || !usbreq->dma)) { | 1615 | ((usbreq->dma == DMA_ADDR_INVALID) || !usbreq->dma)) { |
| 1615 | if (ep->in) | 1616 | if (ep->in) |
| 1616 | usbreq->dma = pci_map_single(dev->pdev, usbreq->buf, | 1617 | usbreq->dma = dma_map_single(&dev->pdev->dev, |
| 1617 | usbreq->length, PCI_DMA_TODEVICE); | 1618 | usbreq->buf, |
| 1619 | usbreq->length, | ||
| 1620 | DMA_TO_DEVICE); | ||
| 1618 | else | 1621 | else |
| 1619 | usbreq->dma = pci_map_single(dev->pdev, usbreq->buf, | 1622 | usbreq->dma = dma_map_single(&dev->pdev->dev, |
| 1620 | usbreq->length, PCI_DMA_FROMDEVICE); | 1623 | usbreq->buf, |
| 1624 | usbreq->length, | ||
| 1625 | DMA_FROM_DEVICE); | ||
| 1621 | req->dma_mapped = 1; | 1626 | req->dma_mapped = 1; |
| 1622 | } | 1627 | } |
| 1623 | if (usbreq->length > 0) { | 1628 | if (usbreq->length > 0) { |
| 1624 | retval = prepare_dma(ep, req, gfp); | 1629 | retval = prepare_dma(ep, req, GFP_ATOMIC); |
| 1625 | if (retval) | 1630 | if (retval) |
| 1626 | goto probe_end; | 1631 | goto probe_end; |
| 1627 | } | 1632 | } |
| @@ -1646,7 +1651,6 @@ static int pch_udc_pcd_queue(struct usb_ep *usbep, struct usb_request *usbreq, | |||
| 1646 | pch_udc_wait_ep_stall(ep); | 1651 | pch_udc_wait_ep_stall(ep); |
| 1647 | pch_udc_ep_clear_nak(ep); | 1652 | pch_udc_ep_clear_nak(ep); |
| 1648 | pch_udc_enable_ep_interrupts(ep->dev, (1 << ep->num)); | 1653 | pch_udc_enable_ep_interrupts(ep->dev, (1 << ep->num)); |
| 1649 | pch_udc_set_dma(dev, DMA_DIR_TX); | ||
| 1650 | } | 1654 | } |
| 1651 | } | 1655 | } |
| 1652 | /* Now add this request to the ep's pending requests */ | 1656 | /* Now add this request to the ep's pending requests */ |
| @@ -1926,6 +1930,7 @@ static void pch_udc_complete_receiver(struct pch_udc_ep *ep) | |||
| 1926 | PCH_UDC_BS_DMA_DONE) | 1930 | PCH_UDC_BS_DMA_DONE) |
| 1927 | return; | 1931 | return; |
| 1928 | pch_udc_clear_dma(ep->dev, DMA_DIR_RX); | 1932 | pch_udc_clear_dma(ep->dev, DMA_DIR_RX); |
| 1933 | pch_udc_ep_set_ddptr(ep, 0); | ||
| 1929 | if ((req->td_data_last->status & PCH_UDC_RXTX_STS) != | 1934 | if ((req->td_data_last->status & PCH_UDC_RXTX_STS) != |
| 1930 | PCH_UDC_RTS_SUCC) { | 1935 | PCH_UDC_RTS_SUCC) { |
| 1931 | dev_err(&dev->pdev->dev, "Invalid RXTX status (0x%08x) " | 1936 | dev_err(&dev->pdev->dev, "Invalid RXTX status (0x%08x) " |
| @@ -1963,7 +1968,7 @@ static void pch_udc_svc_data_in(struct pch_udc_dev *dev, int ep_num) | |||
| 1963 | u32 epsts; | 1968 | u32 epsts; |
| 1964 | struct pch_udc_ep *ep; | 1969 | struct pch_udc_ep *ep; |
| 1965 | 1970 | ||
| 1966 | ep = &dev->ep[2*ep_num]; | 1971 | ep = &dev->ep[UDC_EPIN_IDX(ep_num)]; |
| 1967 | epsts = ep->epsts; | 1972 | epsts = ep->epsts; |
| 1968 | ep->epsts = 0; | 1973 | ep->epsts = 0; |
| 1969 | 1974 | ||
| @@ -2008,7 +2013,7 @@ static void pch_udc_svc_data_out(struct pch_udc_dev *dev, int ep_num) | |||
| 2008 | struct pch_udc_ep *ep; | 2013 | struct pch_udc_ep *ep; |
| 2009 | struct pch_udc_request *req = NULL; | 2014 | struct pch_udc_request *req = NULL; |
| 2010 | 2015 | ||
| 2011 | ep = &dev->ep[2*ep_num + 1]; | 2016 | ep = &dev->ep[UDC_EPOUT_IDX(ep_num)]; |
| 2012 | epsts = ep->epsts; | 2017 | epsts = ep->epsts; |
| 2013 | ep->epsts = 0; | 2018 | ep->epsts = 0; |
| 2014 | 2019 | ||
| @@ -2025,10 +2030,11 @@ static void pch_udc_svc_data_out(struct pch_udc_dev *dev, int ep_num) | |||
| 2025 | } | 2030 | } |
| 2026 | if (epsts & UDC_EPSTS_HE) | 2031 | if (epsts & UDC_EPSTS_HE) |
| 2027 | return; | 2032 | return; |
| 2028 | if (epsts & UDC_EPSTS_RSS) | 2033 | if (epsts & UDC_EPSTS_RSS) { |
| 2029 | pch_udc_ep_set_stall(ep); | 2034 | pch_udc_ep_set_stall(ep); |
| 2030 | pch_udc_enable_ep_interrupts(ep->dev, | 2035 | pch_udc_enable_ep_interrupts(ep->dev, |
| 2031 | PCH_UDC_EPINT(ep->in, ep->num)); | 2036 | PCH_UDC_EPINT(ep->in, ep->num)); |
| 2037 | } | ||
| 2032 | if (epsts & UDC_EPSTS_RCS) { | 2038 | if (epsts & UDC_EPSTS_RCS) { |
| 2033 | if (!dev->prot_stall) { | 2039 | if (!dev->prot_stall) { |
| 2034 | pch_udc_ep_clear_stall(ep); | 2040 | pch_udc_ep_clear_stall(ep); |
| @@ -2060,8 +2066,10 @@ static void pch_udc_svc_control_in(struct pch_udc_dev *dev) | |||
| 2060 | { | 2066 | { |
| 2061 | u32 epsts; | 2067 | u32 epsts; |
| 2062 | struct pch_udc_ep *ep; | 2068 | struct pch_udc_ep *ep; |
| 2069 | struct pch_udc_ep *ep_out; | ||
| 2063 | 2070 | ||
| 2064 | ep = &dev->ep[UDC_EP0IN_IDX]; | 2071 | ep = &dev->ep[UDC_EP0IN_IDX]; |
| 2072 | ep_out = &dev->ep[UDC_EP0OUT_IDX]; | ||
| 2065 | epsts = ep->epsts; | 2073 | epsts = ep->epsts; |
| 2066 | ep->epsts = 0; | 2074 | ep->epsts = 0; |
| 2067 | 2075 | ||
| @@ -2073,8 +2081,16 @@ static void pch_udc_svc_control_in(struct pch_udc_dev *dev) | |||
| 2073 | return; | 2081 | return; |
| 2074 | if (epsts & UDC_EPSTS_HE) | 2082 | if (epsts & UDC_EPSTS_HE) |
| 2075 | return; | 2083 | return; |
| 2076 | if ((epsts & UDC_EPSTS_TDC) && (!dev->stall)) | 2084 | if ((epsts & UDC_EPSTS_TDC) && (!dev->stall)) { |
| 2077 | pch_udc_complete_transfer(ep); | 2085 | pch_udc_complete_transfer(ep); |
| 2086 | pch_udc_clear_dma(dev, DMA_DIR_RX); | ||
| 2087 | ep_out->td_data->status = (ep_out->td_data->status & | ||
| 2088 | ~PCH_UDC_BUFF_STS) | | ||
| 2089 | PCH_UDC_BS_HST_RDY; | ||
| 2090 | pch_udc_ep_clear_nak(ep_out); | ||
| 2091 | pch_udc_set_dma(dev, DMA_DIR_RX); | ||
| 2092 | pch_udc_ep_set_rrdy(ep_out); | ||
| 2093 | } | ||
| 2078 | /* On IN interrupt, provide data if we have any */ | 2094 | /* On IN interrupt, provide data if we have any */ |
| 2079 | if ((epsts & UDC_EPSTS_IN) && !(epsts & UDC_EPSTS_TDC) && | 2095 | if ((epsts & UDC_EPSTS_IN) && !(epsts & UDC_EPSTS_TDC) && |
| 2080 | !(epsts & UDC_EPSTS_TXEMPTY)) | 2096 | !(epsts & UDC_EPSTS_TXEMPTY)) |
| @@ -2102,11 +2118,9 @@ static void pch_udc_svc_control_out(struct pch_udc_dev *dev) | |||
| 2102 | dev->stall = 0; | 2118 | dev->stall = 0; |
| 2103 | dev->ep[UDC_EP0IN_IDX].halted = 0; | 2119 | dev->ep[UDC_EP0IN_IDX].halted = 0; |
| 2104 | dev->ep[UDC_EP0OUT_IDX].halted = 0; | 2120 | dev->ep[UDC_EP0OUT_IDX].halted = 0; |
| 2105 | /* In data not ready */ | ||
| 2106 | pch_udc_ep_set_nak(&(dev->ep[UDC_EP0IN_IDX])); | ||
| 2107 | dev->setup_data = ep->td_stp->request; | 2121 | dev->setup_data = ep->td_stp->request; |
| 2108 | pch_udc_init_setup_buff(ep->td_stp); | 2122 | pch_udc_init_setup_buff(ep->td_stp); |
| 2109 | pch_udc_clear_dma(dev, DMA_DIR_TX); | 2123 | pch_udc_clear_dma(dev, DMA_DIR_RX); |
| 2110 | pch_udc_ep_fifo_flush(&(dev->ep[UDC_EP0IN_IDX]), | 2124 | pch_udc_ep_fifo_flush(&(dev->ep[UDC_EP0IN_IDX]), |
| 2111 | dev->ep[UDC_EP0IN_IDX].in); | 2125 | dev->ep[UDC_EP0IN_IDX].in); |
| 2112 | if ((dev->setup_data.bRequestType & USB_DIR_IN)) | 2126 | if ((dev->setup_data.bRequestType & USB_DIR_IN)) |
| @@ -2122,14 +2136,23 @@ static void pch_udc_svc_control_out(struct pch_udc_dev *dev) | |||
| 2122 | setup_supported = dev->driver->setup(&dev->gadget, | 2136 | setup_supported = dev->driver->setup(&dev->gadget, |
| 2123 | &dev->setup_data); | 2137 | &dev->setup_data); |
| 2124 | spin_lock(&dev->lock); | 2138 | spin_lock(&dev->lock); |
| 2139 | |||
| 2140 | if (dev->setup_data.bRequestType & USB_DIR_IN) { | ||
| 2141 | ep->td_data->status = (ep->td_data->status & | ||
| 2142 | ~PCH_UDC_BUFF_STS) | | ||
| 2143 | PCH_UDC_BS_HST_RDY; | ||
| 2144 | pch_udc_ep_set_ddptr(ep, ep->td_data_phys); | ||
| 2145 | } | ||
| 2125 | /* ep0 in returns data on IN phase */ | 2146 | /* ep0 in returns data on IN phase */ |
| 2126 | if (setup_supported >= 0 && setup_supported < | 2147 | if (setup_supported >= 0 && setup_supported < |
| 2127 | UDC_EP0IN_MAX_PKT_SIZE) { | 2148 | UDC_EP0IN_MAX_PKT_SIZE) { |
| 2128 | pch_udc_ep_clear_nak(&(dev->ep[UDC_EP0IN_IDX])); | 2149 | pch_udc_ep_clear_nak(&(dev->ep[UDC_EP0IN_IDX])); |
| 2129 | /* Gadget would have queued a request when | 2150 | /* Gadget would have queued a request when |
| 2130 | * we called the setup */ | 2151 | * we called the setup */ |
| 2131 | pch_udc_set_dma(dev, DMA_DIR_RX); | 2152 | if (!(dev->setup_data.bRequestType & USB_DIR_IN)) { |
| 2132 | pch_udc_ep_clear_nak(ep); | 2153 | pch_udc_set_dma(dev, DMA_DIR_RX); |
| 2154 | pch_udc_ep_clear_nak(ep); | ||
| 2155 | } | ||
| 2133 | } else if (setup_supported < 0) { | 2156 | } else if (setup_supported < 0) { |
| 2134 | /* if unsupported request, then stall */ | 2157 | /* if unsupported request, then stall */ |
| 2135 | pch_udc_ep_set_stall(&(dev->ep[UDC_EP0IN_IDX])); | 2158 | pch_udc_ep_set_stall(&(dev->ep[UDC_EP0IN_IDX])); |
| @@ -2142,22 +2165,13 @@ static void pch_udc_svc_control_out(struct pch_udc_dev *dev) | |||
| 2142 | } | 2165 | } |
| 2143 | } else if ((((stat & UDC_EPSTS_OUT_MASK) >> UDC_EPSTS_OUT_SHIFT) == | 2166 | } else if ((((stat & UDC_EPSTS_OUT_MASK) >> UDC_EPSTS_OUT_SHIFT) == |
| 2144 | UDC_EPSTS_OUT_DATA) && !dev->stall) { | 2167 | UDC_EPSTS_OUT_DATA) && !dev->stall) { |
| 2145 | if (list_empty(&ep->queue)) { | 2168 | pch_udc_clear_dma(dev, DMA_DIR_RX); |
| 2146 | dev_err(&dev->pdev->dev, "%s: No request\n", __func__); | 2169 | pch_udc_ep_set_ddptr(ep, 0); |
| 2147 | ep->td_data->status = (ep->td_data->status & | 2170 | if (!list_empty(&ep->queue)) { |
| 2148 | ~PCH_UDC_BUFF_STS) | | ||
| 2149 | PCH_UDC_BS_HST_RDY; | ||
| 2150 | pch_udc_set_dma(dev, DMA_DIR_RX); | ||
| 2151 | } else { | ||
| 2152 | /* control write */ | ||
| 2153 | /* next function will pickuo an clear the status */ | ||
| 2154 | ep->epsts = stat; | 2171 | ep->epsts = stat; |
| 2155 | 2172 | pch_udc_svc_data_out(dev, PCH_UDC_EP0); | |
| 2156 | pch_udc_svc_data_out(dev, 0); | ||
| 2157 | /* re-program desc. pointer for possible ZLPs */ | ||
| 2158 | pch_udc_ep_set_ddptr(ep, ep->td_data_phys); | ||
| 2159 | pch_udc_set_dma(dev, DMA_DIR_RX); | ||
| 2160 | } | 2173 | } |
| 2174 | pch_udc_set_dma(dev, DMA_DIR_RX); | ||
| 2161 | } | 2175 | } |
| 2162 | pch_udc_ep_set_rrdy(ep); | 2176 | pch_udc_ep_set_rrdy(ep); |
| 2163 | } | 2177 | } |
| @@ -2174,7 +2188,7 @@ static void pch_udc_postsvc_epinters(struct pch_udc_dev *dev, int ep_num) | |||
| 2174 | struct pch_udc_ep *ep; | 2188 | struct pch_udc_ep *ep; |
| 2175 | struct pch_udc_request *req; | 2189 | struct pch_udc_request *req; |
| 2176 | 2190 | ||
| 2177 | ep = &dev->ep[2*ep_num]; | 2191 | ep = &dev->ep[UDC_EPIN_IDX(ep_num)]; |
| 2178 | if (!list_empty(&ep->queue)) { | 2192 | if (!list_empty(&ep->queue)) { |
| 2179 | req = list_entry(ep->queue.next, struct pch_udc_request, queue); | 2193 | req = list_entry(ep->queue.next, struct pch_udc_request, queue); |
| 2180 | pch_udc_enable_ep_interrupts(ep->dev, | 2194 | pch_udc_enable_ep_interrupts(ep->dev, |
| @@ -2196,13 +2210,13 @@ static void pch_udc_read_all_epstatus(struct pch_udc_dev *dev, u32 ep_intr) | |||
| 2196 | for (i = 0; i < PCH_UDC_USED_EP_NUM; i++) { | 2210 | for (i = 0; i < PCH_UDC_USED_EP_NUM; i++) { |
| 2197 | /* IN */ | 2211 | /* IN */ |
| 2198 | if (ep_intr & (0x1 << i)) { | 2212 | if (ep_intr & (0x1 << i)) { |
| 2199 | ep = &dev->ep[2*i]; | 2213 | ep = &dev->ep[UDC_EPIN_IDX(i)]; |
| 2200 | ep->epsts = pch_udc_read_ep_status(ep); | 2214 | ep->epsts = pch_udc_read_ep_status(ep); |
| 2201 | pch_udc_clear_ep_status(ep, ep->epsts); | 2215 | pch_udc_clear_ep_status(ep, ep->epsts); |
| 2202 | } | 2216 | } |
| 2203 | /* OUT */ | 2217 | /* OUT */ |
| 2204 | if (ep_intr & (0x10000 << i)) { | 2218 | if (ep_intr & (0x10000 << i)) { |
| 2205 | ep = &dev->ep[2*i+1]; | 2219 | ep = &dev->ep[UDC_EPOUT_IDX(i)]; |
| 2206 | ep->epsts = pch_udc_read_ep_status(ep); | 2220 | ep->epsts = pch_udc_read_ep_status(ep); |
| 2207 | pch_udc_clear_ep_status(ep, ep->epsts); | 2221 | pch_udc_clear_ep_status(ep, ep->epsts); |
| 2208 | } | 2222 | } |
| @@ -2563,9 +2577,6 @@ static void pch_udc_pcd_reinit(struct pch_udc_dev *dev) | |||
| 2563 | dev->ep[UDC_EP0IN_IDX].ep.maxpacket = UDC_EP0IN_MAX_PKT_SIZE; | 2577 | dev->ep[UDC_EP0IN_IDX].ep.maxpacket = UDC_EP0IN_MAX_PKT_SIZE; |
| 2564 | dev->ep[UDC_EP0OUT_IDX].ep.maxpacket = UDC_EP0OUT_MAX_PKT_SIZE; | 2578 | dev->ep[UDC_EP0OUT_IDX].ep.maxpacket = UDC_EP0OUT_MAX_PKT_SIZE; |
| 2565 | 2579 | ||
| 2566 | dev->dma_addr = pci_map_single(dev->pdev, dev->ep0out_buf, 256, | ||
| 2567 | PCI_DMA_FROMDEVICE); | ||
| 2568 | |||
| 2569 | /* remove ep0 in and out from the list. They have own pointer */ | 2580 | /* remove ep0 in and out from the list. They have own pointer */ |
| 2570 | list_del_init(&dev->ep[UDC_EP0IN_IDX].ep.ep_list); | 2581 | list_del_init(&dev->ep[UDC_EP0IN_IDX].ep.ep_list); |
| 2571 | list_del_init(&dev->ep[UDC_EP0OUT_IDX].ep.ep_list); | 2582 | list_del_init(&dev->ep[UDC_EP0OUT_IDX].ep.ep_list); |
| @@ -2637,6 +2648,13 @@ static int init_dma_pools(struct pch_udc_dev *dev) | |||
| 2637 | dev->ep[UDC_EP0IN_IDX].td_stp_phys = 0; | 2648 | dev->ep[UDC_EP0IN_IDX].td_stp_phys = 0; |
| 2638 | dev->ep[UDC_EP0IN_IDX].td_data = NULL; | 2649 | dev->ep[UDC_EP0IN_IDX].td_data = NULL; |
| 2639 | dev->ep[UDC_EP0IN_IDX].td_data_phys = 0; | 2650 | dev->ep[UDC_EP0IN_IDX].td_data_phys = 0; |
| 2651 | |||
| 2652 | dev->ep0out_buf = kzalloc(UDC_EP0OUT_BUFF_SIZE * 4, GFP_KERNEL); | ||
| 2653 | if (!dev->ep0out_buf) | ||
| 2654 | return -ENOMEM; | ||
| 2655 | dev->dma_addr = dma_map_single(&dev->pdev->dev, dev->ep0out_buf, | ||
| 2656 | UDC_EP0OUT_BUFF_SIZE * 4, | ||
| 2657 | DMA_FROM_DEVICE); | ||
| 2640 | return 0; | 2658 | return 0; |
| 2641 | } | 2659 | } |
| 2642 | 2660 | ||
| @@ -2700,7 +2718,8 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) | |||
| 2700 | 2718 | ||
| 2701 | pch_udc_disable_interrupts(dev, UDC_DEVINT_MSK); | 2719 | pch_udc_disable_interrupts(dev, UDC_DEVINT_MSK); |
| 2702 | 2720 | ||
| 2703 | /* Assues that there are no pending requets with this driver */ | 2721 | /* Assures that there are no pending requests with this driver */ |
| 2722 | driver->disconnect(&dev->gadget); | ||
| 2704 | driver->unbind(&dev->gadget); | 2723 | driver->unbind(&dev->gadget); |
| 2705 | dev->gadget.dev.driver = NULL; | 2724 | dev->gadget.dev.driver = NULL; |
| 2706 | dev->driver = NULL; | 2725 | dev->driver = NULL; |
| @@ -2750,6 +2769,11 @@ static void pch_udc_remove(struct pci_dev *pdev) | |||
| 2750 | pci_pool_destroy(dev->stp_requests); | 2769 | pci_pool_destroy(dev->stp_requests); |
| 2751 | } | 2770 | } |
| 2752 | 2771 | ||
| 2772 | if (dev->dma_addr) | ||
| 2773 | dma_unmap_single(&dev->pdev->dev, dev->dma_addr, | ||
| 2774 | UDC_EP0OUT_BUFF_SIZE * 4, DMA_FROM_DEVICE); | ||
| 2775 | kfree(dev->ep0out_buf); | ||
| 2776 | |||
| 2753 | pch_udc_exit(dev); | 2777 | pch_udc_exit(dev); |
| 2754 | 2778 | ||
| 2755 | if (dev->irq_registered) | 2779 | if (dev->irq_registered) |
| @@ -2792,11 +2816,7 @@ static int pch_udc_resume(struct pci_dev *pdev) | |||
| 2792 | int ret; | 2816 | int ret; |
| 2793 | 2817 | ||
| 2794 | pci_set_power_state(pdev, PCI_D0); | 2818 | pci_set_power_state(pdev, PCI_D0); |
| 2795 | ret = pci_restore_state(pdev); | 2819 | pci_restore_state(pdev); |
| 2796 | if (ret) { | ||
| 2797 | dev_err(&pdev->dev, "%s: pci_restore_state failed\n", __func__); | ||
| 2798 | return ret; | ||
| 2799 | } | ||
| 2800 | ret = pci_enable_device(pdev); | 2820 | ret = pci_enable_device(pdev); |
| 2801 | if (ret) { | 2821 | if (ret) { |
| 2802 | dev_err(&pdev->dev, "%s: pci_enable_device failed\n", __func__); | 2822 | dev_err(&pdev->dev, "%s: pci_enable_device failed\n", __func__); |
| @@ -2914,6 +2934,11 @@ static DEFINE_PCI_DEVICE_TABLE(pch_udc_pcidev_id) = { | |||
| 2914 | .class = (PCI_CLASS_SERIAL_USB << 8) | 0xfe, | 2934 | .class = (PCI_CLASS_SERIAL_USB << 8) | 0xfe, |
| 2915 | .class_mask = 0xffffffff, | 2935 | .class_mask = 0xffffffff, |
| 2916 | }, | 2936 | }, |
| 2937 | { | ||
| 2938 | PCI_DEVICE(PCI_VENDOR_ID_ROHM, PCI_DEVICE_ID_ML7213_IOH_UDC), | ||
| 2939 | .class = (PCI_CLASS_SERIAL_USB << 8) | 0xfe, | ||
| 2940 | .class_mask = 0xffffffff, | ||
| 2941 | }, | ||
| 2917 | { 0 }, | 2942 | { 0 }, |
| 2918 | }; | 2943 | }; |
| 2919 | 2944 | ||
diff --git a/drivers/usb/gadget/printer.c b/drivers/usb/gadget/printer.c index 2fc8636316c..12ff6cffedc 100644 --- a/drivers/usb/gadget/printer.c +++ b/drivers/usb/gadget/printer.c | |||
| @@ -131,31 +131,31 @@ static struct printer_dev usb_printer_gadget; | |||
| 131 | * parameters are in UTF-8 (superset of ASCII's 7 bit characters). | 131 | * parameters are in UTF-8 (superset of ASCII's 7 bit characters). |
| 132 | */ | 132 | */ |
| 133 | 133 | ||
| 134 | static ushort __initdata idVendor; | 134 | static ushort idVendor; |
| 135 | module_param(idVendor, ushort, S_IRUGO); | 135 | module_param(idVendor, ushort, S_IRUGO); |
| 136 | MODULE_PARM_DESC(idVendor, "USB Vendor ID"); | 136 | MODULE_PARM_DESC(idVendor, "USB Vendor ID"); |
| 137 | 137 | ||
| 138 | static ushort __initdata idProduct; | 138 | static ushort idProduct; |
| 139 | module_param(idProduct, ushort, S_IRUGO); | 139 | module_param(idProduct, ushort, S_IRUGO); |
| 140 | MODULE_PARM_DESC(idProduct, "USB Product ID"); | 140 | MODULE_PARM_DESC(idProduct, "USB Product ID"); |
| 141 | 141 | ||
| 142 | static ushort __initdata bcdDevice; | 142 | static ushort bcdDevice; |
| 143 | module_param(bcdDevice, ushort, S_IRUGO); | 143 | module_param(bcdDevice, ushort, S_IRUGO); |
| 144 | MODULE_PARM_DESC(bcdDevice, "USB Device version (BCD)"); | 144 | MODULE_PARM_DESC(bcdDevice, "USB Device version (BCD)"); |
| 145 | 145 | ||
| 146 | static char *__initdata iManufacturer; | 146 | static char *iManufacturer; |
| 147 | module_param(iManufacturer, charp, S_IRUGO); | 147 | module_param(iManufacturer, charp, S_IRUGO); |
| 148 | MODULE_PARM_DESC(iManufacturer, "USB Manufacturer string"); | 148 | MODULE_PARM_DESC(iManufacturer, "USB Manufacturer string"); |
| 149 | 149 | ||
| 150 | static char *__initdata iProduct; | 150 | static char *iProduct; |
| 151 | module_param(iProduct, charp, S_IRUGO); | 151 | module_param(iProduct, charp, S_IRUGO); |
| 152 | MODULE_PARM_DESC(iProduct, "USB Product string"); | 152 | MODULE_PARM_DESC(iProduct, "USB Product string"); |
| 153 | 153 | ||
| 154 | static char *__initdata iSerialNum; | 154 | static char *iSerialNum; |
| 155 | module_param(iSerialNum, charp, S_IRUGO); | 155 | module_param(iSerialNum, charp, S_IRUGO); |
| 156 | MODULE_PARM_DESC(iSerialNum, "1"); | 156 | MODULE_PARM_DESC(iSerialNum, "1"); |
| 157 | 157 | ||
| 158 | static char *__initdata iPNPstring; | 158 | static char *iPNPstring; |
| 159 | module_param(iPNPstring, charp, S_IRUGO); | 159 | module_param(iPNPstring, charp, S_IRUGO); |
| 160 | MODULE_PARM_DESC(iPNPstring, "MFG:linux;MDL:g_printer;CLS:PRINTER;SN:1;"); | 160 | MODULE_PARM_DESC(iPNPstring, "MFG:linux;MDL:g_printer;CLS:PRINTER;SN:1;"); |
| 161 | 161 | ||
| @@ -1596,13 +1596,12 @@ cleanup(void) | |||
| 1596 | int status; | 1596 | int status; |
| 1597 | 1597 | ||
| 1598 | mutex_lock(&usb_printer_gadget.lock_printer_io); | 1598 | mutex_lock(&usb_printer_gadget.lock_printer_io); |
| 1599 | class_destroy(usb_gadget_class); | ||
| 1600 | unregister_chrdev_region(g_printer_devno, 2); | ||
| 1601 | |||
| 1602 | status = usb_gadget_unregister_driver(&printer_driver); | 1599 | status = usb_gadget_unregister_driver(&printer_driver); |
| 1603 | if (status) | 1600 | if (status) |
| 1604 | ERROR(dev, "usb_gadget_unregister_driver %x\n", status); | 1601 | ERROR(dev, "usb_gadget_unregister_driver %x\n", status); |
| 1605 | 1602 | ||
| 1603 | unregister_chrdev_region(g_printer_devno, 2); | ||
| 1604 | class_destroy(usb_gadget_class); | ||
| 1606 | mutex_unlock(&usb_printer_gadget.lock_printer_io); | 1605 | mutex_unlock(&usb_printer_gadget.lock_printer_io); |
| 1607 | } | 1606 | } |
| 1608 | module_exit(cleanup); | 1607 | module_exit(cleanup); |
diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c index 86e42892016..5c761df7fa8 100644 --- a/drivers/usb/host/ehci-fsl.c +++ b/drivers/usb/host/ehci-fsl.c | |||
| @@ -52,7 +52,6 @@ static int usb_hcd_fsl_probe(const struct hc_driver *driver, | |||
| 52 | struct resource *res; | 52 | struct resource *res; |
| 53 | int irq; | 53 | int irq; |
| 54 | int retval; | 54 | int retval; |
| 55 | unsigned int temp; | ||
| 56 | 55 | ||
| 57 | pr_debug("initializing FSL-SOC USB Controller\n"); | 56 | pr_debug("initializing FSL-SOC USB Controller\n"); |
| 58 | 57 | ||
| @@ -126,18 +125,6 @@ static int usb_hcd_fsl_probe(const struct hc_driver *driver, | |||
| 126 | goto err3; | 125 | goto err3; |
| 127 | } | 126 | } |
| 128 | 127 | ||
| 129 | /* | ||
| 130 | * Check if it is MPC5121 SoC, otherwise set pdata->have_sysif_regs | ||
| 131 | * flag for 83xx or 8536 system interface registers. | ||
| 132 | */ | ||
| 133 | if (pdata->big_endian_mmio) | ||
| 134 | temp = in_be32(hcd->regs + FSL_SOC_USB_ID); | ||
| 135 | else | ||
| 136 | temp = in_le32(hcd->regs + FSL_SOC_USB_ID); | ||
| 137 | |||
| 138 | if ((temp & ID_MSK) != (~((temp & NID_MSK) >> 8) & ID_MSK)) | ||
| 139 | pdata->have_sysif_regs = 1; | ||
| 140 | |||
| 141 | /* Enable USB controller, 83xx or 8536 */ | 128 | /* Enable USB controller, 83xx or 8536 */ |
| 142 | if (pdata->have_sysif_regs) | 129 | if (pdata->have_sysif_regs) |
| 143 | setbits32(hcd->regs + FSL_SOC_USB_CTRL, 0x4); | 130 | setbits32(hcd->regs + FSL_SOC_USB_CTRL, 0x4); |
diff --git a/drivers/usb/host/ehci-fsl.h b/drivers/usb/host/ehci-fsl.h index 2c835379522..3fabed33d94 100644 --- a/drivers/usb/host/ehci-fsl.h +++ b/drivers/usb/host/ehci-fsl.h | |||
| @@ -19,9 +19,6 @@ | |||
| 19 | #define _EHCI_FSL_H | 19 | #define _EHCI_FSL_H |
| 20 | 20 | ||
| 21 | /* offsets for the non-ehci registers in the FSL SOC USB controller */ | 21 | /* offsets for the non-ehci registers in the FSL SOC USB controller */ |
| 22 | #define FSL_SOC_USB_ID 0x0 | ||
| 23 | #define ID_MSK 0x3f | ||
| 24 | #define NID_MSK 0x3f00 | ||
| 25 | #define FSL_SOC_USB_ULPIVP 0x170 | 22 | #define FSL_SOC_USB_ULPIVP 0x170 |
| 26 | #define FSL_SOC_USB_PORTSC1 0x184 | 23 | #define FSL_SOC_USB_PORTSC1 0x184 |
| 27 | #define PORT_PTS_MSK (3<<30) | 24 | #define PORT_PTS_MSK (3<<30) |
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 6fee3cd58ef..74dcf49bd01 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c | |||
| @@ -572,6 +572,8 @@ static int ehci_init(struct usb_hcd *hcd) | |||
| 572 | ehci->iaa_watchdog.function = ehci_iaa_watchdog; | 572 | ehci->iaa_watchdog.function = ehci_iaa_watchdog; |
| 573 | ehci->iaa_watchdog.data = (unsigned long) ehci; | 573 | ehci->iaa_watchdog.data = (unsigned long) ehci; |
| 574 | 574 | ||
| 575 | hcc_params = ehci_readl(ehci, &ehci->caps->hcc_params); | ||
| 576 | |||
| 575 | /* | 577 | /* |
| 576 | * hw default: 1K periodic list heads, one per frame. | 578 | * hw default: 1K periodic list heads, one per frame. |
| 577 | * periodic_size can shrink by USBCMD update if hcc_params allows. | 579 | * periodic_size can shrink by USBCMD update if hcc_params allows. |
| @@ -579,11 +581,20 @@ static int ehci_init(struct usb_hcd *hcd) | |||
| 579 | ehci->periodic_size = DEFAULT_I_TDPS; | 581 | ehci->periodic_size = DEFAULT_I_TDPS; |
| 580 | INIT_LIST_HEAD(&ehci->cached_itd_list); | 582 | INIT_LIST_HEAD(&ehci->cached_itd_list); |
| 581 | INIT_LIST_HEAD(&ehci->cached_sitd_list); | 583 | INIT_LIST_HEAD(&ehci->cached_sitd_list); |
| 584 | |||
| 585 | if (HCC_PGM_FRAMELISTLEN(hcc_params)) { | ||
| 586 | /* periodic schedule size can be smaller than default */ | ||
| 587 | switch (EHCI_TUNE_FLS) { | ||
| 588 | case 0: ehci->periodic_size = 1024; break; | ||
| 589 | case 1: ehci->periodic_size = 512; break; | ||
| 590 | case 2: ehci->periodic_size = 256; break; | ||
| 591 | default: BUG(); | ||
| 592 | } | ||
| 593 | } | ||
| 582 | if ((retval = ehci_mem_init(ehci, GFP_KERNEL)) < 0) | 594 | if ((retval = ehci_mem_init(ehci, GFP_KERNEL)) < 0) |
| 583 | return retval; | 595 | return retval; |
| 584 | 596 | ||
| 585 | /* controllers may cache some of the periodic schedule ... */ | 597 | /* controllers may cache some of the periodic schedule ... */ |
| 586 | hcc_params = ehci_readl(ehci, &ehci->caps->hcc_params); | ||
| 587 | if (HCC_ISOC_CACHE(hcc_params)) // full frame cache | 598 | if (HCC_ISOC_CACHE(hcc_params)) // full frame cache |
| 588 | ehci->i_thresh = 2 + 8; | 599 | ehci->i_thresh = 2 + 8; |
| 589 | else // N microframes cached | 600 | else // N microframes cached |
| @@ -637,12 +648,6 @@ static int ehci_init(struct usb_hcd *hcd) | |||
| 637 | /* periodic schedule size can be smaller than default */ | 648 | /* periodic schedule size can be smaller than default */ |
| 638 | temp &= ~(3 << 2); | 649 | temp &= ~(3 << 2); |
| 639 | temp |= (EHCI_TUNE_FLS << 2); | 650 | temp |= (EHCI_TUNE_FLS << 2); |
| 640 | switch (EHCI_TUNE_FLS) { | ||
| 641 | case 0: ehci->periodic_size = 1024; break; | ||
| 642 | case 1: ehci->periodic_size = 512; break; | ||
| 643 | case 2: ehci->periodic_size = 256; break; | ||
| 644 | default: BUG(); | ||
| 645 | } | ||
| 646 | } | 651 | } |
| 647 | if (HCC_LPM(hcc_params)) { | 652 | if (HCC_LPM(hcc_params)) { |
| 648 | /* support link power management EHCI 1.1 addendum */ | 653 | /* support link power management EHCI 1.1 addendum */ |
diff --git a/drivers/usb/host/ehci-mxc.c b/drivers/usb/host/ehci-mxc.c index fa59b26fc5b..c8e360d7d97 100644 --- a/drivers/usb/host/ehci-mxc.c +++ b/drivers/usb/host/ehci-mxc.c | |||
| @@ -21,10 +21,13 @@ | |||
| 21 | #include <linux/clk.h> | 21 | #include <linux/clk.h> |
| 22 | #include <linux/delay.h> | 22 | #include <linux/delay.h> |
| 23 | #include <linux/usb/otg.h> | 23 | #include <linux/usb/otg.h> |
| 24 | #include <linux/usb/ulpi.h> | ||
| 24 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
| 25 | 26 | ||
| 26 | #include <mach/mxc_ehci.h> | 27 | #include <mach/mxc_ehci.h> |
| 27 | 28 | ||
| 29 | #include <asm/mach-types.h> | ||
| 30 | |||
| 28 | #define ULPI_VIEWPORT_OFFSET 0x170 | 31 | #define ULPI_VIEWPORT_OFFSET 0x170 |
| 29 | 32 | ||
| 30 | struct ehci_mxc_priv { | 33 | struct ehci_mxc_priv { |
| @@ -114,6 +117,7 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev) | |||
| 114 | struct usb_hcd *hcd; | 117 | struct usb_hcd *hcd; |
| 115 | struct resource *res; | 118 | struct resource *res; |
| 116 | int irq, ret; | 119 | int irq, ret; |
| 120 | unsigned int flags; | ||
| 117 | struct ehci_mxc_priv *priv; | 121 | struct ehci_mxc_priv *priv; |
| 118 | struct device *dev = &pdev->dev; | 122 | struct device *dev = &pdev->dev; |
| 119 | struct ehci_hcd *ehci; | 123 | struct ehci_hcd *ehci; |
| @@ -177,8 +181,8 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev) | |||
| 177 | clk_enable(priv->ahbclk); | 181 | clk_enable(priv->ahbclk); |
| 178 | } | 182 | } |
| 179 | 183 | ||
| 180 | /* "dr" device has its own clock */ | 184 | /* "dr" device has its own clock on i.MX51 */ |
| 181 | if (pdev->id == 0) { | 185 | if (cpu_is_mx51() && (pdev->id == 0)) { |
| 182 | priv->phy1clk = clk_get(dev, "usb_phy1"); | 186 | priv->phy1clk = clk_get(dev, "usb_phy1"); |
| 183 | if (IS_ERR(priv->phy1clk)) { | 187 | if (IS_ERR(priv->phy1clk)) { |
| 184 | ret = PTR_ERR(priv->phy1clk); | 188 | ret = PTR_ERR(priv->phy1clk); |
| @@ -240,6 +244,23 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev) | |||
| 240 | if (ret) | 244 | if (ret) |
| 241 | goto err_add; | 245 | goto err_add; |
| 242 | 246 | ||
| 247 | if (pdata->otg) { | ||
| 248 | /* | ||
| 249 | * efikamx and efikasb have some hardware bug which is | ||
| 250 | * preventing usb to work unless CHRGVBUS is set. | ||
| 251 | * It's in violation of USB specs | ||
| 252 | */ | ||
| 253 | if (machine_is_mx51_efikamx() || machine_is_mx51_efikasb()) { | ||
| 254 | flags = otg_io_read(pdata->otg, ULPI_OTG_CTRL); | ||
| 255 | flags |= ULPI_OTG_CTRL_CHRGVBUS; | ||
| 256 | ret = otg_io_write(pdata->otg, flags, ULPI_OTG_CTRL); | ||
| 257 | if (ret) { | ||
| 258 | dev_err(dev, "unable to set CHRVBUS\n"); | ||
| 259 | goto err_add; | ||
| 260 | } | ||
| 261 | } | ||
| 262 | } | ||
| 263 | |||
| 243 | return 0; | 264 | return 0; |
| 244 | 265 | ||
| 245 | err_add: | 266 | err_add: |
diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c index 76179c39c0e..bed07d4aab0 100644 --- a/drivers/usb/host/ehci-pci.c +++ b/drivers/usb/host/ehci-pci.c | |||
| @@ -44,28 +44,35 @@ static int ehci_pci_reinit(struct ehci_hcd *ehci, struct pci_dev *pdev) | |||
| 44 | return 0; | 44 | return 0; |
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | static int ehci_quirk_amd_SB800(struct ehci_hcd *ehci) | 47 | static int ehci_quirk_amd_hudson(struct ehci_hcd *ehci) |
| 48 | { | 48 | { |
| 49 | struct pci_dev *amd_smbus_dev; | 49 | struct pci_dev *amd_smbus_dev; |
| 50 | u8 rev = 0; | 50 | u8 rev = 0; |
| 51 | 51 | ||
| 52 | amd_smbus_dev = pci_get_device(PCI_VENDOR_ID_ATI, 0x4385, NULL); | 52 | amd_smbus_dev = pci_get_device(PCI_VENDOR_ID_ATI, 0x4385, NULL); |
| 53 | if (!amd_smbus_dev) | 53 | if (amd_smbus_dev) { |
| 54 | return 0; | 54 | pci_read_config_byte(amd_smbus_dev, PCI_REVISION_ID, &rev); |
| 55 | 55 | if (rev < 0x40) { | |
| 56 | pci_read_config_byte(amd_smbus_dev, PCI_REVISION_ID, &rev); | 56 | pci_dev_put(amd_smbus_dev); |
| 57 | if (rev < 0x40) { | 57 | amd_smbus_dev = NULL; |
| 58 | pci_dev_put(amd_smbus_dev); | 58 | return 0; |
| 59 | amd_smbus_dev = NULL; | 59 | } |
| 60 | return 0; | 60 | } else { |
| 61 | amd_smbus_dev = pci_get_device(PCI_VENDOR_ID_AMD, 0x780b, NULL); | ||
| 62 | if (!amd_smbus_dev) | ||
| 63 | return 0; | ||
| 64 | pci_read_config_byte(amd_smbus_dev, PCI_REVISION_ID, &rev); | ||
| 65 | if (rev < 0x11 || rev > 0x18) { | ||
| 66 | pci_dev_put(amd_smbus_dev); | ||
| 67 | amd_smbus_dev = NULL; | ||
| 68 | return 0; | ||
| 69 | } | ||
| 61 | } | 70 | } |
| 62 | 71 | ||
| 63 | if (!amd_nb_dev) | 72 | if (!amd_nb_dev) |
| 64 | amd_nb_dev = pci_get_device(PCI_VENDOR_ID_AMD, 0x1510, NULL); | 73 | amd_nb_dev = pci_get_device(PCI_VENDOR_ID_AMD, 0x1510, NULL); |
| 65 | if (!amd_nb_dev) | ||
| 66 | ehci_err(ehci, "QUIRK: unable to get AMD NB device\n"); | ||
| 67 | 74 | ||
| 68 | ehci_info(ehci, "QUIRK: Enable AMD SB800 L1 fix\n"); | 75 | ehci_info(ehci, "QUIRK: Enable exception for AMD Hudson ASPM\n"); |
| 69 | 76 | ||
| 70 | pci_dev_put(amd_smbus_dev); | 77 | pci_dev_put(amd_smbus_dev); |
| 71 | amd_smbus_dev = NULL; | 78 | amd_smbus_dev = NULL; |
| @@ -131,7 +138,7 @@ static int ehci_pci_setup(struct usb_hcd *hcd) | |||
| 131 | /* cache this readonly data; minimize chip reads */ | 138 | /* cache this readonly data; minimize chip reads */ |
| 132 | ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params); | 139 | ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params); |
| 133 | 140 | ||
| 134 | if (ehci_quirk_amd_SB800(ehci)) | 141 | if (ehci_quirk_amd_hudson(ehci)) |
| 135 | ehci->amd_l1_fix = 1; | 142 | ehci->amd_l1_fix = 1; |
| 136 | 143 | ||
| 137 | retval = ehci_halt(ehci); | 144 | retval = ehci_halt(ehci); |
diff --git a/drivers/usb/host/fsl-mph-dr-of.c b/drivers/usb/host/fsl-mph-dr-of.c index 574b99ea070..79a66d622f9 100644 --- a/drivers/usb/host/fsl-mph-dr-of.c +++ b/drivers/usb/host/fsl-mph-dr-of.c | |||
| @@ -262,19 +262,24 @@ static void fsl_usb2_mpc5121_exit(struct platform_device *pdev) | |||
| 262 | } | 262 | } |
| 263 | } | 263 | } |
| 264 | 264 | ||
| 265 | struct fsl_usb2_platform_data fsl_usb2_mpc5121_pd = { | 265 | static struct fsl_usb2_platform_data fsl_usb2_mpc5121_pd = { |
| 266 | .big_endian_desc = 1, | 266 | .big_endian_desc = 1, |
| 267 | .big_endian_mmio = 1, | 267 | .big_endian_mmio = 1, |
| 268 | .es = 1, | 268 | .es = 1, |
| 269 | .have_sysif_regs = 0, | ||
| 269 | .le_setup_buf = 1, | 270 | .le_setup_buf = 1, |
| 270 | .init = fsl_usb2_mpc5121_init, | 271 | .init = fsl_usb2_mpc5121_init, |
| 271 | .exit = fsl_usb2_mpc5121_exit, | 272 | .exit = fsl_usb2_mpc5121_exit, |
| 272 | }; | 273 | }; |
| 273 | #endif /* CONFIG_PPC_MPC512x */ | 274 | #endif /* CONFIG_PPC_MPC512x */ |
| 274 | 275 | ||
| 276 | static struct fsl_usb2_platform_data fsl_usb2_mpc8xxx_pd = { | ||
| 277 | .have_sysif_regs = 1, | ||
| 278 | }; | ||
| 279 | |||
| 275 | static const struct of_device_id fsl_usb2_mph_dr_of_match[] = { | 280 | static const struct of_device_id fsl_usb2_mph_dr_of_match[] = { |
| 276 | { .compatible = "fsl-usb2-mph", }, | 281 | { .compatible = "fsl-usb2-mph", .data = &fsl_usb2_mpc8xxx_pd, }, |
| 277 | { .compatible = "fsl-usb2-dr", }, | 282 | { .compatible = "fsl-usb2-dr", .data = &fsl_usb2_mpc8xxx_pd, }, |
| 278 | #ifdef CONFIG_PPC_MPC512x | 283 | #ifdef CONFIG_PPC_MPC512x |
| 279 | { .compatible = "fsl,mpc5121-usb2-dr", .data = &fsl_usb2_mpc5121_pd, }, | 284 | { .compatible = "fsl,mpc5121-usb2-dr", .data = &fsl_usb2_mpc5121_pd, }, |
| 280 | #endif | 285 | #endif |
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index df558f6f84e..3e8211c1ce5 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c | |||
| @@ -308,11 +308,8 @@ static int room_on_ring(struct xhci_hcd *xhci, struct xhci_ring *ring, | |||
| 308 | /* Ring the host controller doorbell after placing a command on the ring */ | 308 | /* Ring the host controller doorbell after placing a command on the ring */ |
| 309 | void xhci_ring_cmd_db(struct xhci_hcd *xhci) | 309 | void xhci_ring_cmd_db(struct xhci_hcd *xhci) |
| 310 | { | 310 | { |
| 311 | u32 temp; | ||
| 312 | |||
| 313 | xhci_dbg(xhci, "// Ding dong!\n"); | 311 | xhci_dbg(xhci, "// Ding dong!\n"); |
| 314 | temp = xhci_readl(xhci, &xhci->dba->doorbell[0]) & DB_MASK; | 312 | xhci_writel(xhci, DB_VALUE_HOST, &xhci->dba->doorbell[0]); |
| 315 | xhci_writel(xhci, temp | DB_TARGET_HOST, &xhci->dba->doorbell[0]); | ||
| 316 | /* Flush PCI posted writes */ | 313 | /* Flush PCI posted writes */ |
| 317 | xhci_readl(xhci, &xhci->dba->doorbell[0]); | 314 | xhci_readl(xhci, &xhci->dba->doorbell[0]); |
| 318 | } | 315 | } |
| @@ -322,26 +319,24 @@ void xhci_ring_ep_doorbell(struct xhci_hcd *xhci, | |||
| 322 | unsigned int ep_index, | 319 | unsigned int ep_index, |
| 323 | unsigned int stream_id) | 320 | unsigned int stream_id) |
| 324 | { | 321 | { |
| 325 | struct xhci_virt_ep *ep; | ||
| 326 | unsigned int ep_state; | ||
| 327 | u32 field; | ||
| 328 | __u32 __iomem *db_addr = &xhci->dba->doorbell[slot_id]; | 322 | __u32 __iomem *db_addr = &xhci->dba->doorbell[slot_id]; |
| 323 | struct xhci_virt_ep *ep = &xhci->devs[slot_id]->eps[ep_index]; | ||
| 324 | unsigned int ep_state = ep->ep_state; | ||
| 329 | 325 | ||
| 330 | ep = &xhci->devs[slot_id]->eps[ep_index]; | ||
| 331 | ep_state = ep->ep_state; | ||
| 332 | /* Don't ring the doorbell for this endpoint if there are pending | 326 | /* Don't ring the doorbell for this endpoint if there are pending |
| 333 | * cancellations because the we don't want to interrupt processing. | 327 | * cancellations because we don't want to interrupt processing. |
| 334 | * We don't want to restart any stream rings if there's a set dequeue | 328 | * We don't want to restart any stream rings if there's a set dequeue |
| 335 | * pointer command pending because the device can choose to start any | 329 | * pointer command pending because the device can choose to start any |
| 336 | * stream once the endpoint is on the HW schedule. | 330 | * stream once the endpoint is on the HW schedule. |
| 337 | * FIXME - check all the stream rings for pending cancellations. | 331 | * FIXME - check all the stream rings for pending cancellations. |
| 338 | */ | 332 | */ |
| 339 | if (!(ep_state & EP_HALT_PENDING) && !(ep_state & SET_DEQ_PENDING) | 333 | if ((ep_state & EP_HALT_PENDING) || (ep_state & SET_DEQ_PENDING) || |
| 340 | && !(ep_state & EP_HALTED)) { | 334 | (ep_state & EP_HALTED)) |
| 341 | field = xhci_readl(xhci, db_addr) & DB_MASK; | 335 | return; |
| 342 | field |= EPI_TO_DB(ep_index) | STREAM_ID_TO_DB(stream_id); | 336 | xhci_writel(xhci, DB_VALUE(ep_index, stream_id), db_addr); |
| 343 | xhci_writel(xhci, field, db_addr); | 337 | /* The CPU has better things to do at this point than wait for a |
| 344 | } | 338 | * write-posting flush. It'll get there soon enough. |
| 339 | */ | ||
| 345 | } | 340 | } |
| 346 | 341 | ||
| 347 | /* Ring the doorbell for any rings with pending URBs */ | 342 | /* Ring the doorbell for any rings with pending URBs */ |
| @@ -1188,7 +1183,7 @@ static void handle_port_status(struct xhci_hcd *xhci, | |||
| 1188 | 1183 | ||
| 1189 | addr = &xhci->op_regs->port_status_base + NUM_PORT_REGS * (port_id - 1); | 1184 | addr = &xhci->op_regs->port_status_base + NUM_PORT_REGS * (port_id - 1); |
| 1190 | temp = xhci_readl(xhci, addr); | 1185 | temp = xhci_readl(xhci, addr); |
| 1191 | if ((temp & PORT_CONNECT) && (hcd->state == HC_STATE_SUSPENDED)) { | 1186 | if (hcd->state == HC_STATE_SUSPENDED) { |
| 1192 | xhci_dbg(xhci, "resume root hub\n"); | 1187 | xhci_dbg(xhci, "resume root hub\n"); |
| 1193 | usb_hcd_resume_root_hub(hcd); | 1188 | usb_hcd_resume_root_hub(hcd); |
| 1194 | } | 1189 | } |
| @@ -1710,8 +1705,7 @@ static int process_bulk_intr_td(struct xhci_hcd *xhci, struct xhci_td *td, | |||
| 1710 | /* Others already handled above */ | 1705 | /* Others already handled above */ |
| 1711 | break; | 1706 | break; |
| 1712 | } | 1707 | } |
| 1713 | dev_dbg(&td->urb->dev->dev, | 1708 | xhci_dbg(xhci, "ep %#x - asked for %d bytes, " |
| 1714 | "ep %#x - asked for %d bytes, " | ||
| 1715 | "%d bytes untransferred\n", | 1709 | "%d bytes untransferred\n", |
| 1716 | td->urb->ep->desc.bEndpointAddress, | 1710 | td->urb->ep->desc.bEndpointAddress, |
| 1717 | td->urb->transfer_buffer_length, | 1711 | td->urb->transfer_buffer_length, |
| @@ -2389,7 +2383,8 @@ static unsigned int count_sg_trbs_needed(struct xhci_hcd *xhci, struct urb *urb) | |||
| 2389 | } | 2383 | } |
| 2390 | xhci_dbg(xhci, "\n"); | 2384 | xhci_dbg(xhci, "\n"); |
| 2391 | if (!in_interrupt()) | 2385 | if (!in_interrupt()) |
| 2392 | dev_dbg(&urb->dev->dev, "ep %#x - urb len = %d, sglist used, num_trbs = %d\n", | 2386 | xhci_dbg(xhci, "ep %#x - urb len = %d, sglist used, " |
| 2387 | "num_trbs = %d\n", | ||
| 2393 | urb->ep->desc.bEndpointAddress, | 2388 | urb->ep->desc.bEndpointAddress, |
| 2394 | urb->transfer_buffer_length, | 2389 | urb->transfer_buffer_length, |
| 2395 | num_trbs); | 2390 | num_trbs); |
| @@ -2414,14 +2409,17 @@ static void check_trb_math(struct urb *urb, int num_trbs, int running_total) | |||
| 2414 | 2409 | ||
| 2415 | static void giveback_first_trb(struct xhci_hcd *xhci, int slot_id, | 2410 | static void giveback_first_trb(struct xhci_hcd *xhci, int slot_id, |
| 2416 | unsigned int ep_index, unsigned int stream_id, int start_cycle, | 2411 | unsigned int ep_index, unsigned int stream_id, int start_cycle, |
| 2417 | struct xhci_generic_trb *start_trb, struct xhci_td *td) | 2412 | struct xhci_generic_trb *start_trb) |
| 2418 | { | 2413 | { |
| 2419 | /* | 2414 | /* |
| 2420 | * Pass all the TRBs to the hardware at once and make sure this write | 2415 | * Pass all the TRBs to the hardware at once and make sure this write |
| 2421 | * isn't reordered. | 2416 | * isn't reordered. |
| 2422 | */ | 2417 | */ |
| 2423 | wmb(); | 2418 | wmb(); |
| 2424 | start_trb->field[3] |= start_cycle; | 2419 | if (start_cycle) |
| 2420 | start_trb->field[3] |= start_cycle; | ||
| 2421 | else | ||
| 2422 | start_trb->field[3] &= ~0x1; | ||
| 2425 | xhci_ring_ep_doorbell(xhci, slot_id, ep_index, stream_id); | 2423 | xhci_ring_ep_doorbell(xhci, slot_id, ep_index, stream_id); |
| 2426 | } | 2424 | } |
| 2427 | 2425 | ||
| @@ -2449,7 +2447,7 @@ int xhci_queue_intr_tx(struct xhci_hcd *xhci, gfp_t mem_flags, | |||
| 2449 | * to set the polling interval (once the API is added). | 2447 | * to set the polling interval (once the API is added). |
| 2450 | */ | 2448 | */ |
| 2451 | if (xhci_interval != ep_interval) { | 2449 | if (xhci_interval != ep_interval) { |
| 2452 | if (!printk_ratelimit()) | 2450 | if (printk_ratelimit()) |
| 2453 | dev_dbg(&urb->dev->dev, "Driver uses different interval" | 2451 | dev_dbg(&urb->dev->dev, "Driver uses different interval" |
| 2454 | " (%d microframe%s) than xHCI " | 2452 | " (%d microframe%s) than xHCI " |
| 2455 | "(%d microframe%s)\n", | 2453 | "(%d microframe%s)\n", |
| @@ -2551,9 +2549,11 @@ static int queue_bulk_sg_tx(struct xhci_hcd *xhci, gfp_t mem_flags, | |||
| 2551 | u32 remainder = 0; | 2549 | u32 remainder = 0; |
| 2552 | 2550 | ||
| 2553 | /* Don't change the cycle bit of the first TRB until later */ | 2551 | /* Don't change the cycle bit of the first TRB until later */ |
| 2554 | if (first_trb) | 2552 | if (first_trb) { |
| 2555 | first_trb = false; | 2553 | first_trb = false; |
| 2556 | else | 2554 | if (start_cycle == 0) |
| 2555 | field |= 0x1; | ||
| 2556 | } else | ||
| 2557 | field |= ep_ring->cycle_state; | 2557 | field |= ep_ring->cycle_state; |
| 2558 | 2558 | ||
| 2559 | /* Chain all the TRBs together; clear the chain bit in the last | 2559 | /* Chain all the TRBs together; clear the chain bit in the last |
| @@ -2625,7 +2625,7 @@ static int queue_bulk_sg_tx(struct xhci_hcd *xhci, gfp_t mem_flags, | |||
| 2625 | 2625 | ||
| 2626 | check_trb_math(urb, num_trbs, running_total); | 2626 | check_trb_math(urb, num_trbs, running_total); |
| 2627 | giveback_first_trb(xhci, slot_id, ep_index, urb->stream_id, | 2627 | giveback_first_trb(xhci, slot_id, ep_index, urb->stream_id, |
| 2628 | start_cycle, start_trb, td); | 2628 | start_cycle, start_trb); |
| 2629 | return 0; | 2629 | return 0; |
| 2630 | } | 2630 | } |
| 2631 | 2631 | ||
| @@ -2671,7 +2671,8 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, | |||
| 2671 | /* FIXME: this doesn't deal with URB_ZERO_PACKET - need one more */ | 2671 | /* FIXME: this doesn't deal with URB_ZERO_PACKET - need one more */ |
| 2672 | 2672 | ||
| 2673 | if (!in_interrupt()) | 2673 | if (!in_interrupt()) |
| 2674 | dev_dbg(&urb->dev->dev, "ep %#x - urb len = %#x (%d), addr = %#llx, num_trbs = %d\n", | 2674 | xhci_dbg(xhci, "ep %#x - urb len = %#x (%d), " |
| 2675 | "addr = %#llx, num_trbs = %d\n", | ||
| 2675 | urb->ep->desc.bEndpointAddress, | 2676 | urb->ep->desc.bEndpointAddress, |
| 2676 | urb->transfer_buffer_length, | 2677 | urb->transfer_buffer_length, |
| 2677 | urb->transfer_buffer_length, | 2678 | urb->transfer_buffer_length, |
| @@ -2711,9 +2712,11 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, | |||
| 2711 | field = 0; | 2712 | field = 0; |
| 2712 | 2713 | ||
| 2713 | /* Don't change the cycle bit of the first TRB until later */ | 2714 | /* Don't change the cycle bit of the first TRB until later */ |
| 2714 | if (first_trb) | 2715 | if (first_trb) { |
| 2715 | first_trb = false; | 2716 | first_trb = false; |
| 2716 | else | 2717 | if (start_cycle == 0) |
| 2718 | field |= 0x1; | ||
| 2719 | } else | ||
| 2717 | field |= ep_ring->cycle_state; | 2720 | field |= ep_ring->cycle_state; |
| 2718 | 2721 | ||
| 2719 | /* Chain all the TRBs together; clear the chain bit in the last | 2722 | /* Chain all the TRBs together; clear the chain bit in the last |
| @@ -2757,7 +2760,7 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, | |||
| 2757 | 2760 | ||
| 2758 | check_trb_math(urb, num_trbs, running_total); | 2761 | check_trb_math(urb, num_trbs, running_total); |
| 2759 | giveback_first_trb(xhci, slot_id, ep_index, urb->stream_id, | 2762 | giveback_first_trb(xhci, slot_id, ep_index, urb->stream_id, |
| 2760 | start_cycle, start_trb, td); | 2763 | start_cycle, start_trb); |
| 2761 | return 0; | 2764 | return 0; |
| 2762 | } | 2765 | } |
| 2763 | 2766 | ||
| @@ -2818,13 +2821,17 @@ int xhci_queue_ctrl_tx(struct xhci_hcd *xhci, gfp_t mem_flags, | |||
| 2818 | /* Queue setup TRB - see section 6.4.1.2.1 */ | 2821 | /* Queue setup TRB - see section 6.4.1.2.1 */ |
| 2819 | /* FIXME better way to translate setup_packet into two u32 fields? */ | 2822 | /* FIXME better way to translate setup_packet into two u32 fields? */ |
| 2820 | setup = (struct usb_ctrlrequest *) urb->setup_packet; | 2823 | setup = (struct usb_ctrlrequest *) urb->setup_packet; |
| 2824 | field = 0; | ||
| 2825 | field |= TRB_IDT | TRB_TYPE(TRB_SETUP); | ||
| 2826 | if (start_cycle == 0) | ||
| 2827 | field |= 0x1; | ||
| 2821 | queue_trb(xhci, ep_ring, false, true, | 2828 | queue_trb(xhci, ep_ring, false, true, |
| 2822 | /* FIXME endianness is probably going to bite my ass here. */ | 2829 | /* FIXME endianness is probably going to bite my ass here. */ |
| 2823 | setup->bRequestType | setup->bRequest << 8 | setup->wValue << 16, | 2830 | setup->bRequestType | setup->bRequest << 8 | setup->wValue << 16, |
| 2824 | setup->wIndex | setup->wLength << 16, | 2831 | setup->wIndex | setup->wLength << 16, |
| 2825 | TRB_LEN(8) | TRB_INTR_TARGET(0), | 2832 | TRB_LEN(8) | TRB_INTR_TARGET(0), |
| 2826 | /* Immediate data in pointer */ | 2833 | /* Immediate data in pointer */ |
| 2827 | TRB_IDT | TRB_TYPE(TRB_SETUP)); | 2834 | field); |
| 2828 | 2835 | ||
| 2829 | /* If there's data, queue data TRBs */ | 2836 | /* If there's data, queue data TRBs */ |
| 2830 | field = 0; | 2837 | field = 0; |
| @@ -2859,7 +2866,7 @@ int xhci_queue_ctrl_tx(struct xhci_hcd *xhci, gfp_t mem_flags, | |||
| 2859 | field | TRB_IOC | TRB_TYPE(TRB_STATUS) | ep_ring->cycle_state); | 2866 | field | TRB_IOC | TRB_TYPE(TRB_STATUS) | ep_ring->cycle_state); |
| 2860 | 2867 | ||
| 2861 | giveback_first_trb(xhci, slot_id, ep_index, 0, | 2868 | giveback_first_trb(xhci, slot_id, ep_index, 0, |
| 2862 | start_cycle, start_trb, td); | 2869 | start_cycle, start_trb); |
| 2863 | return 0; | 2870 | return 0; |
| 2864 | } | 2871 | } |
| 2865 | 2872 | ||
| @@ -2900,6 +2907,7 @@ static int xhci_queue_isoc_tx(struct xhci_hcd *xhci, gfp_t mem_flags, | |||
| 2900 | int running_total, trb_buff_len, td_len, td_remain_len, ret; | 2907 | int running_total, trb_buff_len, td_len, td_remain_len, ret; |
| 2901 | u64 start_addr, addr; | 2908 | u64 start_addr, addr; |
| 2902 | int i, j; | 2909 | int i, j; |
| 2910 | bool more_trbs_coming; | ||
| 2903 | 2911 | ||
| 2904 | ep_ring = xhci->devs[slot_id]->eps[ep_index].ring; | 2912 | ep_ring = xhci->devs[slot_id]->eps[ep_index].ring; |
| 2905 | 2913 | ||
| @@ -2910,7 +2918,7 @@ static int xhci_queue_isoc_tx(struct xhci_hcd *xhci, gfp_t mem_flags, | |||
| 2910 | } | 2918 | } |
| 2911 | 2919 | ||
| 2912 | if (!in_interrupt()) | 2920 | if (!in_interrupt()) |
| 2913 | dev_dbg(&urb->dev->dev, "ep %#x - urb len = %#x (%d)," | 2921 | xhci_dbg(xhci, "ep %#x - urb len = %#x (%d)," |
| 2914 | " addr = %#llx, num_tds = %d\n", | 2922 | " addr = %#llx, num_tds = %d\n", |
| 2915 | urb->ep->desc.bEndpointAddress, | 2923 | urb->ep->desc.bEndpointAddress, |
| 2916 | urb->transfer_buffer_length, | 2924 | urb->transfer_buffer_length, |
| @@ -2950,7 +2958,10 @@ static int xhci_queue_isoc_tx(struct xhci_hcd *xhci, gfp_t mem_flags, | |||
| 2950 | field |= TRB_TYPE(TRB_ISOC); | 2958 | field |= TRB_TYPE(TRB_ISOC); |
| 2951 | /* Assume URB_ISO_ASAP is set */ | 2959 | /* Assume URB_ISO_ASAP is set */ |
| 2952 | field |= TRB_SIA; | 2960 | field |= TRB_SIA; |
| 2953 | if (i > 0) | 2961 | if (i == 0) { |
| 2962 | if (start_cycle == 0) | ||
| 2963 | field |= 0x1; | ||
| 2964 | } else | ||
| 2954 | field |= ep_ring->cycle_state; | 2965 | field |= ep_ring->cycle_state; |
| 2955 | first_trb = false; | 2966 | first_trb = false; |
| 2956 | } else { | 2967 | } else { |
| @@ -2965,9 +2976,11 @@ static int xhci_queue_isoc_tx(struct xhci_hcd *xhci, gfp_t mem_flags, | |||
| 2965 | */ | 2976 | */ |
| 2966 | if (j < trbs_per_td - 1) { | 2977 | if (j < trbs_per_td - 1) { |
| 2967 | field |= TRB_CHAIN; | 2978 | field |= TRB_CHAIN; |
| 2979 | more_trbs_coming = true; | ||
| 2968 | } else { | 2980 | } else { |
| 2969 | td->last_trb = ep_ring->enqueue; | 2981 | td->last_trb = ep_ring->enqueue; |
| 2970 | field |= TRB_IOC; | 2982 | field |= TRB_IOC; |
| 2983 | more_trbs_coming = false; | ||
| 2971 | } | 2984 | } |
| 2972 | 2985 | ||
| 2973 | /* Calculate TRB length */ | 2986 | /* Calculate TRB length */ |
| @@ -2980,7 +2993,7 @@ static int xhci_queue_isoc_tx(struct xhci_hcd *xhci, gfp_t mem_flags, | |||
| 2980 | length_field = TRB_LEN(trb_buff_len) | | 2993 | length_field = TRB_LEN(trb_buff_len) | |
| 2981 | remainder | | 2994 | remainder | |
| 2982 | TRB_INTR_TARGET(0); | 2995 | TRB_INTR_TARGET(0); |
| 2983 | queue_trb(xhci, ep_ring, false, false, | 2996 | queue_trb(xhci, ep_ring, false, more_trbs_coming, |
| 2984 | lower_32_bits(addr), | 2997 | lower_32_bits(addr), |
| 2985 | upper_32_bits(addr), | 2998 | upper_32_bits(addr), |
| 2986 | length_field, | 2999 | length_field, |
| @@ -3003,10 +3016,8 @@ static int xhci_queue_isoc_tx(struct xhci_hcd *xhci, gfp_t mem_flags, | |||
| 3003 | } | 3016 | } |
| 3004 | } | 3017 | } |
| 3005 | 3018 | ||
| 3006 | wmb(); | 3019 | giveback_first_trb(xhci, slot_id, ep_index, urb->stream_id, |
| 3007 | start_trb->field[3] |= start_cycle; | 3020 | start_cycle, start_trb); |
| 3008 | |||
| 3009 | xhci_ring_ep_doorbell(xhci, slot_id, ep_index, urb->stream_id); | ||
| 3010 | return 0; | 3021 | return 0; |
| 3011 | } | 3022 | } |
| 3012 | 3023 | ||
| @@ -3064,7 +3075,7 @@ int xhci_queue_isoc_tx_prepare(struct xhci_hcd *xhci, gfp_t mem_flags, | |||
| 3064 | * to set the polling interval (once the API is added). | 3075 | * to set the polling interval (once the API is added). |
| 3065 | */ | 3076 | */ |
| 3066 | if (xhci_interval != ep_interval) { | 3077 | if (xhci_interval != ep_interval) { |
| 3067 | if (!printk_ratelimit()) | 3078 | if (printk_ratelimit()) |
| 3068 | dev_dbg(&urb->dev->dev, "Driver uses different interval" | 3079 | dev_dbg(&urb->dev->dev, "Driver uses different interval" |
| 3069 | " (%d microframe%s) than xHCI " | 3080 | " (%d microframe%s) than xHCI " |
| 3070 | "(%d microframe%s)\n", | 3081 | "(%d microframe%s)\n", |
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 45e4a3108cc..34cf4e16587 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
| @@ -226,7 +226,8 @@ static int xhci_setup_msi(struct xhci_hcd *xhci) | |||
| 226 | static int xhci_setup_msix(struct xhci_hcd *xhci) | 226 | static int xhci_setup_msix(struct xhci_hcd *xhci) |
| 227 | { | 227 | { |
| 228 | int i, ret = 0; | 228 | int i, ret = 0; |
| 229 | struct pci_dev *pdev = to_pci_dev(xhci_to_hcd(xhci)->self.controller); | 229 | struct usb_hcd *hcd = xhci_to_hcd(xhci); |
| 230 | struct pci_dev *pdev = to_pci_dev(hcd->self.controller); | ||
| 230 | 231 | ||
| 231 | /* | 232 | /* |
| 232 | * calculate number of msi-x vectors supported. | 233 | * calculate number of msi-x vectors supported. |
| @@ -265,6 +266,7 @@ static int xhci_setup_msix(struct xhci_hcd *xhci) | |||
| 265 | goto disable_msix; | 266 | goto disable_msix; |
| 266 | } | 267 | } |
| 267 | 268 | ||
| 269 | hcd->msix_enabled = 1; | ||
| 268 | return ret; | 270 | return ret; |
| 269 | 271 | ||
| 270 | disable_msix: | 272 | disable_msix: |
| @@ -280,7 +282,8 @@ free_entries: | |||
| 280 | /* Free any IRQs and disable MSI-X */ | 282 | /* Free any IRQs and disable MSI-X */ |
| 281 | static void xhci_cleanup_msix(struct xhci_hcd *xhci) | 283 | static void xhci_cleanup_msix(struct xhci_hcd *xhci) |
| 282 | { | 284 | { |
| 283 | struct pci_dev *pdev = to_pci_dev(xhci_to_hcd(xhci)->self.controller); | 285 | struct usb_hcd *hcd = xhci_to_hcd(xhci); |
| 286 | struct pci_dev *pdev = to_pci_dev(hcd->self.controller); | ||
| 284 | 287 | ||
| 285 | xhci_free_irq(xhci); | 288 | xhci_free_irq(xhci); |
| 286 | 289 | ||
| @@ -292,6 +295,7 @@ static void xhci_cleanup_msix(struct xhci_hcd *xhci) | |||
| 292 | pci_disable_msi(pdev); | 295 | pci_disable_msi(pdev); |
| 293 | } | 296 | } |
| 294 | 297 | ||
| 298 | hcd->msix_enabled = 0; | ||
| 295 | return; | 299 | return; |
| 296 | } | 300 | } |
| 297 | 301 | ||
| @@ -508,9 +512,10 @@ void xhci_stop(struct usb_hcd *hcd) | |||
| 508 | spin_lock_irq(&xhci->lock); | 512 | spin_lock_irq(&xhci->lock); |
| 509 | xhci_halt(xhci); | 513 | xhci_halt(xhci); |
| 510 | xhci_reset(xhci); | 514 | xhci_reset(xhci); |
| 511 | xhci_cleanup_msix(xhci); | ||
| 512 | spin_unlock_irq(&xhci->lock); | 515 | spin_unlock_irq(&xhci->lock); |
| 513 | 516 | ||
| 517 | xhci_cleanup_msix(xhci); | ||
| 518 | |||
| 514 | #ifdef CONFIG_USB_XHCI_HCD_DEBUGGING | 519 | #ifdef CONFIG_USB_XHCI_HCD_DEBUGGING |
| 515 | /* Tell the event ring poll function not to reschedule */ | 520 | /* Tell the event ring poll function not to reschedule */ |
| 516 | xhci->zombie = 1; | 521 | xhci->zombie = 1; |
| @@ -544,9 +549,10 @@ void xhci_shutdown(struct usb_hcd *hcd) | |||
| 544 | 549 | ||
| 545 | spin_lock_irq(&xhci->lock); | 550 | spin_lock_irq(&xhci->lock); |
| 546 | xhci_halt(xhci); | 551 | xhci_halt(xhci); |
| 547 | xhci_cleanup_msix(xhci); | ||
| 548 | spin_unlock_irq(&xhci->lock); | 552 | spin_unlock_irq(&xhci->lock); |
| 549 | 553 | ||
| 554 | xhci_cleanup_msix(xhci); | ||
| 555 | |||
| 550 | xhci_dbg(xhci, "xhci_shutdown completed - status = %x\n", | 556 | xhci_dbg(xhci, "xhci_shutdown completed - status = %x\n", |
| 551 | xhci_readl(xhci, &xhci->op_regs->status)); | 557 | xhci_readl(xhci, &xhci->op_regs->status)); |
| 552 | } | 558 | } |
| @@ -647,6 +653,7 @@ int xhci_suspend(struct xhci_hcd *xhci) | |||
| 647 | int rc = 0; | 653 | int rc = 0; |
| 648 | struct usb_hcd *hcd = xhci_to_hcd(xhci); | 654 | struct usb_hcd *hcd = xhci_to_hcd(xhci); |
| 649 | u32 command; | 655 | u32 command; |
| 656 | int i; | ||
| 650 | 657 | ||
| 651 | spin_lock_irq(&xhci->lock); | 658 | spin_lock_irq(&xhci->lock); |
| 652 | clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); | 659 | clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); |
| @@ -677,10 +684,15 @@ int xhci_suspend(struct xhci_hcd *xhci) | |||
| 677 | spin_unlock_irq(&xhci->lock); | 684 | spin_unlock_irq(&xhci->lock); |
| 678 | return -ETIMEDOUT; | 685 | return -ETIMEDOUT; |
| 679 | } | 686 | } |
| 680 | /* step 5: remove core well power */ | ||
| 681 | xhci_cleanup_msix(xhci); | ||
| 682 | spin_unlock_irq(&xhci->lock); | 687 | spin_unlock_irq(&xhci->lock); |
| 683 | 688 | ||
| 689 | /* step 5: remove core well power */ | ||
| 690 | /* synchronize irq when using MSI-X */ | ||
| 691 | if (xhci->msix_entries) { | ||
| 692 | for (i = 0; i < xhci->msix_count; i++) | ||
| 693 | synchronize_irq(xhci->msix_entries[i].vector); | ||
| 694 | } | ||
| 695 | |||
| 684 | return rc; | 696 | return rc; |
| 685 | } | 697 | } |
| 686 | 698 | ||
| @@ -694,7 +706,6 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) | |||
| 694 | { | 706 | { |
| 695 | u32 command, temp = 0; | 707 | u32 command, temp = 0; |
| 696 | struct usb_hcd *hcd = xhci_to_hcd(xhci); | 708 | struct usb_hcd *hcd = xhci_to_hcd(xhci); |
| 697 | struct pci_dev *pdev = to_pci_dev(hcd->self.controller); | ||
| 698 | int old_state, retval; | 709 | int old_state, retval; |
| 699 | 710 | ||
| 700 | old_state = hcd->state; | 711 | old_state = hcd->state; |
| @@ -729,9 +740,8 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) | |||
| 729 | xhci_dbg(xhci, "Stop HCD\n"); | 740 | xhci_dbg(xhci, "Stop HCD\n"); |
| 730 | xhci_halt(xhci); | 741 | xhci_halt(xhci); |
| 731 | xhci_reset(xhci); | 742 | xhci_reset(xhci); |
| 732 | if (hibernated) | ||
| 733 | xhci_cleanup_msix(xhci); | ||
| 734 | spin_unlock_irq(&xhci->lock); | 743 | spin_unlock_irq(&xhci->lock); |
| 744 | xhci_cleanup_msix(xhci); | ||
| 735 | 745 | ||
| 736 | #ifdef CONFIG_USB_XHCI_HCD_DEBUGGING | 746 | #ifdef CONFIG_USB_XHCI_HCD_DEBUGGING |
| 737 | /* Tell the event ring poll function not to reschedule */ | 747 | /* Tell the event ring poll function not to reschedule */ |
| @@ -765,30 +775,6 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) | |||
| 765 | return retval; | 775 | return retval; |
| 766 | } | 776 | } |
| 767 | 777 | ||
| 768 | spin_unlock_irq(&xhci->lock); | ||
| 769 | /* Re-setup MSI-X */ | ||
| 770 | if (hcd->irq) | ||
| 771 | free_irq(hcd->irq, hcd); | ||
| 772 | hcd->irq = -1; | ||
| 773 | |||
| 774 | retval = xhci_setup_msix(xhci); | ||
| 775 | if (retval) | ||
| 776 | /* fall back to msi*/ | ||
| 777 | retval = xhci_setup_msi(xhci); | ||
| 778 | |||
| 779 | if (retval) { | ||
| 780 | /* fall back to legacy interrupt*/ | ||
| 781 | retval = request_irq(pdev->irq, &usb_hcd_irq, IRQF_SHARED, | ||
| 782 | hcd->irq_descr, hcd); | ||
| 783 | if (retval) { | ||
| 784 | xhci_err(xhci, "request interrupt %d failed\n", | ||
| 785 | pdev->irq); | ||
| 786 | return retval; | ||
| 787 | } | ||
| 788 | hcd->irq = pdev->irq; | ||
| 789 | } | ||
| 790 | |||
| 791 | spin_lock_irq(&xhci->lock); | ||
| 792 | /* step 4: set Run/Stop bit */ | 778 | /* step 4: set Run/Stop bit */ |
| 793 | command = xhci_readl(xhci, &xhci->op_regs->command); | 779 | command = xhci_readl(xhci, &xhci->op_regs->command); |
| 794 | command |= CMD_RUN; | 780 | command |= CMD_RUN; |
| @@ -2445,8 +2431,12 @@ int xhci_alloc_dev(struct usb_hcd *hcd, struct usb_device *udev) | |||
| 2445 | xhci_err(xhci, "Error while assigning device slot ID\n"); | 2431 | xhci_err(xhci, "Error while assigning device slot ID\n"); |
| 2446 | return 0; | 2432 | return 0; |
| 2447 | } | 2433 | } |
| 2448 | /* xhci_alloc_virt_device() does not touch rings; no need to lock */ | 2434 | /* xhci_alloc_virt_device() does not touch rings; no need to lock. |
| 2449 | if (!xhci_alloc_virt_device(xhci, xhci->slot_id, udev, GFP_KERNEL)) { | 2435 | * Use GFP_NOIO, since this function can be called from |
| 2436 | * xhci_discover_or_reset_device(), which may be called as part of | ||
| 2437 | * mass storage driver error handling. | ||
| 2438 | */ | ||
| 2439 | if (!xhci_alloc_virt_device(xhci, xhci->slot_id, udev, GFP_NOIO)) { | ||
| 2450 | /* Disable slot, if we can do it without mem alloc */ | 2440 | /* Disable slot, if we can do it without mem alloc */ |
| 2451 | xhci_warn(xhci, "Could not allocate xHCI USB device data structures\n"); | 2441 | xhci_warn(xhci, "Could not allocate xHCI USB device data structures\n"); |
| 2452 | spin_lock_irqsave(&xhci->lock, flags); | 2442 | spin_lock_irqsave(&xhci->lock, flags); |
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index 170c367112d..7f236fd2201 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h | |||
| @@ -436,22 +436,18 @@ struct xhci_run_regs { | |||
| 436 | /** | 436 | /** |
| 437 | * struct doorbell_array | 437 | * struct doorbell_array |
| 438 | * | 438 | * |
| 439 | * Bits 0 - 7: Endpoint target | ||
| 440 | * Bits 8 - 15: RsvdZ | ||
| 441 | * Bits 16 - 31: Stream ID | ||
| 442 | * | ||
| 439 | * Section 5.6 | 443 | * Section 5.6 |
| 440 | */ | 444 | */ |
| 441 | struct xhci_doorbell_array { | 445 | struct xhci_doorbell_array { |
| 442 | u32 doorbell[256]; | 446 | u32 doorbell[256]; |
| 443 | }; | 447 | }; |
| 444 | 448 | ||
| 445 | #define DB_TARGET_MASK 0xFFFFFF00 | 449 | #define DB_VALUE(ep, stream) ((((ep) + 1) & 0xff) | ((stream) << 16)) |
| 446 | #define DB_STREAM_ID_MASK 0x0000FFFF | 450 | #define DB_VALUE_HOST 0x00000000 |
| 447 | #define DB_TARGET_HOST 0x0 | ||
| 448 | #define DB_STREAM_ID_HOST 0x0 | ||
| 449 | #define DB_MASK (0xff << 8) | ||
| 450 | |||
| 451 | /* Endpoint Target - bits 0:7 */ | ||
| 452 | #define EPI_TO_DB(p) (((p) + 1) & 0xff) | ||
| 453 | #define STREAM_ID_TO_DB(p) (((p) & 0xffff) << 16) | ||
| 454 | |||
| 455 | 451 | ||
| 456 | /** | 452 | /** |
| 457 | * struct xhci_protocol_caps | 453 | * struct xhci_protocol_caps |
diff --git a/drivers/usb/misc/usbled.c b/drivers/usb/misc/usbled.c index 1732d9bc097..1616ad1793a 100644 --- a/drivers/usb/misc/usbled.c +++ b/drivers/usb/misc/usbled.c | |||
| @@ -45,7 +45,7 @@ struct usb_led { | |||
| 45 | 45 | ||
| 46 | static void change_color(struct usb_led *led) | 46 | static void change_color(struct usb_led *led) |
| 47 | { | 47 | { |
| 48 | int retval; | 48 | int retval = 0; |
| 49 | unsigned char *buffer; | 49 | unsigned char *buffer; |
| 50 | 50 | ||
| 51 | buffer = kmalloc(8, GFP_KERNEL); | 51 | buffer = kmalloc(8, GFP_KERNEL); |
diff --git a/drivers/usb/misc/uss720.c b/drivers/usb/misc/uss720.c index 4ff21587ab0..f7a20573803 100644 --- a/drivers/usb/misc/uss720.c +++ b/drivers/usb/misc/uss720.c | |||
| @@ -776,7 +776,6 @@ static const struct usb_device_id uss720_table[] = { | |||
| 776 | { USB_DEVICE(0x0557, 0x2001) }, | 776 | { USB_DEVICE(0x0557, 0x2001) }, |
| 777 | { USB_DEVICE(0x0729, 0x1284) }, | 777 | { USB_DEVICE(0x0729, 0x1284) }, |
| 778 | { USB_DEVICE(0x1293, 0x0002) }, | 778 | { USB_DEVICE(0x1293, 0x0002) }, |
| 779 | { USB_DEVICE(0x1293, 0x0002) }, | ||
| 780 | { USB_DEVICE(0x050d, 0x0002) }, | 779 | { USB_DEVICE(0x050d, 0x0002) }, |
| 781 | { } /* Terminating entry */ | 780 | { } /* Terminating entry */ |
| 782 | }; | 781 | }; |
diff --git a/drivers/usb/otg/nop-usb-xceiv.c b/drivers/usb/otg/nop-usb-xceiv.c index e70014ab097..8acf165fe13 100644 --- a/drivers/usb/otg/nop-usb-xceiv.c +++ b/drivers/usb/otg/nop-usb-xceiv.c | |||
| @@ -132,6 +132,8 @@ static int __devinit nop_usb_xceiv_probe(struct platform_device *pdev) | |||
| 132 | 132 | ||
| 133 | platform_set_drvdata(pdev, nop); | 133 | platform_set_drvdata(pdev, nop); |
| 134 | 134 | ||
| 135 | BLOCKING_INIT_NOTIFIER_HEAD(&nop->otg.notifier); | ||
| 136 | |||
| 135 | return 0; | 137 | return 0; |
| 136 | exit: | 138 | exit: |
| 137 | kfree(nop); | 139 | kfree(nop); |
diff --git a/drivers/usb/otg/ulpi.c b/drivers/usb/otg/ulpi.c index 059d9ac0ab5..770d799d5af 100644 --- a/drivers/usb/otg/ulpi.c +++ b/drivers/usb/otg/ulpi.c | |||
| @@ -45,7 +45,7 @@ struct ulpi_info { | |||
| 45 | /* ULPI hardcoded IDs, used for probing */ | 45 | /* ULPI hardcoded IDs, used for probing */ |
| 46 | static struct ulpi_info ulpi_ids[] = { | 46 | static struct ulpi_info ulpi_ids[] = { |
| 47 | ULPI_INFO(ULPI_ID(0x04cc, 0x1504), "NXP ISP1504"), | 47 | ULPI_INFO(ULPI_ID(0x04cc, 0x1504), "NXP ISP1504"), |
| 48 | ULPI_INFO(ULPI_ID(0x0424, 0x0006), "SMSC USB3319"), | 48 | ULPI_INFO(ULPI_ID(0x0424, 0x0006), "SMSC USB331x"), |
| 49 | }; | 49 | }; |
| 50 | 50 | ||
| 51 | static int ulpi_set_otg_flags(struct otg_transceiver *otg) | 51 | static int ulpi_set_otg_flags(struct otg_transceiver *otg) |
diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c index 63f7cc45bca..7b8815ddf36 100644 --- a/drivers/usb/serial/ch341.c +++ b/drivers/usb/serial/ch341.c | |||
| @@ -486,12 +486,22 @@ static void ch341_read_int_callback(struct urb *urb) | |||
| 486 | if (actual_length >= 4) { | 486 | if (actual_length >= 4) { |
| 487 | struct ch341_private *priv = usb_get_serial_port_data(port); | 487 | struct ch341_private *priv = usb_get_serial_port_data(port); |
| 488 | unsigned long flags; | 488 | unsigned long flags; |
| 489 | u8 prev_line_status = priv->line_status; | ||
| 489 | 490 | ||
| 490 | spin_lock_irqsave(&priv->lock, flags); | 491 | spin_lock_irqsave(&priv->lock, flags); |
| 491 | priv->line_status = (~(data[2])) & CH341_BITS_MODEM_STAT; | 492 | priv->line_status = (~(data[2])) & CH341_BITS_MODEM_STAT; |
| 492 | if ((data[1] & CH341_MULT_STAT)) | 493 | if ((data[1] & CH341_MULT_STAT)) |
| 493 | priv->multi_status_change = 1; | 494 | priv->multi_status_change = 1; |
| 494 | spin_unlock_irqrestore(&priv->lock, flags); | 495 | spin_unlock_irqrestore(&priv->lock, flags); |
| 496 | |||
| 497 | if ((priv->line_status ^ prev_line_status) & CH341_BIT_DCD) { | ||
| 498 | struct tty_struct *tty = tty_port_tty_get(&port->port); | ||
| 499 | if (tty) | ||
| 500 | usb_serial_handle_dcd_change(port, tty, | ||
| 501 | priv->line_status & CH341_BIT_DCD); | ||
| 502 | tty_kref_put(tty); | ||
| 503 | } | ||
| 504 | |||
| 495 | wake_up_interruptible(&priv->delta_msr_wait); | 505 | wake_up_interruptible(&priv->delta_msr_wait); |
| 496 | } | 506 | } |
| 497 | 507 | ||
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c index 8d7731dbf47..735ea03157a 100644 --- a/drivers/usb/serial/cp210x.c +++ b/drivers/usb/serial/cp210x.c | |||
| @@ -49,7 +49,6 @@ static int cp210x_tiocmset_port(struct usb_serial_port *port, struct file *, | |||
| 49 | static void cp210x_break_ctl(struct tty_struct *, int); | 49 | static void cp210x_break_ctl(struct tty_struct *, int); |
| 50 | static int cp210x_startup(struct usb_serial *); | 50 | static int cp210x_startup(struct usb_serial *); |
| 51 | static void cp210x_dtr_rts(struct usb_serial_port *p, int on); | 51 | static void cp210x_dtr_rts(struct usb_serial_port *p, int on); |
| 52 | static int cp210x_carrier_raised(struct usb_serial_port *p); | ||
| 53 | 52 | ||
| 54 | static int debug; | 53 | static int debug; |
| 55 | 54 | ||
| @@ -87,7 +86,6 @@ static const struct usb_device_id id_table[] = { | |||
| 87 | { USB_DEVICE(0x10C4, 0x8115) }, /* Arygon NFC/Mifare Reader */ | 86 | { USB_DEVICE(0x10C4, 0x8115) }, /* Arygon NFC/Mifare Reader */ |
| 88 | { USB_DEVICE(0x10C4, 0x813D) }, /* Burnside Telecom Deskmobile */ | 87 | { USB_DEVICE(0x10C4, 0x813D) }, /* Burnside Telecom Deskmobile */ |
| 89 | { USB_DEVICE(0x10C4, 0x813F) }, /* Tams Master Easy Control */ | 88 | { USB_DEVICE(0x10C4, 0x813F) }, /* Tams Master Easy Control */ |
| 90 | { USB_DEVICE(0x10C4, 0x8149) }, /* West Mountain Radio Computerized Battery Analyzer */ | ||
| 91 | { USB_DEVICE(0x10C4, 0x814A) }, /* West Mountain Radio RIGblaster P&P */ | 89 | { USB_DEVICE(0x10C4, 0x814A) }, /* West Mountain Radio RIGblaster P&P */ |
| 92 | { USB_DEVICE(0x10C4, 0x814B) }, /* West Mountain Radio RIGtalk */ | 90 | { USB_DEVICE(0x10C4, 0x814B) }, /* West Mountain Radio RIGtalk */ |
| 93 | { USB_DEVICE(0x10C4, 0x8156) }, /* B&G H3000 link cable */ | 91 | { USB_DEVICE(0x10C4, 0x8156) }, /* B&G H3000 link cable */ |
| @@ -110,7 +108,9 @@ static const struct usb_device_id id_table[] = { | |||
| 110 | { USB_DEVICE(0x10C4, 0x8341) }, /* Siemens MC35PU GPRS Modem */ | 108 | { USB_DEVICE(0x10C4, 0x8341) }, /* Siemens MC35PU GPRS Modem */ |
| 111 | { USB_DEVICE(0x10C4, 0x8382) }, /* Cygnal Integrated Products, Inc. */ | 109 | { USB_DEVICE(0x10C4, 0x8382) }, /* Cygnal Integrated Products, Inc. */ |
| 112 | { USB_DEVICE(0x10C4, 0x83A8) }, /* Amber Wireless AMB2560 */ | 110 | { USB_DEVICE(0x10C4, 0x83A8) }, /* Amber Wireless AMB2560 */ |
| 111 | { USB_DEVICE(0x10C4, 0x83D8) }, /* DekTec DTA Plus VHF/UHF Booster/Attenuator */ | ||
| 113 | { USB_DEVICE(0x10C4, 0x8411) }, /* Kyocera GPS Module */ | 112 | { USB_DEVICE(0x10C4, 0x8411) }, /* Kyocera GPS Module */ |
| 113 | { USB_DEVICE(0x10C4, 0x8418) }, /* IRZ Automation Teleport SG-10 GSM/GPRS Modem */ | ||
| 114 | { USB_DEVICE(0x10C4, 0x846E) }, /* BEI USB Sensor Interface (VCP) */ | 114 | { USB_DEVICE(0x10C4, 0x846E) }, /* BEI USB Sensor Interface (VCP) */ |
| 115 | { USB_DEVICE(0x10C4, 0x8477) }, /* Balluff RFID */ | 115 | { USB_DEVICE(0x10C4, 0x8477) }, /* Balluff RFID */ |
| 116 | { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */ | 116 | { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */ |
| @@ -165,8 +165,7 @@ static struct usb_serial_driver cp210x_device = { | |||
| 165 | .tiocmget = cp210x_tiocmget, | 165 | .tiocmget = cp210x_tiocmget, |
| 166 | .tiocmset = cp210x_tiocmset, | 166 | .tiocmset = cp210x_tiocmset, |
| 167 | .attach = cp210x_startup, | 167 | .attach = cp210x_startup, |
| 168 | .dtr_rts = cp210x_dtr_rts, | 168 | .dtr_rts = cp210x_dtr_rts |
| 169 | .carrier_raised = cp210x_carrier_raised | ||
| 170 | }; | 169 | }; |
| 171 | 170 | ||
| 172 | /* Config request types */ | 171 | /* Config request types */ |
| @@ -765,15 +764,6 @@ static int cp210x_tiocmget (struct tty_struct *tty, struct file *file) | |||
| 765 | return result; | 764 | return result; |
| 766 | } | 765 | } |
| 767 | 766 | ||
| 768 | static int cp210x_carrier_raised(struct usb_serial_port *p) | ||
| 769 | { | ||
| 770 | unsigned int control; | ||
| 771 | cp210x_get_config(p, CP210X_GET_MDMSTS, &control, 1); | ||
| 772 | if (control & CONTROL_DCD) | ||
| 773 | return 1; | ||
| 774 | return 0; | ||
| 775 | } | ||
| 776 | |||
| 777 | static void cp210x_break_ctl (struct tty_struct *tty, int break_state) | 767 | static void cp210x_break_ctl (struct tty_struct *tty, int break_state) |
| 778 | { | 768 | { |
| 779 | struct usb_serial_port *port = tty->driver_data; | 769 | struct usb_serial_port *port = tty->driver_data; |
diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c index b92070c103c..666e5a6edd8 100644 --- a/drivers/usb/serial/digi_acceleport.c +++ b/drivers/usb/serial/digi_acceleport.c | |||
| @@ -455,7 +455,6 @@ static int digi_write_room(struct tty_struct *tty); | |||
| 455 | static int digi_chars_in_buffer(struct tty_struct *tty); | 455 | static int digi_chars_in_buffer(struct tty_struct *tty); |
| 456 | static int digi_open(struct tty_struct *tty, struct usb_serial_port *port); | 456 | static int digi_open(struct tty_struct *tty, struct usb_serial_port *port); |
| 457 | static void digi_close(struct usb_serial_port *port); | 457 | static void digi_close(struct usb_serial_port *port); |
| 458 | static int digi_carrier_raised(struct usb_serial_port *port); | ||
| 459 | static void digi_dtr_rts(struct usb_serial_port *port, int on); | 458 | static void digi_dtr_rts(struct usb_serial_port *port, int on); |
| 460 | static int digi_startup_device(struct usb_serial *serial); | 459 | static int digi_startup_device(struct usb_serial *serial); |
| 461 | static int digi_startup(struct usb_serial *serial); | 460 | static int digi_startup(struct usb_serial *serial); |
| @@ -511,7 +510,6 @@ static struct usb_serial_driver digi_acceleport_2_device = { | |||
| 511 | .open = digi_open, | 510 | .open = digi_open, |
| 512 | .close = digi_close, | 511 | .close = digi_close, |
| 513 | .dtr_rts = digi_dtr_rts, | 512 | .dtr_rts = digi_dtr_rts, |
| 514 | .carrier_raised = digi_carrier_raised, | ||
| 515 | .write = digi_write, | 513 | .write = digi_write, |
| 516 | .write_room = digi_write_room, | 514 | .write_room = digi_write_room, |
| 517 | .write_bulk_callback = digi_write_bulk_callback, | 515 | .write_bulk_callback = digi_write_bulk_callback, |
| @@ -1339,14 +1337,6 @@ static void digi_dtr_rts(struct usb_serial_port *port, int on) | |||
| 1339 | digi_set_modem_signals(port, on * (TIOCM_DTR|TIOCM_RTS), 1); | 1337 | digi_set_modem_signals(port, on * (TIOCM_DTR|TIOCM_RTS), 1); |
| 1340 | } | 1338 | } |
| 1341 | 1339 | ||
| 1342 | static int digi_carrier_raised(struct usb_serial_port *port) | ||
| 1343 | { | ||
| 1344 | struct digi_port *priv = usb_get_serial_port_data(port); | ||
| 1345 | if (priv->dp_modem_signals & TIOCM_CD) | ||
| 1346 | return 1; | ||
| 1347 | return 0; | ||
| 1348 | } | ||
| 1349 | |||
| 1350 | static int digi_open(struct tty_struct *tty, struct usb_serial_port *port) | 1340 | static int digi_open(struct tty_struct *tty, struct usb_serial_port *port) |
| 1351 | { | 1341 | { |
| 1352 | int ret; | 1342 | int ret; |
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index a2668d08926..4787c0cd063 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
| @@ -676,7 +676,17 @@ static struct usb_device_id id_table_combined [] = { | |||
| 676 | { USB_DEVICE(FTDI_VID, FTDI_PCDJ_DAC2_PID) }, | 676 | { USB_DEVICE(FTDI_VID, FTDI_PCDJ_DAC2_PID) }, |
| 677 | { USB_DEVICE(FTDI_VID, FTDI_RRCIRKITS_LOCOBUFFER_PID) }, | 677 | { USB_DEVICE(FTDI_VID, FTDI_RRCIRKITS_LOCOBUFFER_PID) }, |
| 678 | { USB_DEVICE(FTDI_VID, FTDI_ASK_RDR400_PID) }, | 678 | { USB_DEVICE(FTDI_VID, FTDI_ASK_RDR400_PID) }, |
| 679 | { USB_DEVICE(ICOM_ID1_VID, ICOM_ID1_PID) }, | 679 | { USB_DEVICE(ICOM_VID, ICOM_ID_1_PID) }, |
| 680 | { USB_DEVICE(ICOM_VID, ICOM_OPC_U_UC_PID) }, | ||
| 681 | { USB_DEVICE(ICOM_VID, ICOM_ID_RP2C1_PID) }, | ||
| 682 | { USB_DEVICE(ICOM_VID, ICOM_ID_RP2C2_PID) }, | ||
| 683 | { USB_DEVICE(ICOM_VID, ICOM_ID_RP2D_PID) }, | ||
| 684 | { USB_DEVICE(ICOM_VID, ICOM_ID_RP2VT_PID) }, | ||
| 685 | { USB_DEVICE(ICOM_VID, ICOM_ID_RP2VR_PID) }, | ||
| 686 | { USB_DEVICE(ICOM_VID, ICOM_ID_RP4KVT_PID) }, | ||
| 687 | { USB_DEVICE(ICOM_VID, ICOM_ID_RP4KVR_PID) }, | ||
| 688 | { USB_DEVICE(ICOM_VID, ICOM_ID_RP2KVT_PID) }, | ||
| 689 | { USB_DEVICE(ICOM_VID, ICOM_ID_RP2KVR_PID) }, | ||
| 680 | { USB_DEVICE(FTDI_VID, FTDI_ACG_HFDUAL_PID) }, | 690 | { USB_DEVICE(FTDI_VID, FTDI_ACG_HFDUAL_PID) }, |
| 681 | { USB_DEVICE(FTDI_VID, FTDI_YEI_SERVOCENTER31_PID) }, | 691 | { USB_DEVICE(FTDI_VID, FTDI_YEI_SERVOCENTER31_PID) }, |
| 682 | { USB_DEVICE(FTDI_VID, FTDI_THORLABS_PID) }, | 692 | { USB_DEVICE(FTDI_VID, FTDI_THORLABS_PID) }, |
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h index bf086728548..ed160def858 100644 --- a/drivers/usb/serial/ftdi_sio_ids.h +++ b/drivers/usb/serial/ftdi_sio_ids.h | |||
| @@ -569,11 +569,23 @@ | |||
| 569 | #define OCT_US101_PID 0x0421 /* OCT US101 USB to RS-232 */ | 569 | #define OCT_US101_PID 0x0421 /* OCT US101 USB to RS-232 */ |
| 570 | 570 | ||
| 571 | /* | 571 | /* |
| 572 | * Icom ID-1 digital transceiver | 572 | * Definitions for Icom Inc. devices |
| 573 | */ | 573 | */ |
| 574 | 574 | #define ICOM_VID 0x0C26 /* Icom vendor ID */ | |
| 575 | #define ICOM_ID1_VID 0x0C26 | 575 | /* Note: ID-1 is a communications tranceiver for HAM-radio operators */ |
| 576 | #define ICOM_ID1_PID 0x0004 | 576 | #define ICOM_ID_1_PID 0x0004 /* ID-1 USB to RS-232 */ |
| 577 | /* Note: OPC is an Optional cable to connect an Icom Tranceiver */ | ||
| 578 | #define ICOM_OPC_U_UC_PID 0x0018 /* OPC-478UC, OPC-1122U cloning cable */ | ||
| 579 | /* Note: ID-RP* devices are Icom Repeater Devices for HAM-radio */ | ||
| 580 | #define ICOM_ID_RP2C1_PID 0x0009 /* ID-RP2C Asset 1 to RS-232 */ | ||
| 581 | #define ICOM_ID_RP2C2_PID 0x000A /* ID-RP2C Asset 2 to RS-232 */ | ||
| 582 | #define ICOM_ID_RP2D_PID 0x000B /* ID-RP2D configuration port*/ | ||
| 583 | #define ICOM_ID_RP2VT_PID 0x000C /* ID-RP2V Transmit config port */ | ||
| 584 | #define ICOM_ID_RP2VR_PID 0x000D /* ID-RP2V Receive config port */ | ||
| 585 | #define ICOM_ID_RP4KVT_PID 0x0010 /* ID-RP4000V Transmit config port */ | ||
| 586 | #define ICOM_ID_RP4KVR_PID 0x0011 /* ID-RP4000V Receive config port */ | ||
| 587 | #define ICOM_ID_RP2KVT_PID 0x0012 /* ID-RP2000V Transmit config port */ | ||
| 588 | #define ICOM_ID_RP2KVR_PID 0x0013 /* ID-RP2000V Receive config port */ | ||
| 577 | 589 | ||
| 578 | /* | 590 | /* |
| 579 | * GN Otometrics (http://www.otometrics.com) | 591 | * GN Otometrics (http://www.otometrics.com) |
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c index e6833e216fc..e4db5ad2bc5 100644 --- a/drivers/usb/serial/generic.c +++ b/drivers/usb/serial/generic.c | |||
| @@ -479,6 +479,26 @@ int usb_serial_handle_break(struct usb_serial_port *port) | |||
| 479 | } | 479 | } |
| 480 | EXPORT_SYMBOL_GPL(usb_serial_handle_break); | 480 | EXPORT_SYMBOL_GPL(usb_serial_handle_break); |
| 481 | 481 | ||
| 482 | /** | ||
| 483 | * usb_serial_handle_dcd_change - handle a change of carrier detect state | ||
| 484 | * @port: usb_serial_port structure for the open port | ||
| 485 | * @tty: tty_struct structure for the port | ||
| 486 | * @status: new carrier detect status, nonzero if active | ||
| 487 | */ | ||
| 488 | void usb_serial_handle_dcd_change(struct usb_serial_port *usb_port, | ||
| 489 | struct tty_struct *tty, unsigned int status) | ||
| 490 | { | ||
| 491 | struct tty_port *port = &usb_port->port; | ||
| 492 | |||
| 493 | dbg("%s - port %d, status %d", __func__, usb_port->number, status); | ||
| 494 | |||
| 495 | if (status) | ||
| 496 | wake_up_interruptible(&port->open_wait); | ||
| 497 | else if (tty && !C_CLOCAL(tty)) | ||
| 498 | tty_hangup(tty); | ||
| 499 | } | ||
| 500 | EXPORT_SYMBOL_GPL(usb_serial_handle_dcd_change); | ||
| 501 | |||
| 482 | int usb_serial_generic_resume(struct usb_serial *serial) | 502 | int usb_serial_generic_resume(struct usb_serial *serial) |
| 483 | { | 503 | { |
| 484 | struct usb_serial_port *port; | 504 | struct usb_serial_port *port; |
diff --git a/drivers/usb/serial/io_tables.h b/drivers/usb/serial/io_tables.h index 6ab2a3f97fe..178b22eb32b 100644 --- a/drivers/usb/serial/io_tables.h +++ b/drivers/usb/serial/io_tables.h | |||
| @@ -199,6 +199,7 @@ static struct usb_serial_driver epic_device = { | |||
| 199 | .name = "epic", | 199 | .name = "epic", |
| 200 | }, | 200 | }, |
| 201 | .description = "EPiC device", | 201 | .description = "EPiC device", |
| 202 | .usb_driver = &io_driver, | ||
| 202 | .id_table = Epic_port_id_table, | 203 | .id_table = Epic_port_id_table, |
| 203 | .num_ports = 1, | 204 | .num_ports = 1, |
| 204 | .open = edge_open, | 205 | .open = edge_open, |
diff --git a/drivers/usb/serial/iuu_phoenix.c b/drivers/usb/serial/iuu_phoenix.c index 12ed594f5f8..99b97c04896 100644 --- a/drivers/usb/serial/iuu_phoenix.c +++ b/drivers/usb/serial/iuu_phoenix.c | |||
| @@ -1275,6 +1275,7 @@ static struct usb_serial_driver iuu_device = { | |||
| 1275 | .name = "iuu_phoenix", | 1275 | .name = "iuu_phoenix", |
| 1276 | }, | 1276 | }, |
| 1277 | .id_table = id_table, | 1277 | .id_table = id_table, |
| 1278 | .usb_driver = &iuu_driver, | ||
| 1278 | .num_ports = 1, | 1279 | .num_ports = 1, |
| 1279 | .bulk_in_size = 512, | 1280 | .bulk_in_size = 512, |
| 1280 | .bulk_out_size = 512, | 1281 | .bulk_out_size = 512, |
diff --git a/drivers/usb/serial/keyspan.h b/drivers/usb/serial/keyspan.h index 2d8baf6ac47..ce134dc28dd 100644 --- a/drivers/usb/serial/keyspan.h +++ b/drivers/usb/serial/keyspan.h | |||
| @@ -546,6 +546,7 @@ static struct usb_serial_driver keyspan_pre_device = { | |||
| 546 | .name = "keyspan_no_firm", | 546 | .name = "keyspan_no_firm", |
| 547 | }, | 547 | }, |
| 548 | .description = "Keyspan - (without firmware)", | 548 | .description = "Keyspan - (without firmware)", |
| 549 | .usb_driver = &keyspan_driver, | ||
| 549 | .id_table = keyspan_pre_ids, | 550 | .id_table = keyspan_pre_ids, |
| 550 | .num_ports = 1, | 551 | .num_ports = 1, |
| 551 | .attach = keyspan_fake_startup, | 552 | .attach = keyspan_fake_startup, |
| @@ -557,6 +558,7 @@ static struct usb_serial_driver keyspan_1port_device = { | |||
| 557 | .name = "keyspan_1", | 558 | .name = "keyspan_1", |
| 558 | }, | 559 | }, |
| 559 | .description = "Keyspan 1 port adapter", | 560 | .description = "Keyspan 1 port adapter", |
| 561 | .usb_driver = &keyspan_driver, | ||
| 560 | .id_table = keyspan_1port_ids, | 562 | .id_table = keyspan_1port_ids, |
| 561 | .num_ports = 1, | 563 | .num_ports = 1, |
| 562 | .open = keyspan_open, | 564 | .open = keyspan_open, |
| @@ -579,6 +581,7 @@ static struct usb_serial_driver keyspan_2port_device = { | |||
| 579 | .name = "keyspan_2", | 581 | .name = "keyspan_2", |
| 580 | }, | 582 | }, |
| 581 | .description = "Keyspan 2 port adapter", | 583 | .description = "Keyspan 2 port adapter", |
| 584 | .usb_driver = &keyspan_driver, | ||
| 582 | .id_table = keyspan_2port_ids, | 585 | .id_table = keyspan_2port_ids, |
| 583 | .num_ports = 2, | 586 | .num_ports = 2, |
| 584 | .open = keyspan_open, | 587 | .open = keyspan_open, |
| @@ -601,6 +604,7 @@ static struct usb_serial_driver keyspan_4port_device = { | |||
| 601 | .name = "keyspan_4", | 604 | .name = "keyspan_4", |
| 602 | }, | 605 | }, |
| 603 | .description = "Keyspan 4 port adapter", | 606 | .description = "Keyspan 4 port adapter", |
| 607 | .usb_driver = &keyspan_driver, | ||
| 604 | .id_table = keyspan_4port_ids, | 608 | .id_table = keyspan_4port_ids, |
| 605 | .num_ports = 4, | 609 | .num_ports = 4, |
| 606 | .open = keyspan_open, | 610 | .open = keyspan_open, |
diff --git a/drivers/usb/serial/keyspan_pda.c b/drivers/usb/serial/keyspan_pda.c index a10dd5676cc..554a8693a46 100644 --- a/drivers/usb/serial/keyspan_pda.c +++ b/drivers/usb/serial/keyspan_pda.c | |||
| @@ -679,22 +679,6 @@ static void keyspan_pda_dtr_rts(struct usb_serial_port *port, int on) | |||
| 679 | } | 679 | } |
| 680 | } | 680 | } |
| 681 | 681 | ||
| 682 | static int keyspan_pda_carrier_raised(struct usb_serial_port *port) | ||
| 683 | { | ||
| 684 | struct usb_serial *serial = port->serial; | ||
| 685 | unsigned char modembits; | ||
| 686 | |||
| 687 | /* If we can read the modem status and the DCD is low then | ||
| 688 | carrier is not raised yet */ | ||
| 689 | if (keyspan_pda_get_modem_info(serial, &modembits) >= 0) { | ||
| 690 | if (!(modembits & (1>>6))) | ||
| 691 | return 0; | ||
| 692 | } | ||
| 693 | /* Carrier raised, or we failed (eg disconnected) so | ||
| 694 | progress accordingly */ | ||
| 695 | return 1; | ||
| 696 | } | ||
| 697 | |||
| 698 | 682 | ||
| 699 | static int keyspan_pda_open(struct tty_struct *tty, | 683 | static int keyspan_pda_open(struct tty_struct *tty, |
| 700 | struct usb_serial_port *port) | 684 | struct usb_serial_port *port) |
| @@ -881,7 +865,6 @@ static struct usb_serial_driver keyspan_pda_device = { | |||
| 881 | .id_table = id_table_std, | 865 | .id_table = id_table_std, |
| 882 | .num_ports = 1, | 866 | .num_ports = 1, |
| 883 | .dtr_rts = keyspan_pda_dtr_rts, | 867 | .dtr_rts = keyspan_pda_dtr_rts, |
| 884 | .carrier_raised = keyspan_pda_carrier_raised, | ||
| 885 | .open = keyspan_pda_open, | 868 | .open = keyspan_pda_open, |
| 886 | .close = keyspan_pda_close, | 869 | .close = keyspan_pda_close, |
| 887 | .write = keyspan_pda_write, | 870 | .write = keyspan_pda_write, |
diff --git a/drivers/usb/serial/moto_modem.c b/drivers/usb/serial/moto_modem.c index cf1718394e1..653465f61d4 100644 --- a/drivers/usb/serial/moto_modem.c +++ b/drivers/usb/serial/moto_modem.c | |||
| @@ -44,6 +44,7 @@ static struct usb_serial_driver moto_device = { | |||
| 44 | .name = "moto-modem", | 44 | .name = "moto-modem", |
| 45 | }, | 45 | }, |
| 46 | .id_table = id_table, | 46 | .id_table = id_table, |
| 47 | .usb_driver = &moto_driver, | ||
| 47 | .num_ports = 1, | 48 | .num_ports = 1, |
| 48 | }; | 49 | }; |
| 49 | 50 | ||
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 748778288d9..5f46838dfee 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
| @@ -382,7 +382,16 @@ static void option_instat_callback(struct urb *urb); | |||
| 382 | #define HAIER_VENDOR_ID 0x201e | 382 | #define HAIER_VENDOR_ID 0x201e |
| 383 | #define HAIER_PRODUCT_CE100 0x2009 | 383 | #define HAIER_PRODUCT_CE100 0x2009 |
| 384 | 384 | ||
| 385 | #define CINTERION_VENDOR_ID 0x0681 | 385 | /* Cinterion (formerly Siemens) products */ |
| 386 | #define SIEMENS_VENDOR_ID 0x0681 | ||
| 387 | #define CINTERION_VENDOR_ID 0x1e2d | ||
| 388 | #define CINTERION_PRODUCT_HC25_MDM 0x0047 | ||
| 389 | #define CINTERION_PRODUCT_HC25_MDMNET 0x0040 | ||
| 390 | #define CINTERION_PRODUCT_HC28_MDM 0x004C | ||
| 391 | #define CINTERION_PRODUCT_HC28_MDMNET 0x004A /* same for HC28J */ | ||
| 392 | #define CINTERION_PRODUCT_EU3_E 0x0051 | ||
| 393 | #define CINTERION_PRODUCT_EU3_P 0x0052 | ||
| 394 | #define CINTERION_PRODUCT_PH8 0x0053 | ||
| 386 | 395 | ||
| 387 | /* Olivetti products */ | 396 | /* Olivetti products */ |
| 388 | #define OLIVETTI_VENDOR_ID 0x0b3c | 397 | #define OLIVETTI_VENDOR_ID 0x0b3c |
| @@ -944,7 +953,17 @@ static const struct usb_device_id option_ids[] = { | |||
| 944 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100F) }, | 953 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100F) }, |
| 945 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1011)}, | 954 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1011)}, |
| 946 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1012)}, | 955 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1012)}, |
| 947 | { USB_DEVICE(CINTERION_VENDOR_ID, 0x0047) }, | 956 | /* Cinterion */ |
| 957 | { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EU3_E) }, | ||
| 958 | { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EU3_P) }, | ||
| 959 | { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PH8) }, | ||
| 960 | { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_HC28_MDM) }, | ||
| 961 | { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_HC28_MDMNET) }, | ||
| 962 | { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC25_MDM) }, | ||
| 963 | { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC25_MDMNET) }, | ||
| 964 | { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC28_MDM) }, /* HC28 enumerates with Siemens or Cinterion VID depending on FW revision */ | ||
| 965 | { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC28_MDMNET) }, | ||
| 966 | |||
| 948 | { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100) }, | 967 | { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100) }, |
| 949 | { USB_DEVICE(CELOT_VENDOR_ID, CELOT_PRODUCT_CT680M) }, /* CT-650 CDMA 450 1xEVDO modem */ | 968 | { USB_DEVICE(CELOT_VENDOR_ID, CELOT_PRODUCT_CT680M) }, /* CT-650 CDMA 450 1xEVDO modem */ |
| 950 | { USB_DEVICE(ONDA_VENDOR_ID, ONDA_MT825UP) }, /* ONDA MT825UP modem */ | 969 | { USB_DEVICE(ONDA_VENDOR_ID, ONDA_MT825UP) }, /* ONDA MT825UP modem */ |
diff --git a/drivers/usb/serial/oti6858.c b/drivers/usb/serial/oti6858.c index 5be866bb7a4..73613205be7 100644 --- a/drivers/usb/serial/oti6858.c +++ b/drivers/usb/serial/oti6858.c | |||
| @@ -157,6 +157,7 @@ static struct usb_serial_driver oti6858_device = { | |||
| 157 | .name = "oti6858", | 157 | .name = "oti6858", |
| 158 | }, | 158 | }, |
| 159 | .id_table = id_table, | 159 | .id_table = id_table, |
| 160 | .usb_driver = &oti6858_driver, | ||
| 160 | .num_ports = 1, | 161 | .num_ports = 1, |
| 161 | .open = oti6858_open, | 162 | .open = oti6858_open, |
| 162 | .close = oti6858_close, | 163 | .close = oti6858_close, |
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c index 8ae4c6cbc38..08c9181b8e4 100644 --- a/drivers/usb/serial/pl2303.c +++ b/drivers/usb/serial/pl2303.c | |||
| @@ -50,6 +50,7 @@ static const struct usb_device_id id_table[] = { | |||
| 50 | { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_MMX) }, | 50 | { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_MMX) }, |
| 51 | { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_GPRS) }, | 51 | { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_GPRS) }, |
| 52 | { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_HCR331) }, | 52 | { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_HCR331) }, |
| 53 | { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_MOTOROLA) }, | ||
| 53 | { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID) }, | 54 | { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID) }, |
| 54 | { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID_RSAQ5) }, | 55 | { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID_RSAQ5) }, |
| 55 | { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID) }, | 56 | { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID) }, |
| @@ -677,9 +678,11 @@ static void pl2303_update_line_status(struct usb_serial_port *port, | |||
| 677 | { | 678 | { |
| 678 | 679 | ||
| 679 | struct pl2303_private *priv = usb_get_serial_port_data(port); | 680 | struct pl2303_private *priv = usb_get_serial_port_data(port); |
| 681 | struct tty_struct *tty; | ||
| 680 | unsigned long flags; | 682 | unsigned long flags; |
| 681 | u8 status_idx = UART_STATE; | 683 | u8 status_idx = UART_STATE; |
| 682 | u8 length = UART_STATE + 1; | 684 | u8 length = UART_STATE + 1; |
| 685 | u8 prev_line_status; | ||
| 683 | u16 idv, idp; | 686 | u16 idv, idp; |
| 684 | 687 | ||
| 685 | idv = le16_to_cpu(port->serial->dev->descriptor.idVendor); | 688 | idv = le16_to_cpu(port->serial->dev->descriptor.idVendor); |
| @@ -701,11 +704,20 @@ static void pl2303_update_line_status(struct usb_serial_port *port, | |||
| 701 | 704 | ||
| 702 | /* Save off the uart status for others to look at */ | 705 | /* Save off the uart status for others to look at */ |
| 703 | spin_lock_irqsave(&priv->lock, flags); | 706 | spin_lock_irqsave(&priv->lock, flags); |
| 707 | prev_line_status = priv->line_status; | ||
| 704 | priv->line_status = data[status_idx]; | 708 | priv->line_status = data[status_idx]; |
| 705 | spin_unlock_irqrestore(&priv->lock, flags); | 709 | spin_unlock_irqrestore(&priv->lock, flags); |
| 706 | if (priv->line_status & UART_BREAK_ERROR) | 710 | if (priv->line_status & UART_BREAK_ERROR) |
| 707 | usb_serial_handle_break(port); | 711 | usb_serial_handle_break(port); |
| 708 | wake_up_interruptible(&priv->delta_msr_wait); | 712 | wake_up_interruptible(&priv->delta_msr_wait); |
| 713 | |||
| 714 | tty = tty_port_tty_get(&port->port); | ||
| 715 | if (!tty) | ||
| 716 | return; | ||
| 717 | if ((priv->line_status ^ prev_line_status) & UART_DCD) | ||
| 718 | usb_serial_handle_dcd_change(port, tty, | ||
| 719 | priv->line_status & UART_DCD); | ||
| 720 | tty_kref_put(tty); | ||
| 709 | } | 721 | } |
| 710 | 722 | ||
| 711 | static void pl2303_read_int_callback(struct urb *urb) | 723 | static void pl2303_read_int_callback(struct urb *urb) |
diff --git a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h index 43eb9bdad42..1b025f75daf 100644 --- a/drivers/usb/serial/pl2303.h +++ b/drivers/usb/serial/pl2303.h | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | #define PL2303_PRODUCT_ID_MMX 0x0612 | 21 | #define PL2303_PRODUCT_ID_MMX 0x0612 |
| 22 | #define PL2303_PRODUCT_ID_GPRS 0x0609 | 22 | #define PL2303_PRODUCT_ID_GPRS 0x0609 |
| 23 | #define PL2303_PRODUCT_ID_HCR331 0x331a | 23 | #define PL2303_PRODUCT_ID_HCR331 0x331a |
| 24 | #define PL2303_PRODUCT_ID_MOTOROLA 0x0307 | ||
| 24 | 25 | ||
| 25 | #define ATEN_VENDOR_ID 0x0557 | 26 | #define ATEN_VENDOR_ID 0x0557 |
| 26 | #define ATEN_VENDOR_ID2 0x0547 | 27 | #define ATEN_VENDOR_ID2 0x0547 |
diff --git a/drivers/usb/serial/qcaux.c b/drivers/usb/serial/qcaux.c index 214a3e50429..30b73e68a90 100644 --- a/drivers/usb/serial/qcaux.c +++ b/drivers/usb/serial/qcaux.c | |||
| @@ -36,6 +36,7 @@ | |||
| 36 | #define UTSTARCOM_PRODUCT_UM175_V1 0x3712 | 36 | #define UTSTARCOM_PRODUCT_UM175_V1 0x3712 |
| 37 | #define UTSTARCOM_PRODUCT_UM175_V2 0x3714 | 37 | #define UTSTARCOM_PRODUCT_UM175_V2 0x3714 |
| 38 | #define UTSTARCOM_PRODUCT_UM175_ALLTEL 0x3715 | 38 | #define UTSTARCOM_PRODUCT_UM175_ALLTEL 0x3715 |
| 39 | #define PANTECH_PRODUCT_UML290_VZW 0x3718 | ||
| 39 | 40 | ||
| 40 | /* CMOTECH devices */ | 41 | /* CMOTECH devices */ |
| 41 | #define CMOTECH_VENDOR_ID 0x16d8 | 42 | #define CMOTECH_VENDOR_ID 0x16d8 |
| @@ -66,6 +67,7 @@ static struct usb_device_id id_table[] = { | |||
| 66 | { USB_DEVICE_AND_INTERFACE_INFO(LG_VENDOR_ID, LG_PRODUCT_VX4400_6000, 0xff, 0xff, 0x00) }, | 67 | { USB_DEVICE_AND_INTERFACE_INFO(LG_VENDOR_ID, LG_PRODUCT_VX4400_6000, 0xff, 0xff, 0x00) }, |
| 67 | { USB_DEVICE_AND_INTERFACE_INFO(SANYO_VENDOR_ID, SANYO_PRODUCT_KATANA_LX, 0xff, 0xff, 0x00) }, | 68 | { USB_DEVICE_AND_INTERFACE_INFO(SANYO_VENDOR_ID, SANYO_PRODUCT_KATANA_LX, 0xff, 0xff, 0x00) }, |
| 68 | { USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_U520, 0xff, 0x00, 0x00) }, | 69 | { USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_U520, 0xff, 0x00, 0x00) }, |
| 70 | { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, PANTECH_PRODUCT_UML290_VZW, 0xff, 0xff, 0xff) }, | ||
| 69 | { }, | 71 | { }, |
| 70 | }; | 72 | }; |
| 71 | MODULE_DEVICE_TABLE(usb, id_table); | 73 | MODULE_DEVICE_TABLE(usb, id_table); |
| @@ -84,6 +86,7 @@ static struct usb_serial_driver qcaux_device = { | |||
| 84 | .name = "qcaux", | 86 | .name = "qcaux", |
| 85 | }, | 87 | }, |
| 86 | .id_table = id_table, | 88 | .id_table = id_table, |
| 89 | .usb_driver = &qcaux_driver, | ||
| 87 | .num_ports = 1, | 90 | .num_ports = 1, |
| 88 | }; | 91 | }; |
| 89 | 92 | ||
diff --git a/drivers/usb/serial/siemens_mpi.c b/drivers/usb/serial/siemens_mpi.c index cb8195cabfd..74cd4ccdb3f 100644 --- a/drivers/usb/serial/siemens_mpi.c +++ b/drivers/usb/serial/siemens_mpi.c | |||
| @@ -42,6 +42,7 @@ static struct usb_serial_driver siemens_usb_mpi_device = { | |||
| 42 | .name = "siemens_mpi", | 42 | .name = "siemens_mpi", |
| 43 | }, | 43 | }, |
| 44 | .id_table = id_table, | 44 | .id_table = id_table, |
| 45 | .usb_driver = &siemens_usb_mpi_driver, | ||
| 45 | .num_ports = 1, | 46 | .num_ports = 1, |
| 46 | }; | 47 | }; |
| 47 | 48 | ||
diff --git a/drivers/usb/serial/spcp8x5.c b/drivers/usb/serial/spcp8x5.c index 765aa983bf5..cbfb70bffdd 100644 --- a/drivers/usb/serial/spcp8x5.c +++ b/drivers/usb/serial/spcp8x5.c | |||
| @@ -133,7 +133,7 @@ struct spcp8x5_usb_ctrl_arg { | |||
| 133 | 133 | ||
| 134 | /* how come ??? */ | 134 | /* how come ??? */ |
| 135 | #define UART_STATE 0x08 | 135 | #define UART_STATE 0x08 |
| 136 | #define UART_STATE_TRANSIENT_MASK 0x74 | 136 | #define UART_STATE_TRANSIENT_MASK 0x75 |
| 137 | #define UART_DCD 0x01 | 137 | #define UART_DCD 0x01 |
| 138 | #define UART_DSR 0x02 | 138 | #define UART_DSR 0x02 |
| 139 | #define UART_BREAK_ERROR 0x04 | 139 | #define UART_BREAK_ERROR 0x04 |
| @@ -525,6 +525,10 @@ static void spcp8x5_process_read_urb(struct urb *urb) | |||
| 525 | /* overrun is special, not associated with a char */ | 525 | /* overrun is special, not associated with a char */ |
| 526 | if (status & UART_OVERRUN_ERROR) | 526 | if (status & UART_OVERRUN_ERROR) |
| 527 | tty_insert_flip_char(tty, 0, TTY_OVERRUN); | 527 | tty_insert_flip_char(tty, 0, TTY_OVERRUN); |
| 528 | |||
| 529 | if (status & UART_DCD) | ||
| 530 | usb_serial_handle_dcd_change(port, tty, | ||
| 531 | priv->line_status & MSR_STATUS_LINE_DCD); | ||
| 528 | } | 532 | } |
| 529 | 533 | ||
| 530 | tty_insert_flip_string_fixed_flag(tty, data, tty_flag, | 534 | tty_insert_flip_string_fixed_flag(tty, data, tty_flag, |
| @@ -645,6 +649,7 @@ static struct usb_serial_driver spcp8x5_device = { | |||
| 645 | .name = "SPCP8x5", | 649 | .name = "SPCP8x5", |
| 646 | }, | 650 | }, |
| 647 | .id_table = id_table, | 651 | .id_table = id_table, |
| 652 | .usb_driver = &spcp8x5_driver, | ||
| 648 | .num_ports = 1, | 653 | .num_ports = 1, |
| 649 | .open = spcp8x5_open, | 654 | .open = spcp8x5_open, |
| 650 | .dtr_rts = spcp8x5_dtr_rts, | 655 | .dtr_rts = spcp8x5_dtr_rts, |
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 6954de50c0f..546a52179be 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c | |||
| @@ -1344,11 +1344,15 @@ int usb_serial_register(struct usb_serial_driver *driver) | |||
| 1344 | return -ENODEV; | 1344 | return -ENODEV; |
| 1345 | 1345 | ||
| 1346 | fixup_generic(driver); | 1346 | fixup_generic(driver); |
| 1347 | if (driver->usb_driver) | ||
| 1348 | driver->usb_driver->supports_autosuspend = 1; | ||
| 1349 | 1347 | ||
| 1350 | if (!driver->description) | 1348 | if (!driver->description) |
| 1351 | driver->description = driver->driver.name; | 1349 | driver->description = driver->driver.name; |
| 1350 | if (!driver->usb_driver) { | ||
| 1351 | WARN(1, "Serial driver %s has no usb_driver\n", | ||
| 1352 | driver->description); | ||
| 1353 | return -EINVAL; | ||
| 1354 | } | ||
| 1355 | driver->usb_driver->supports_autosuspend = 1; | ||
| 1352 | 1356 | ||
| 1353 | /* Add this device to our list of devices */ | 1357 | /* Add this device to our list of devices */ |
| 1354 | mutex_lock(&table_lock); | 1358 | mutex_lock(&table_lock); |
diff --git a/drivers/usb/serial/usb_debug.c b/drivers/usb/serial/usb_debug.c index f2ed6a31be7..95a82148ee8 100644 --- a/drivers/usb/serial/usb_debug.c +++ b/drivers/usb/serial/usb_debug.c | |||
| @@ -75,6 +75,7 @@ static struct usb_serial_driver debug_device = { | |||
| 75 | .name = "debug", | 75 | .name = "debug", |
| 76 | }, | 76 | }, |
| 77 | .id_table = id_table, | 77 | .id_table = id_table, |
| 78 | .usb_driver = &debug_driver, | ||
| 78 | .num_ports = 1, | 79 | .num_ports = 1, |
| 79 | .bulk_out_size = USB_DEBUG_MAX_PACKET_SIZE, | 80 | .bulk_out_size = USB_DEBUG_MAX_PACKET_SIZE, |
| 80 | .break_ctl = usb_debug_break_ctl, | 81 | .break_ctl = usb_debug_break_ctl, |
diff --git a/drivers/usb/storage/unusual_cypress.h b/drivers/usb/storage/unusual_cypress.h index c854fdebe0a..2c855302622 100644 --- a/drivers/usb/storage/unusual_cypress.h +++ b/drivers/usb/storage/unusual_cypress.h | |||
| @@ -31,4 +31,9 @@ UNUSUAL_DEV( 0x04b4, 0x6831, 0x0000, 0x9999, | |||
| 31 | "Cypress ISD-300LP", | 31 | "Cypress ISD-300LP", |
| 32 | USB_SC_CYP_ATACB, USB_PR_DEVICE, NULL, 0), | 32 | USB_SC_CYP_ATACB, USB_PR_DEVICE, NULL, 0), |
| 33 | 33 | ||
| 34 | UNUSUAL_DEV( 0x14cd, 0x6116, 0x0000, 0x9999, | ||
| 35 | "Super Top", | ||
| 36 | "USB 2.0 SATA BRIDGE", | ||
| 37 | USB_SC_CYP_ATACB, USB_PR_DEVICE, NULL, 0), | ||
| 38 | |||
| 34 | #endif /* defined(CONFIG_USB_STORAGE_CYPRESS_ATACB) || ... */ | 39 | #endif /* defined(CONFIG_USB_STORAGE_CYPRESS_ATACB) || ... */ |
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h index fcc1e32ce25..24bd5d7c3de 100644 --- a/drivers/usb/storage/unusual_devs.h +++ b/drivers/usb/storage/unusual_devs.h | |||
| @@ -1044,6 +1044,15 @@ UNUSUAL_DEV( 0x084d, 0x0011, 0x0110, 0x0110, | |||
| 1044 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, | 1044 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, |
| 1045 | US_FL_BULK32), | 1045 | US_FL_BULK32), |
| 1046 | 1046 | ||
| 1047 | /* Reported by <ttkspam@free.fr> | ||
| 1048 | * The device reports a vendor-specific device class, requiring an | ||
| 1049 | * explicit vendor/product match. | ||
| 1050 | */ | ||
| 1051 | UNUSUAL_DEV( 0x0851, 0x1542, 0x0002, 0x0002, | ||
| 1052 | "MagicPixel", | ||
| 1053 | "FW_Omega2", | ||
| 1054 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, 0), | ||
| 1055 | |||
| 1047 | /* Andrew Lunn <andrew@lunn.ch> | 1056 | /* Andrew Lunn <andrew@lunn.ch> |
| 1048 | * PanDigital Digital Picture Frame. Does not like ALLOW_MEDIUM_REMOVAL | 1057 | * PanDigital Digital Picture Frame. Does not like ALLOW_MEDIUM_REMOVAL |
| 1049 | * on LUN 4. | 1058 | * on LUN 4. |
| @@ -1872,6 +1881,15 @@ UNUSUAL_DEV( 0x1908, 0x3335, 0x0200, 0x0200, | |||
| 1872 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, | 1881 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, |
| 1873 | US_FL_NO_READ_DISC_INFO ), | 1882 | US_FL_NO_READ_DISC_INFO ), |
| 1874 | 1883 | ||
| 1884 | /* Patch by Richard Schütz <r.schtz@t-online.de> | ||
| 1885 | * This external hard drive enclosure uses a JMicron chip which | ||
| 1886 | * needs the US_FL_IGNORE_RESIDUE flag to work properly. */ | ||
| 1887 | UNUSUAL_DEV( 0x1e68, 0x001b, 0x0000, 0x0000, | ||
| 1888 | "TrekStor GmbH & Co. KG", | ||
| 1889 | "DataStation maxi g.u", | ||
| 1890 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, | ||
| 1891 | US_FL_IGNORE_RESIDUE | US_FL_SANE_SENSE ), | ||
| 1892 | |||
| 1875 | UNUSUAL_DEV( 0x2116, 0x0320, 0x0001, 0x0001, | 1893 | UNUSUAL_DEV( 0x2116, 0x0320, 0x0001, 0x0001, |
| 1876 | "ST", | 1894 | "ST", |
| 1877 | "2A", | 1895 | "2A", |
