diff options
Diffstat (limited to 'drivers')
100 files changed, 778 insertions, 339 deletions
diff --git a/drivers/ata/pata_pcmcia.c b/drivers/ata/pata_pcmcia.c index 4164dd244dd0..d94b8f0bd743 100644 --- a/drivers/ata/pata_pcmcia.c +++ b/drivers/ata/pata_pcmcia.c | |||
| @@ -424,7 +424,7 @@ static struct pcmcia_device_id pcmcia_devices[] = { | |||
| 424 | PCMCIA_DEVICE_PROD_ID12("Hyperstone", "Model1", 0x3d5b9ef5, 0xca6ab420), | 424 | PCMCIA_DEVICE_PROD_ID12("Hyperstone", "Model1", 0x3d5b9ef5, 0xca6ab420), |
| 425 | PCMCIA_DEVICE_PROD_ID12("IBM", "microdrive", 0xb569a6e5, 0xa6d76178), | 425 | PCMCIA_DEVICE_PROD_ID12("IBM", "microdrive", 0xb569a6e5, 0xa6d76178), |
| 426 | PCMCIA_DEVICE_PROD_ID12("IBM", "IBM17JSSFP20", 0xb569a6e5, 0xf2508753), | 426 | PCMCIA_DEVICE_PROD_ID12("IBM", "IBM17JSSFP20", 0xb569a6e5, 0xf2508753), |
| 427 | PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF CARD 1GB", 0x2e6d1829, 0x3e520e17), | 427 | PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF CARD 1GB", 0x2e6d1829, 0x55d5bffb), |
| 428 | PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF CARD 4GB", 0x2e6d1829, 0x531e7d10), | 428 | PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF CARD 4GB", 0x2e6d1829, 0x531e7d10), |
| 429 | PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF8GB", 0x2e6d1829, 0xacbe682e), | 429 | PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF8GB", 0x2e6d1829, 0xacbe682e), |
| 430 | PCMCIA_DEVICE_PROD_ID12("IO DATA", "CBIDE2 ", 0x547e66dc, 0x8671043b), | 430 | PCMCIA_DEVICE_PROD_ID12("IO DATA", "CBIDE2 ", 0x547e66dc, 0x8671043b), |
| @@ -446,7 +446,7 @@ static struct pcmcia_device_id pcmcia_devices[] = { | |||
| 446 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS1GCF80", 0x709b1bf1, 0x2a54d4b1), | 446 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS1GCF80", 0x709b1bf1, 0x2a54d4b1), |
| 447 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS2GCF120", 0x709b1bf1, 0x969aa4f2), | 447 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS2GCF120", 0x709b1bf1, 0x969aa4f2), |
| 448 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF120", 0x709b1bf1, 0xf54a91c8), | 448 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF120", 0x709b1bf1, 0xf54a91c8), |
| 449 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF133", 0x709b1bf1, 0x9351e59d), | 449 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF133", 0x709b1bf1, 0x7558f133), |
| 450 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS8GCF133", 0x709b1bf1, 0xb2f89b47), | 450 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS8GCF133", 0x709b1bf1, 0xb2f89b47), |
| 451 | PCMCIA_DEVICE_PROD_ID12("WIT", "IDE16", 0x244e5994, 0x3e232852), | 451 | PCMCIA_DEVICE_PROD_ID12("WIT", "IDE16", 0x244e5994, 0x3e232852), |
| 452 | PCMCIA_DEVICE_PROD_ID12("WEIDA", "TWTTI", 0xcc7cf69c, 0x212bb918), | 452 | PCMCIA_DEVICE_PROD_ID12("WEIDA", "TWTTI", 0xcc7cf69c, 0x212bb918), |
diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c index 0fa2e4a0835d..c1ab303455cf 100644 --- a/drivers/char/isicom.c +++ b/drivers/char/isicom.c | |||
| @@ -879,8 +879,8 @@ static int isicom_open(struct tty_struct *tty, struct file *filp) | |||
| 879 | if (tport == NULL) | 879 | if (tport == NULL) |
| 880 | return -ENODEV; | 880 | return -ENODEV; |
| 881 | port = container_of(tport, struct isi_port, port); | 881 | port = container_of(tport, struct isi_port, port); |
| 882 | card = &isi_card[BOARD(tty->index)]; | ||
| 883 | 882 | ||
| 883 | tty->driver_data = port; | ||
| 884 | return tty_port_open(tport, tty, filp); | 884 | return tty_port_open(tport, tty, filp); |
| 885 | } | 885 | } |
| 886 | 886 | ||
| @@ -936,7 +936,12 @@ static void isicom_shutdown(struct tty_port *port) | |||
| 936 | static void isicom_close(struct tty_struct *tty, struct file *filp) | 936 | static void isicom_close(struct tty_struct *tty, struct file *filp) |
| 937 | { | 937 | { |
| 938 | struct isi_port *ip = tty->driver_data; | 938 | struct isi_port *ip = tty->driver_data; |
| 939 | struct tty_port *port = &ip->port; | 939 | struct tty_port *port; |
| 940 | |||
| 941 | if (ip == NULL) | ||
| 942 | return; | ||
| 943 | |||
| 944 | port = &ip->port; | ||
| 940 | if (isicom_paranoia_check(ip, tty->name, "isicom_close")) | 945 | if (isicom_paranoia_check(ip, tty->name, "isicom_close")) |
| 941 | return; | 946 | return; |
| 942 | tty_port_close(port, tty, filp); | 947 | tty_port_close(port, tty, filp); |
diff --git a/drivers/char/istallion.c b/drivers/char/istallion.c index 4cd6c527ee41..4e395c956a09 100644 --- a/drivers/char/istallion.c +++ b/drivers/char/istallion.c | |||
| @@ -827,6 +827,8 @@ static int stli_open(struct tty_struct *tty, struct file *filp) | |||
| 827 | return -ENODEV; | 827 | return -ENODEV; |
| 828 | if (portp->devnr < 1) | 828 | if (portp->devnr < 1) |
| 829 | return -ENODEV; | 829 | return -ENODEV; |
| 830 | |||
| 831 | tty->driver_data = portp; | ||
| 830 | return tty_port_open(&portp->port, tty, filp); | 832 | return tty_port_open(&portp->port, tty, filp); |
| 831 | } | 833 | } |
| 832 | 834 | ||
diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c index 47023053ee85..d2692d443f7b 100644 --- a/drivers/char/mxser.c +++ b/drivers/char/mxser.c | |||
| @@ -1011,6 +1011,7 @@ static int mxser_open(struct tty_struct *tty, struct file *filp) | |||
| 1011 | if (!info->ioaddr) | 1011 | if (!info->ioaddr) |
| 1012 | return -ENODEV; | 1012 | return -ENODEV; |
| 1013 | 1013 | ||
| 1014 | tty->driver_data = info; | ||
| 1014 | return tty_port_open(&info->port, tty, filp); | 1015 | return tty_port_open(&info->port, tty, filp); |
| 1015 | } | 1016 | } |
| 1016 | 1017 | ||
| @@ -1074,7 +1075,7 @@ static void mxser_close(struct tty_struct *tty, struct file *filp) | |||
| 1074 | struct mxser_port *info = tty->driver_data; | 1075 | struct mxser_port *info = tty->driver_data; |
| 1075 | struct tty_port *port = &info->port; | 1076 | struct tty_port *port = &info->port; |
| 1076 | 1077 | ||
| 1077 | if (tty->index == MXSER_PORTS) | 1078 | if (tty->index == MXSER_PORTS || info == NULL) |
| 1078 | return; | 1079 | return; |
| 1079 | if (tty_port_close_start(port, tty, filp) == 0) | 1080 | if (tty_port_close_start(port, tty, filp) == 0) |
| 1080 | return; | 1081 | return; |
diff --git a/drivers/char/riscom8.c b/drivers/char/riscom8.c index 0a8d1e56c993..b02332a5412f 100644 --- a/drivers/char/riscom8.c +++ b/drivers/char/riscom8.c | |||
| @@ -909,6 +909,7 @@ static int rc_open(struct tty_struct *tty, struct file *filp) | |||
| 909 | if (error) | 909 | if (error) |
| 910 | return error; | 910 | return error; |
| 911 | 911 | ||
| 912 | tty->driver_data = port; | ||
| 912 | return tty_port_open(&port->port, tty, filp); | 913 | return tty_port_open(&port->port, tty, filp); |
| 913 | } | 914 | } |
| 914 | 915 | ||
diff --git a/drivers/char/stallion.c b/drivers/char/stallion.c index 0e511d61f544..6049fd731924 100644 --- a/drivers/char/stallion.c +++ b/drivers/char/stallion.c | |||
| @@ -724,7 +724,6 @@ static int stl_open(struct tty_struct *tty, struct file *filp) | |||
| 724 | { | 724 | { |
| 725 | struct stlport *portp; | 725 | struct stlport *portp; |
| 726 | struct stlbrd *brdp; | 726 | struct stlbrd *brdp; |
| 727 | struct tty_port *port; | ||
| 728 | unsigned int minordev, brdnr, panelnr; | 727 | unsigned int minordev, brdnr, panelnr; |
| 729 | int portnr; | 728 | int portnr; |
| 730 | 729 | ||
| @@ -754,7 +753,8 @@ static int stl_open(struct tty_struct *tty, struct file *filp) | |||
| 754 | portp = brdp->panels[panelnr]->ports[portnr]; | 753 | portp = brdp->panels[panelnr]->ports[portnr]; |
| 755 | if (portp == NULL) | 754 | if (portp == NULL) |
| 756 | return -ENODEV; | 755 | return -ENODEV; |
| 757 | port = &portp->port; | 756 | |
| 757 | tty->driver_data = portp; | ||
| 758 | return tty_port_open(&portp->port, tty, filp); | 758 | return tty_port_open(&portp->port, tty, filp); |
| 759 | 759 | ||
| 760 | } | 760 | } |
| @@ -841,7 +841,8 @@ static void stl_close(struct tty_struct *tty, struct file *filp) | |||
| 841 | pr_debug("stl_close(tty=%p,filp=%p)\n", tty, filp); | 841 | pr_debug("stl_close(tty=%p,filp=%p)\n", tty, filp); |
| 842 | 842 | ||
| 843 | portp = tty->driver_data; | 843 | portp = tty->driver_data; |
| 844 | BUG_ON(portp == NULL); | 844 | if(portp == NULL) |
| 845 | return; | ||
| 845 | tty_port_close(&portp->port, tty, filp); | 846 | tty_port_close(&portp->port, tty, filp); |
| 846 | } | 847 | } |
| 847 | 848 | ||
diff --git a/drivers/dma/txx9dmac.c b/drivers/dma/txx9dmac.c index 3ebc61067e54..75fcf1ac8bb7 100644 --- a/drivers/dma/txx9dmac.c +++ b/drivers/dma/txx9dmac.c | |||
| @@ -1359,3 +1359,5 @@ module_exit(txx9dmac_exit); | |||
| 1359 | MODULE_LICENSE("GPL"); | 1359 | MODULE_LICENSE("GPL"); |
| 1360 | MODULE_DESCRIPTION("TXx9 DMA Controller driver"); | 1360 | MODULE_DESCRIPTION("TXx9 DMA Controller driver"); |
| 1361 | MODULE_AUTHOR("Atsushi Nemoto <anemo@mba.ocn.ne.jp>"); | 1361 | MODULE_AUTHOR("Atsushi Nemoto <anemo@mba.ocn.ne.jp>"); |
| 1362 | MODULE_ALIAS("platform:txx9dmac"); | ||
| 1363 | MODULE_ALIAS("platform:txx9dmac-chan"); | ||
diff --git a/drivers/edac/edac_mce_amd.c b/drivers/edac/edac_mce_amd.c index f5b6d9fe4def..97e64bcdbc06 100644 --- a/drivers/edac/edac_mce_amd.c +++ b/drivers/edac/edac_mce_amd.c | |||
| @@ -294,7 +294,6 @@ wrong_ls_mce: | |||
| 294 | void amd_decode_nb_mce(int node_id, struct err_regs *regs, int handle_errors) | 294 | void amd_decode_nb_mce(int node_id, struct err_regs *regs, int handle_errors) |
| 295 | { | 295 | { |
| 296 | u32 ec = ERROR_CODE(regs->nbsl); | 296 | u32 ec = ERROR_CODE(regs->nbsl); |
| 297 | u32 xec = EXT_ERROR_CODE(regs->nbsl); | ||
| 298 | 297 | ||
| 299 | if (!handle_errors) | 298 | if (!handle_errors) |
| 300 | return; | 299 | return; |
| @@ -324,7 +323,7 @@ void amd_decode_nb_mce(int node_id, struct err_regs *regs, int handle_errors) | |||
| 324 | pr_cont("\n"); | 323 | pr_cont("\n"); |
| 325 | } | 324 | } |
| 326 | 325 | ||
| 327 | pr_emerg("%s.\n", EXT_ERR_MSG(xec)); | 326 | pr_emerg("%s.\n", EXT_ERR_MSG(regs->nbsl)); |
| 328 | 327 | ||
| 329 | if (BUS_ERROR(ec) && nb_bus_decoder) | 328 | if (BUS_ERROR(ec) && nb_bus_decoder) |
| 330 | nb_bus_decoder(node_id, regs); | 329 | nb_bus_decoder(node_id, regs); |
| @@ -374,7 +373,7 @@ static int amd_decode_mce(struct notifier_block *nb, unsigned long val, | |||
| 374 | ((m->status & MCI_STATUS_PCC) ? "yes" : "no")); | 373 | ((m->status & MCI_STATUS_PCC) ? "yes" : "no")); |
| 375 | 374 | ||
| 376 | /* do the two bits[14:13] together */ | 375 | /* do the two bits[14:13] together */ |
| 377 | ecc = m->status & (3ULL << 45); | 376 | ecc = (m->status >> 45) & 0x3; |
| 378 | if (ecc) | 377 | if (ecc) |
| 379 | pr_cont(", %sECC Error", ((ecc == 2) ? "C" : "U")); | 378 | pr_cont(", %sECC Error", ((ecc == 2) ? "C" : "U")); |
| 380 | 379 | ||
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 76be229c814d..eb0c3fe44b29 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c | |||
| @@ -416,7 +416,8 @@ static int gpio_setup_irq(struct gpio_desc *desc, struct device *dev, | |||
| 416 | return 0; | 416 | return 0; |
| 417 | 417 | ||
| 418 | free_sd: | 418 | free_sd: |
| 419 | sysfs_put(pdesc->value_sd); | 419 | if (pdesc) |
| 420 | sysfs_put(pdesc->value_sd); | ||
| 420 | free_id: | 421 | free_id: |
| 421 | idr_remove(&pdesc_idr, id); | 422 | idr_remove(&pdesc_idr, id); |
| 422 | desc->flags &= GPIO_FLAGS_MASK; | 423 | desc->flags &= GPIO_FLAGS_MASK; |
diff --git a/drivers/gpu/drm/drm_memory.c b/drivers/gpu/drm/drm_memory.c index e4865f99989c..7732268eced2 100644 --- a/drivers/gpu/drm/drm_memory.c +++ b/drivers/gpu/drm/drm_memory.c | |||
| @@ -77,7 +77,7 @@ static void *agp_remap(unsigned long offset, unsigned long size, | |||
| 77 | && (agpmem->bound + (agpmem->pages << PAGE_SHIFT)) >= | 77 | && (agpmem->bound + (agpmem->pages << PAGE_SHIFT)) >= |
| 78 | (offset + size)) | 78 | (offset + size)) |
| 79 | break; | 79 | break; |
| 80 | if (!agpmem) | 80 | if (&agpmem->head == &dev->agp->memory) |
| 81 | return NULL; | 81 | return NULL; |
| 82 | 82 | ||
| 83 | /* | 83 | /* |
diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c index 1a1825b29f5f..25bbd30ed7af 100644 --- a/drivers/gpu/drm/drm_sysfs.c +++ b/drivers/gpu/drm/drm_sysfs.c | |||
| @@ -354,7 +354,10 @@ static struct bin_attribute edid_attr = { | |||
| 354 | int drm_sysfs_connector_add(struct drm_connector *connector) | 354 | int drm_sysfs_connector_add(struct drm_connector *connector) |
| 355 | { | 355 | { |
| 356 | struct drm_device *dev = connector->dev; | 356 | struct drm_device *dev = connector->dev; |
| 357 | int ret = 0, i, j; | 357 | int attr_cnt = 0; |
| 358 | int opt_cnt = 0; | ||
| 359 | int i; | ||
| 360 | int ret = 0; | ||
| 358 | 361 | ||
| 359 | /* We shouldn't get called more than once for the same connector */ | 362 | /* We shouldn't get called more than once for the same connector */ |
| 360 | BUG_ON(device_is_registered(&connector->kdev)); | 363 | BUG_ON(device_is_registered(&connector->kdev)); |
| @@ -377,8 +380,8 @@ int drm_sysfs_connector_add(struct drm_connector *connector) | |||
| 377 | 380 | ||
| 378 | /* Standard attributes */ | 381 | /* Standard attributes */ |
| 379 | 382 | ||
| 380 | for (i = 0; i < ARRAY_SIZE(connector_attrs); i++) { | 383 | for (attr_cnt = 0; attr_cnt < ARRAY_SIZE(connector_attrs); attr_cnt++) { |
| 381 | ret = device_create_file(&connector->kdev, &connector_attrs[i]); | 384 | ret = device_create_file(&connector->kdev, &connector_attrs[attr_cnt]); |
| 382 | if (ret) | 385 | if (ret) |
| 383 | goto err_out_files; | 386 | goto err_out_files; |
| 384 | } | 387 | } |
| @@ -394,8 +397,8 @@ int drm_sysfs_connector_add(struct drm_connector *connector) | |||
| 394 | case DRM_MODE_CONNECTOR_SVIDEO: | 397 | case DRM_MODE_CONNECTOR_SVIDEO: |
| 395 | case DRM_MODE_CONNECTOR_Component: | 398 | case DRM_MODE_CONNECTOR_Component: |
| 396 | case DRM_MODE_CONNECTOR_TV: | 399 | case DRM_MODE_CONNECTOR_TV: |
| 397 | for (i = 0; i < ARRAY_SIZE(connector_attrs_opt1); i++) { | 400 | for (opt_cnt = 0; opt_cnt < ARRAY_SIZE(connector_attrs_opt1); opt_cnt++) { |
| 398 | ret = device_create_file(&connector->kdev, &connector_attrs_opt1[i]); | 401 | ret = device_create_file(&connector->kdev, &connector_attrs_opt1[opt_cnt]); |
| 399 | if (ret) | 402 | if (ret) |
| 400 | goto err_out_files; | 403 | goto err_out_files; |
| 401 | } | 404 | } |
| @@ -414,10 +417,10 @@ int drm_sysfs_connector_add(struct drm_connector *connector) | |||
| 414 | return 0; | 417 | return 0; |
| 415 | 418 | ||
| 416 | err_out_files: | 419 | err_out_files: |
| 417 | if (i > 0) | 420 | for (i = 0; i < opt_cnt; i++) |
| 418 | for (j = 0; j < i; j++) | 421 | device_remove_file(&connector->kdev, &connector_attrs_opt1[i]); |
| 419 | device_remove_file(&connector->kdev, | 422 | for (i = 0; i < attr_cnt; i++) |
| 420 | &connector_attrs[i]); | 423 | device_remove_file(&connector->kdev, &connector_attrs[i]); |
| 421 | device_unregister(&connector->kdev); | 424 | device_unregister(&connector->kdev); |
| 422 | 425 | ||
| 423 | out: | 426 | out: |
diff --git a/drivers/gpu/drm/radeon/atombios.h b/drivers/gpu/drm/radeon/atombios.h index 6732b5dd8ff4..27e2c715be11 100644 --- a/drivers/gpu/drm/radeon/atombios.h +++ b/drivers/gpu/drm/radeon/atombios.h | |||
| @@ -2912,7 +2912,7 @@ typedef struct _ATOM_ANALOG_TV_INFO_V1_2 | |||
| 2912 | UCHAR ucTV_BootUpDefaultStandard; | 2912 | UCHAR ucTV_BootUpDefaultStandard; |
| 2913 | UCHAR ucExt_TV_ASIC_ID; | 2913 | UCHAR ucExt_TV_ASIC_ID; |
| 2914 | UCHAR ucExt_TV_ASIC_SlaveAddr; | 2914 | UCHAR ucExt_TV_ASIC_SlaveAddr; |
| 2915 | ATOM_DTD_FORMAT aModeTimings[MAX_SUPPORTED_TV_TIMING]; | 2915 | ATOM_DTD_FORMAT aModeTimings[MAX_SUPPORTED_TV_TIMING_V1_2]; |
| 2916 | }ATOM_ANALOG_TV_INFO_V1_2; | 2916 | }ATOM_ANALOG_TV_INFO_V1_2; |
| 2917 | 2917 | ||
| 2918 | typedef struct _ATOM_DPCD_INFO | 2918 | typedef struct _ATOM_DPCD_INFO |
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c index d7388fdb6d0b..cf60c0b3ef15 100644 --- a/drivers/gpu/drm/radeon/r100.c +++ b/drivers/gpu/drm/radeon/r100.c | |||
| @@ -2975,7 +2975,7 @@ int r100_cs_track_check(struct radeon_device *rdev, struct r100_cs_track *track) | |||
| 2975 | 2975 | ||
| 2976 | for (i = 0; i < track->num_cb; i++) { | 2976 | for (i = 0; i < track->num_cb; i++) { |
| 2977 | if (track->cb[i].robj == NULL) { | 2977 | if (track->cb[i].robj == NULL) { |
| 2978 | if (!(track->fastfill || track->color_channel_mask || | 2978 | if (!(track->zb_cb_clear || track->color_channel_mask || |
| 2979 | track->blend_read_enable)) { | 2979 | track->blend_read_enable)) { |
| 2980 | continue; | 2980 | continue; |
| 2981 | } | 2981 | } |
diff --git a/drivers/gpu/drm/radeon/r100_track.h b/drivers/gpu/drm/radeon/r100_track.h index fadfe68de9cc..f47cdca1c004 100644 --- a/drivers/gpu/drm/radeon/r100_track.h +++ b/drivers/gpu/drm/radeon/r100_track.h | |||
| @@ -75,7 +75,7 @@ struct r100_cs_track { | |||
| 75 | struct r100_cs_track_texture textures[R300_TRACK_MAX_TEXTURE]; | 75 | struct r100_cs_track_texture textures[R300_TRACK_MAX_TEXTURE]; |
| 76 | bool z_enabled; | 76 | bool z_enabled; |
| 77 | bool separate_cube; | 77 | bool separate_cube; |
| 78 | bool fastfill; | 78 | bool zb_cb_clear; |
| 79 | bool blend_read_enable; | 79 | bool blend_read_enable; |
| 80 | }; | 80 | }; |
| 81 | 81 | ||
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c index eaf1f6bc44f1..a5ff8076b423 100644 --- a/drivers/gpu/drm/radeon/r300.c +++ b/drivers/gpu/drm/radeon/r300.c | |||
| @@ -1044,7 +1044,7 @@ static int r300_packet0_check(struct radeon_cs_parser *p, | |||
| 1044 | break; | 1044 | break; |
| 1045 | case 0x4d1c: | 1045 | case 0x4d1c: |
| 1046 | /* ZB_BW_CNTL */ | 1046 | /* ZB_BW_CNTL */ |
| 1047 | track->fastfill = !!(idx_value & (1 << 2)); | 1047 | track->zb_cb_clear = !!(idx_value & (1 << 5)); |
| 1048 | break; | 1048 | break; |
| 1049 | case 0x4e04: | 1049 | case 0x4e04: |
| 1050 | /* RB3D_BLENDCNTL */ | 1050 | /* RB3D_BLENDCNTL */ |
diff --git a/drivers/gpu/drm/radeon/radeon_agp.c b/drivers/gpu/drm/radeon/radeon_agp.c index c4457791dff1..28e473f1f56f 100644 --- a/drivers/gpu/drm/radeon/radeon_agp.c +++ b/drivers/gpu/drm/radeon/radeon_agp.c | |||
| @@ -134,12 +134,10 @@ int radeon_agp_init(struct radeon_device *rdev) | |||
| 134 | int ret; | 134 | int ret; |
| 135 | 135 | ||
| 136 | /* Acquire AGP. */ | 136 | /* Acquire AGP. */ |
| 137 | if (!rdev->ddev->agp->acquired) { | 137 | ret = drm_agp_acquire(rdev->ddev); |
| 138 | ret = drm_agp_acquire(rdev->ddev); | 138 | if (ret) { |
| 139 | if (ret) { | 139 | DRM_ERROR("Unable to acquire AGP: %d\n", ret); |
| 140 | DRM_ERROR("Unable to acquire AGP: %d\n", ret); | 140 | return ret; |
| 141 | return ret; | ||
| 142 | } | ||
| 143 | } | 141 | } |
| 144 | 142 | ||
| 145 | ret = drm_agp_info(rdev->ddev, &info); | 143 | ret = drm_agp_info(rdev->ddev, &info); |
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c index 5673665ff216..9916d825401c 100644 --- a/drivers/gpu/drm/radeon/radeon_atombios.c +++ b/drivers/gpu/drm/radeon/radeon_atombios.c | |||
| @@ -1264,7 +1264,7 @@ bool radeon_atom_get_tv_timings(struct radeon_device *rdev, int index, | |||
| 1264 | switch (crev) { | 1264 | switch (crev) { |
| 1265 | case 1: | 1265 | case 1: |
| 1266 | tv_info = (ATOM_ANALOG_TV_INFO *)(mode_info->atom_context->bios + data_offset); | 1266 | tv_info = (ATOM_ANALOG_TV_INFO *)(mode_info->atom_context->bios + data_offset); |
| 1267 | if (index > MAX_SUPPORTED_TV_TIMING) | 1267 | if (index >= MAX_SUPPORTED_TV_TIMING) |
| 1268 | return false; | 1268 | return false; |
| 1269 | 1269 | ||
| 1270 | mode->crtc_htotal = le16_to_cpu(tv_info->aModeTimings[index].usCRTC_H_Total); | 1270 | mode->crtc_htotal = le16_to_cpu(tv_info->aModeTimings[index].usCRTC_H_Total); |
| @@ -1302,7 +1302,7 @@ bool radeon_atom_get_tv_timings(struct radeon_device *rdev, int index, | |||
| 1302 | break; | 1302 | break; |
| 1303 | case 2: | 1303 | case 2: |
| 1304 | tv_info_v1_2 = (ATOM_ANALOG_TV_INFO_V1_2 *)(mode_info->atom_context->bios + data_offset); | 1304 | tv_info_v1_2 = (ATOM_ANALOG_TV_INFO_V1_2 *)(mode_info->atom_context->bios + data_offset); |
| 1305 | if (index > MAX_SUPPORTED_TV_TIMING_V1_2) | 1305 | if (index >= MAX_SUPPORTED_TV_TIMING_V1_2) |
| 1306 | return false; | 1306 | return false; |
| 1307 | 1307 | ||
| 1308 | dtd_timings = &tv_info_v1_2->aModeTimings[index]; | 1308 | dtd_timings = &tv_info_v1_2->aModeTimings[index]; |
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index 1331351c5178..4559a53d5e57 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c | |||
| @@ -1316,6 +1316,8 @@ radeon_add_legacy_connector(struct drm_device *dev, | |||
| 1316 | radeon_connector->ddc_bus = radeon_i2c_create(dev, i2c_bus, "DVI"); | 1316 | radeon_connector->ddc_bus = radeon_i2c_create(dev, i2c_bus, "DVI"); |
| 1317 | if (!radeon_connector->ddc_bus) | 1317 | if (!radeon_connector->ddc_bus) |
| 1318 | goto failed; | 1318 | goto failed; |
| 1319 | } | ||
| 1320 | if (connector_type == DRM_MODE_CONNECTOR_DVII) { | ||
| 1319 | radeon_connector->dac_load_detect = true; | 1321 | radeon_connector->dac_load_detect = true; |
| 1320 | drm_connector_attach_property(&radeon_connector->base, | 1322 | drm_connector_attach_property(&radeon_connector->base, |
| 1321 | rdev->mode_info.load_detect_property, | 1323 | rdev->mode_info.load_detect_property, |
diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c index fed7b8084779..c5ddaf58563a 100644 --- a/drivers/gpu/drm/radeon/radeon_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_encoders.c | |||
| @@ -254,6 +254,53 @@ radeon_get_atom_connector_priv_from_encoder(struct drm_encoder *encoder) | |||
| 254 | return dig_connector; | 254 | return dig_connector; |
| 255 | } | 255 | } |
| 256 | 256 | ||
| 257 | void radeon_panel_mode_fixup(struct drm_encoder *encoder, | ||
| 258 | struct drm_display_mode *adjusted_mode) | ||
| 259 | { | ||
| 260 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); | ||
| 261 | struct drm_device *dev = encoder->dev; | ||
| 262 | struct radeon_device *rdev = dev->dev_private; | ||
| 263 | struct drm_display_mode *native_mode = &radeon_encoder->native_mode; | ||
| 264 | unsigned hblank = native_mode->htotal - native_mode->hdisplay; | ||
| 265 | unsigned vblank = native_mode->vtotal - native_mode->vdisplay; | ||
| 266 | unsigned hover = native_mode->hsync_start - native_mode->hdisplay; | ||
| 267 | unsigned vover = native_mode->vsync_start - native_mode->vdisplay; | ||
| 268 | unsigned hsync_width = native_mode->hsync_end - native_mode->hsync_start; | ||
| 269 | unsigned vsync_width = native_mode->vsync_end - native_mode->vsync_start; | ||
| 270 | |||
| 271 | adjusted_mode->clock = native_mode->clock; | ||
| 272 | adjusted_mode->flags = native_mode->flags; | ||
| 273 | |||
| 274 | if (ASIC_IS_AVIVO(rdev)) { | ||
| 275 | adjusted_mode->hdisplay = native_mode->hdisplay; | ||
| 276 | adjusted_mode->vdisplay = native_mode->vdisplay; | ||
| 277 | } | ||
| 278 | |||
| 279 | adjusted_mode->htotal = native_mode->hdisplay + hblank; | ||
| 280 | adjusted_mode->hsync_start = native_mode->hdisplay + hover; | ||
| 281 | adjusted_mode->hsync_end = adjusted_mode->hsync_start + hsync_width; | ||
| 282 | |||
| 283 | adjusted_mode->vtotal = native_mode->vdisplay + vblank; | ||
| 284 | adjusted_mode->vsync_start = native_mode->vdisplay + vover; | ||
| 285 | adjusted_mode->vsync_end = adjusted_mode->vsync_start + vsync_width; | ||
| 286 | |||
| 287 | drm_mode_set_crtcinfo(adjusted_mode, CRTC_INTERLACE_HALVE_V); | ||
| 288 | |||
| 289 | if (ASIC_IS_AVIVO(rdev)) { | ||
| 290 | adjusted_mode->crtc_hdisplay = native_mode->hdisplay; | ||
| 291 | adjusted_mode->crtc_vdisplay = native_mode->vdisplay; | ||
| 292 | } | ||
| 293 | |||
| 294 | adjusted_mode->crtc_htotal = adjusted_mode->crtc_hdisplay + hblank; | ||
| 295 | adjusted_mode->crtc_hsync_start = adjusted_mode->crtc_hdisplay + hover; | ||
| 296 | adjusted_mode->crtc_hsync_end = adjusted_mode->crtc_hsync_start + hsync_width; | ||
| 297 | |||
| 298 | adjusted_mode->crtc_vtotal = adjusted_mode->crtc_vdisplay + vblank; | ||
| 299 | adjusted_mode->crtc_vsync_start = adjusted_mode->crtc_vdisplay + vover; | ||
| 300 | adjusted_mode->crtc_vsync_end = adjusted_mode->crtc_vsync_start + vsync_width; | ||
| 301 | |||
| 302 | } | ||
| 303 | |||
| 257 | static bool radeon_atom_mode_fixup(struct drm_encoder *encoder, | 304 | static bool radeon_atom_mode_fixup(struct drm_encoder *encoder, |
| 258 | struct drm_display_mode *mode, | 305 | struct drm_display_mode *mode, |
| 259 | struct drm_display_mode *adjusted_mode) | 306 | struct drm_display_mode *adjusted_mode) |
| @@ -275,18 +322,8 @@ static bool radeon_atom_mode_fixup(struct drm_encoder *encoder, | |||
| 275 | adjusted_mode->crtc_vsync_start = adjusted_mode->crtc_vdisplay + 2; | 322 | adjusted_mode->crtc_vsync_start = adjusted_mode->crtc_vdisplay + 2; |
| 276 | 323 | ||
| 277 | /* get the native mode for LVDS */ | 324 | /* get the native mode for LVDS */ |
| 278 | if (radeon_encoder->active_device & (ATOM_DEVICE_LCD_SUPPORT)) { | 325 | if (radeon_encoder->active_device & (ATOM_DEVICE_LCD_SUPPORT)) |
| 279 | struct drm_display_mode *native_mode = &radeon_encoder->native_mode; | 326 | radeon_panel_mode_fixup(encoder, adjusted_mode); |
| 280 | int mode_id = adjusted_mode->base.id; | ||
| 281 | *adjusted_mode = *native_mode; | ||
| 282 | if (!ASIC_IS_AVIVO(rdev)) { | ||
| 283 | adjusted_mode->hdisplay = mode->hdisplay; | ||
| 284 | adjusted_mode->vdisplay = mode->vdisplay; | ||
| 285 | adjusted_mode->crtc_hdisplay = mode->hdisplay; | ||
| 286 | adjusted_mode->crtc_vdisplay = mode->vdisplay; | ||
| 287 | } | ||
| 288 | adjusted_mode->base.id = mode_id; | ||
| 289 | } | ||
| 290 | 327 | ||
| 291 | /* get the native mode for TV */ | 328 | /* get the native mode for TV */ |
| 292 | if (radeon_encoder->active_device & (ATOM_DEVICE_TV_SUPPORT)) { | 329 | if (radeon_encoder->active_device & (ATOM_DEVICE_TV_SUPPORT)) { |
diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c index 2441cca7d775..0274abe17ad9 100644 --- a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c | |||
| @@ -228,16 +228,8 @@ static bool radeon_legacy_mode_fixup(struct drm_encoder *encoder, | |||
| 228 | drm_mode_set_crtcinfo(adjusted_mode, 0); | 228 | drm_mode_set_crtcinfo(adjusted_mode, 0); |
| 229 | 229 | ||
| 230 | /* get the native mode for LVDS */ | 230 | /* get the native mode for LVDS */ |
| 231 | if (radeon_encoder->active_device & (ATOM_DEVICE_LCD_SUPPORT)) { | 231 | if (radeon_encoder->active_device & (ATOM_DEVICE_LCD_SUPPORT)) |
| 232 | struct drm_display_mode *native_mode = &radeon_encoder->native_mode; | 232 | radeon_panel_mode_fixup(encoder, adjusted_mode); |
| 233 | int mode_id = adjusted_mode->base.id; | ||
| 234 | *adjusted_mode = *native_mode; | ||
| 235 | adjusted_mode->hdisplay = mode->hdisplay; | ||
| 236 | adjusted_mode->vdisplay = mode->vdisplay; | ||
| 237 | adjusted_mode->crtc_hdisplay = mode->hdisplay; | ||
| 238 | adjusted_mode->crtc_vdisplay = mode->vdisplay; | ||
| 239 | adjusted_mode->base.id = mode_id; | ||
| 240 | } | ||
| 241 | 233 | ||
| 242 | return true; | 234 | return true; |
| 243 | } | 235 | } |
diff --git a/drivers/gpu/drm/radeon/radeon_mode.h b/drivers/gpu/drm/radeon/radeon_mode.h index 0b8e32776b10..5413fcd63086 100644 --- a/drivers/gpu/drm/radeon/radeon_mode.h +++ b/drivers/gpu/drm/radeon/radeon_mode.h | |||
| @@ -558,6 +558,8 @@ extern int radeon_static_clocks_init(struct drm_device *dev); | |||
| 558 | bool radeon_crtc_scaling_mode_fixup(struct drm_crtc *crtc, | 558 | bool radeon_crtc_scaling_mode_fixup(struct drm_crtc *crtc, |
| 559 | struct drm_display_mode *mode, | 559 | struct drm_display_mode *mode, |
| 560 | struct drm_display_mode *adjusted_mode); | 560 | struct drm_display_mode *adjusted_mode); |
| 561 | void radeon_panel_mode_fixup(struct drm_encoder *encoder, | ||
| 562 | struct drm_display_mode *adjusted_mode); | ||
| 561 | void atom_rv515_force_tv_scaler(struct radeon_device *rdev, struct radeon_crtc *radeon_crtc); | 563 | void atom_rv515_force_tv_scaler(struct radeon_device *rdev, struct radeon_crtc *radeon_crtc); |
| 562 | 564 | ||
| 563 | /* legacy tv */ | 565 | /* legacy tv */ |
diff --git a/drivers/gpu/drm/via/via_video.c b/drivers/gpu/drm/via/via_video.c index 6ec04ac12459..6efac8117c93 100644 --- a/drivers/gpu/drm/via/via_video.c +++ b/drivers/gpu/drm/via/via_video.c | |||
| @@ -75,7 +75,7 @@ int via_decoder_futex(struct drm_device *dev, void *data, struct drm_file *file_ | |||
| 75 | 75 | ||
| 76 | DRM_DEBUG("\n"); | 76 | DRM_DEBUG("\n"); |
| 77 | 77 | ||
| 78 | if (fx->lock > VIA_NR_XVMC_LOCKS) | 78 | if (fx->lock >= VIA_NR_XVMC_LOCKS) |
| 79 | return -EFAULT; | 79 | return -EFAULT; |
| 80 | 80 | ||
| 81 | lock = (volatile int *)XVMCLOCKPTR(sAPriv, fx->lock); | 81 | lock = (volatile int *)XVMCLOCKPTR(sAPriv, fx->lock); |
diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c index d6d1149d525d..c8768f38511e 100644 --- a/drivers/gpu/vga/vga_switcheroo.c +++ b/drivers/gpu/vga/vga_switcheroo.c | |||
| @@ -276,8 +276,10 @@ vga_switcheroo_debugfs_write(struct file *filp, const char __user *ubuf, | |||
| 276 | 276 | ||
| 277 | mutex_lock(&vgasr_mutex); | 277 | mutex_lock(&vgasr_mutex); |
| 278 | 278 | ||
| 279 | if (!vgasr_priv.active) | 279 | if (!vgasr_priv.active) { |
| 280 | return -EINVAL; | 280 | cnt = -EINVAL; |
| 281 | goto out; | ||
| 282 | } | ||
| 281 | 283 | ||
| 282 | /* pwr off the device not in use */ | 284 | /* pwr off the device not in use */ |
| 283 | if (strncmp(usercmd, "OFF", 3) == 0) { | 285 | if (strncmp(usercmd, "OFF", 3) == 0) { |
diff --git a/drivers/i2c/busses/i2c-octeon.c b/drivers/i2c/busses/i2c-octeon.c index a2481f40ea1c..0e9f85d0a835 100644 --- a/drivers/i2c/busses/i2c-octeon.c +++ b/drivers/i2c/busses/i2c-octeon.c | |||
| @@ -447,7 +447,7 @@ static struct i2c_adapter octeon_i2c_ops = { | |||
| 447 | /** | 447 | /** |
| 448 | * octeon_i2c_setclock - Calculate and set clock divisors. | 448 | * octeon_i2c_setclock - Calculate and set clock divisors. |
| 449 | */ | 449 | */ |
| 450 | static int __init octeon_i2c_setclock(struct octeon_i2c *i2c) | 450 | static int __devinit octeon_i2c_setclock(struct octeon_i2c *i2c) |
| 451 | { | 451 | { |
| 452 | int tclk, thp_base, inc, thp_idx, mdiv_idx, ndiv_idx, foscl, diff; | 452 | int tclk, thp_base, inc, thp_idx, mdiv_idx, ndiv_idx, foscl, diff; |
| 453 | int thp = 0x18, mdiv = 2, ndiv = 0, delta_hz = 1000000; | 453 | int thp = 0x18, mdiv = 2, ndiv = 0, delta_hz = 1000000; |
| @@ -490,7 +490,7 @@ static int __init octeon_i2c_setclock(struct octeon_i2c *i2c) | |||
| 490 | return 0; | 490 | return 0; |
| 491 | } | 491 | } |
| 492 | 492 | ||
| 493 | static int __init octeon_i2c_initlowlevel(struct octeon_i2c *i2c) | 493 | static int __devinit octeon_i2c_initlowlevel(struct octeon_i2c *i2c) |
| 494 | { | 494 | { |
| 495 | u8 status; | 495 | u8 status; |
| 496 | int tries; | 496 | int tries; |
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 3202a86f420e..c2258a51fe0c 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c | |||
| @@ -40,12 +40,11 @@ | |||
| 40 | #include "i2c-core.h" | 40 | #include "i2c-core.h" |
| 41 | 41 | ||
| 42 | 42 | ||
| 43 | /* core_lock protects i2c_adapter_idr, userspace_devices, and guarantees | 43 | /* core_lock protects i2c_adapter_idr, and guarantees |
| 44 | that device detection, deletion of detected devices, and attach_adapter | 44 | that device detection, deletion of detected devices, and attach_adapter |
| 45 | and detach_adapter calls are serialized */ | 45 | and detach_adapter calls are serialized */ |
| 46 | static DEFINE_MUTEX(core_lock); | 46 | static DEFINE_MUTEX(core_lock); |
| 47 | static DEFINE_IDR(i2c_adapter_idr); | 47 | static DEFINE_IDR(i2c_adapter_idr); |
| 48 | static LIST_HEAD(userspace_devices); | ||
| 49 | 48 | ||
| 50 | static struct device_type i2c_client_type; | 49 | static struct device_type i2c_client_type; |
| 51 | static int i2c_check_addr(struct i2c_adapter *adapter, int addr); | 50 | static int i2c_check_addr(struct i2c_adapter *adapter, int addr); |
| @@ -117,8 +116,10 @@ static int i2c_device_probe(struct device *dev) | |||
| 117 | dev_dbg(dev, "probe\n"); | 116 | dev_dbg(dev, "probe\n"); |
| 118 | 117 | ||
| 119 | status = driver->probe(client, i2c_match_id(driver->id_table, client)); | 118 | status = driver->probe(client, i2c_match_id(driver->id_table, client)); |
| 120 | if (status) | 119 | if (status) { |
| 121 | client->driver = NULL; | 120 | client->driver = NULL; |
| 121 | i2c_set_clientdata(client, NULL); | ||
| 122 | } | ||
| 122 | return status; | 123 | return status; |
| 123 | } | 124 | } |
| 124 | 125 | ||
| @@ -139,8 +140,10 @@ static int i2c_device_remove(struct device *dev) | |||
| 139 | dev->driver = NULL; | 140 | dev->driver = NULL; |
| 140 | status = 0; | 141 | status = 0; |
| 141 | } | 142 | } |
| 142 | if (status == 0) | 143 | if (status == 0) { |
| 143 | client->driver = NULL; | 144 | client->driver = NULL; |
| 145 | i2c_set_clientdata(client, NULL); | ||
| 146 | } | ||
| 144 | return status; | 147 | return status; |
| 145 | } | 148 | } |
| 146 | 149 | ||
| @@ -538,9 +541,9 @@ i2c_sysfs_new_device(struct device *dev, struct device_attribute *attr, | |||
| 538 | return -EEXIST; | 541 | return -EEXIST; |
| 539 | 542 | ||
| 540 | /* Keep track of the added device */ | 543 | /* Keep track of the added device */ |
| 541 | mutex_lock(&core_lock); | 544 | i2c_lock_adapter(adap); |
| 542 | list_add_tail(&client->detected, &userspace_devices); | 545 | list_add_tail(&client->detected, &adap->userspace_clients); |
| 543 | mutex_unlock(&core_lock); | 546 | i2c_unlock_adapter(adap); |
| 544 | dev_info(dev, "%s: Instantiated device %s at 0x%02hx\n", "new_device", | 547 | dev_info(dev, "%s: Instantiated device %s at 0x%02hx\n", "new_device", |
| 545 | info.type, info.addr); | 548 | info.type, info.addr); |
| 546 | 549 | ||
| @@ -579,9 +582,10 @@ i2c_sysfs_delete_device(struct device *dev, struct device_attribute *attr, | |||
| 579 | 582 | ||
| 580 | /* Make sure the device was added through sysfs */ | 583 | /* Make sure the device was added through sysfs */ |
| 581 | res = -ENOENT; | 584 | res = -ENOENT; |
| 582 | mutex_lock(&core_lock); | 585 | i2c_lock_adapter(adap); |
| 583 | list_for_each_entry_safe(client, next, &userspace_devices, detected) { | 586 | list_for_each_entry_safe(client, next, &adap->userspace_clients, |
| 584 | if (client->addr == addr && client->adapter == adap) { | 587 | detected) { |
| 588 | if (client->addr == addr) { | ||
| 585 | dev_info(dev, "%s: Deleting device %s at 0x%02hx\n", | 589 | dev_info(dev, "%s: Deleting device %s at 0x%02hx\n", |
| 586 | "delete_device", client->name, client->addr); | 590 | "delete_device", client->name, client->addr); |
| 587 | 591 | ||
| @@ -591,7 +595,7 @@ i2c_sysfs_delete_device(struct device *dev, struct device_attribute *attr, | |||
| 591 | break; | 595 | break; |
| 592 | } | 596 | } |
| 593 | } | 597 | } |
| 594 | mutex_unlock(&core_lock); | 598 | i2c_unlock_adapter(adap); |
| 595 | 599 | ||
| 596 | if (res < 0) | 600 | if (res < 0) |
| 597 | dev_err(dev, "%s: Can't find device in list\n", | 601 | dev_err(dev, "%s: Can't find device in list\n", |
| @@ -673,6 +677,7 @@ static int i2c_register_adapter(struct i2c_adapter *adap) | |||
| 673 | } | 677 | } |
| 674 | 678 | ||
| 675 | rt_mutex_init(&adap->bus_lock); | 679 | rt_mutex_init(&adap->bus_lock); |
| 680 | INIT_LIST_HEAD(&adap->userspace_clients); | ||
| 676 | 681 | ||
| 677 | /* Set default timeout to 1 second if not already set */ | 682 | /* Set default timeout to 1 second if not already set */ |
| 678 | if (adap->timeout == 0) | 683 | if (adap->timeout == 0) |
| @@ -875,14 +880,15 @@ int i2c_del_adapter(struct i2c_adapter *adap) | |||
| 875 | return res; | 880 | return res; |
| 876 | 881 | ||
| 877 | /* Remove devices instantiated from sysfs */ | 882 | /* Remove devices instantiated from sysfs */ |
| 878 | list_for_each_entry_safe(client, next, &userspace_devices, detected) { | 883 | i2c_lock_adapter(adap); |
| 879 | if (client->adapter == adap) { | 884 | list_for_each_entry_safe(client, next, &adap->userspace_clients, |
| 880 | dev_dbg(&adap->dev, "Removing %s at 0x%x\n", | 885 | detected) { |
| 881 | client->name, client->addr); | 886 | dev_dbg(&adap->dev, "Removing %s at 0x%x\n", client->name, |
| 882 | list_del(&client->detected); | 887 | client->addr); |
| 883 | i2c_unregister_device(client); | 888 | list_del(&client->detected); |
| 884 | } | 889 | i2c_unregister_device(client); |
| 885 | } | 890 | } |
| 891 | i2c_unlock_adapter(adap); | ||
| 886 | 892 | ||
| 887 | /* Detach any active clients. This can't fail, thus we do not | 893 | /* Detach any active clients. This can't fail, thus we do not |
| 888 | checking the returned value. */ | 894 | checking the returned value. */ |
| @@ -1260,12 +1266,23 @@ static int i2c_detect_address(struct i2c_client *temp_client, | |||
| 1260 | return 0; | 1266 | return 0; |
| 1261 | 1267 | ||
| 1262 | /* Make sure there is something at this address */ | 1268 | /* Make sure there is something at this address */ |
| 1263 | if (i2c_smbus_xfer(adapter, addr, 0, 0, 0, I2C_SMBUS_QUICK, NULL) < 0) | 1269 | if (addr == 0x73 && (adapter->class & I2C_CLASS_HWMON)) { |
| 1264 | return 0; | 1270 | /* Special probe for FSC hwmon chips */ |
| 1271 | union i2c_smbus_data dummy; | ||
| 1265 | 1272 | ||
| 1266 | /* Prevent 24RF08 corruption */ | 1273 | if (i2c_smbus_xfer(adapter, addr, 0, I2C_SMBUS_READ, 0, |
| 1267 | if ((addr & ~0x0f) == 0x50) | 1274 | I2C_SMBUS_BYTE_DATA, &dummy) < 0) |
| 1268 | i2c_smbus_xfer(adapter, addr, 0, 0, 0, I2C_SMBUS_QUICK, NULL); | 1275 | return 0; |
| 1276 | } else { | ||
| 1277 | if (i2c_smbus_xfer(adapter, addr, 0, I2C_SMBUS_WRITE, 0, | ||
| 1278 | I2C_SMBUS_QUICK, NULL) < 0) | ||
| 1279 | return 0; | ||
| 1280 | |||
| 1281 | /* Prevent 24RF08 corruption */ | ||
| 1282 | if ((addr & ~0x0f) == 0x50) | ||
| 1283 | i2c_smbus_xfer(adapter, addr, 0, I2C_SMBUS_WRITE, 0, | ||
| 1284 | I2C_SMBUS_QUICK, NULL); | ||
| 1285 | } | ||
| 1269 | 1286 | ||
| 1270 | /* Finally call the custom detection function */ | 1287 | /* Finally call the custom detection function */ |
| 1271 | memset(&info, 0, sizeof(struct i2c_board_info)); | 1288 | memset(&info, 0, sizeof(struct i2c_board_info)); |
diff --git a/drivers/ide/ide-cs.c b/drivers/ide/ide-cs.c index defce2877eef..b85450865ff0 100644 --- a/drivers/ide/ide-cs.c +++ b/drivers/ide/ide-cs.c | |||
| @@ -409,7 +409,7 @@ static struct pcmcia_device_id ide_ids[] = { | |||
| 409 | PCMCIA_DEVICE_PROD_ID12("Hyperstone", "Model1", 0x3d5b9ef5, 0xca6ab420), | 409 | PCMCIA_DEVICE_PROD_ID12("Hyperstone", "Model1", 0x3d5b9ef5, 0xca6ab420), |
| 410 | PCMCIA_DEVICE_PROD_ID12("IBM", "microdrive", 0xb569a6e5, 0xa6d76178), | 410 | PCMCIA_DEVICE_PROD_ID12("IBM", "microdrive", 0xb569a6e5, 0xa6d76178), |
| 411 | PCMCIA_DEVICE_PROD_ID12("IBM", "IBM17JSSFP20", 0xb569a6e5, 0xf2508753), | 411 | PCMCIA_DEVICE_PROD_ID12("IBM", "IBM17JSSFP20", 0xb569a6e5, 0xf2508753), |
| 412 | PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF CARD 1GB", 0x2e6d1829, 0x3e520e17), | 412 | PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF CARD 1GB", 0x2e6d1829, 0x55d5bffb), |
| 413 | PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF CARD 4GB", 0x2e6d1829, 0x531e7d10), | 413 | PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF CARD 4GB", 0x2e6d1829, 0x531e7d10), |
| 414 | PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF8GB", 0x2e6d1829, 0xacbe682e), | 414 | PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF8GB", 0x2e6d1829, 0xacbe682e), |
| 415 | PCMCIA_DEVICE_PROD_ID12("IO DATA", "CBIDE2 ", 0x547e66dc, 0x8671043b), | 415 | PCMCIA_DEVICE_PROD_ID12("IO DATA", "CBIDE2 ", 0x547e66dc, 0x8671043b), |
| @@ -431,7 +431,7 @@ static struct pcmcia_device_id ide_ids[] = { | |||
| 431 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS1GCF80", 0x709b1bf1, 0x2a54d4b1), | 431 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS1GCF80", 0x709b1bf1, 0x2a54d4b1), |
| 432 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS2GCF120", 0x709b1bf1, 0x969aa4f2), | 432 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS2GCF120", 0x709b1bf1, 0x969aa4f2), |
| 433 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF120", 0x709b1bf1, 0xf54a91c8), | 433 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF120", 0x709b1bf1, 0xf54a91c8), |
| 434 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF133", 0x709b1bf1, 0x9351e59d), | 434 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF133", 0x709b1bf1, 0x7558f133), |
| 435 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS8GCF133", 0x709b1bf1, 0xb2f89b47), | 435 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS8GCF133", 0x709b1bf1, 0xb2f89b47), |
| 436 | PCMCIA_DEVICE_PROD_ID12("WIT", "IDE16", 0x244e5994, 0x3e232852), | 436 | PCMCIA_DEVICE_PROD_ID12("WIT", "IDE16", 0x244e5994, 0x3e232852), |
| 437 | PCMCIA_DEVICE_PROD_ID12("WEIDA", "TWTTI", 0xcc7cf69c, 0x212bb918), | 437 | PCMCIA_DEVICE_PROD_ID12("WEIDA", "TWTTI", 0xcc7cf69c, 0x212bb918), |
diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c index c52bec4d0530..423e0e6031ab 100644 --- a/drivers/input/joydev.c +++ b/drivers/input/joydev.c | |||
| @@ -929,6 +929,24 @@ static const struct input_device_id joydev_ids[] = { | |||
| 929 | .evbit = { BIT_MASK(EV_ABS) }, | 929 | .evbit = { BIT_MASK(EV_ABS) }, |
| 930 | .absbit = { BIT_MASK(ABS_THROTTLE) }, | 930 | .absbit = { BIT_MASK(ABS_THROTTLE) }, |
| 931 | }, | 931 | }, |
| 932 | { | ||
| 933 | .flags = INPUT_DEVICE_ID_MATCH_EVBIT | | ||
| 934 | INPUT_DEVICE_ID_MATCH_KEYBIT, | ||
| 935 | .evbit = { BIT_MASK(EV_KEY) }, | ||
| 936 | .keybit = {[BIT_WORD(BTN_JOYSTICK)] = BIT_MASK(BTN_JOYSTICK) }, | ||
| 937 | }, | ||
| 938 | { | ||
| 939 | .flags = INPUT_DEVICE_ID_MATCH_EVBIT | | ||
| 940 | INPUT_DEVICE_ID_MATCH_KEYBIT, | ||
| 941 | .evbit = { BIT_MASK(EV_KEY) }, | ||
| 942 | .keybit = { [BIT_WORD(BTN_GAMEPAD)] = BIT_MASK(BTN_GAMEPAD) }, | ||
| 943 | }, | ||
| 944 | { | ||
| 945 | .flags = INPUT_DEVICE_ID_MATCH_EVBIT | | ||
| 946 | INPUT_DEVICE_ID_MATCH_KEYBIT, | ||
| 947 | .evbit = { BIT_MASK(EV_KEY) }, | ||
| 948 | .keybit = { [BIT_WORD(BTN_TRIGGER_HAPPY)] = BIT_MASK(BTN_TRIGGER_HAPPY) }, | ||
| 949 | }, | ||
| 932 | { } /* Terminating entry */ | 950 | { } /* Terminating entry */ |
| 933 | }; | 951 | }; |
| 934 | 952 | ||
diff --git a/drivers/input/misc/ati_remote.c b/drivers/input/misc/ati_remote.c index 614b65d78fe9..e8bbc619f6df 100644 --- a/drivers/input/misc/ati_remote.c +++ b/drivers/input/misc/ati_remote.c | |||
| @@ -98,10 +98,12 @@ | |||
| 98 | * Module and Version Information, Module Parameters | 98 | * Module and Version Information, Module Parameters |
| 99 | */ | 99 | */ |
| 100 | 100 | ||
| 101 | #define ATI_REMOTE_VENDOR_ID 0x0bc7 | 101 | #define ATI_REMOTE_VENDOR_ID 0x0bc7 |
| 102 | #define ATI_REMOTE_PRODUCT_ID 0x004 | 102 | #define LOLA_REMOTE_PRODUCT_ID 0x0002 |
| 103 | #define LOLA_REMOTE_PRODUCT_ID 0x002 | 103 | #define LOLA2_REMOTE_PRODUCT_ID 0x0003 |
| 104 | #define MEDION_REMOTE_PRODUCT_ID 0x006 | 104 | #define ATI_REMOTE_PRODUCT_ID 0x0004 |
| 105 | #define NVIDIA_REMOTE_PRODUCT_ID 0x0005 | ||
| 106 | #define MEDION_REMOTE_PRODUCT_ID 0x0006 | ||
| 105 | 107 | ||
| 106 | #define DRIVER_VERSION "2.2.1" | 108 | #define DRIVER_VERSION "2.2.1" |
| 107 | #define DRIVER_AUTHOR "Torrey Hoffman <thoffman@arnor.net>" | 109 | #define DRIVER_AUTHOR "Torrey Hoffman <thoffman@arnor.net>" |
| @@ -142,8 +144,10 @@ MODULE_PARM_DESC(repeat_delay, "Delay before sending repeats, default = 500 msec | |||
| 142 | #define err(format, arg...) printk(KERN_ERR format , ## arg) | 144 | #define err(format, arg...) printk(KERN_ERR format , ## arg) |
| 143 | 145 | ||
| 144 | static struct usb_device_id ati_remote_table[] = { | 146 | static struct usb_device_id ati_remote_table[] = { |
| 145 | { USB_DEVICE(ATI_REMOTE_VENDOR_ID, ATI_REMOTE_PRODUCT_ID) }, | ||
| 146 | { USB_DEVICE(ATI_REMOTE_VENDOR_ID, LOLA_REMOTE_PRODUCT_ID) }, | 147 | { USB_DEVICE(ATI_REMOTE_VENDOR_ID, LOLA_REMOTE_PRODUCT_ID) }, |
| 148 | { USB_DEVICE(ATI_REMOTE_VENDOR_ID, LOLA2_REMOTE_PRODUCT_ID) }, | ||
| 149 | { USB_DEVICE(ATI_REMOTE_VENDOR_ID, ATI_REMOTE_PRODUCT_ID) }, | ||
| 150 | { USB_DEVICE(ATI_REMOTE_VENDOR_ID, NVIDIA_REMOTE_PRODUCT_ID) }, | ||
| 147 | { USB_DEVICE(ATI_REMOTE_VENDOR_ID, MEDION_REMOTE_PRODUCT_ID) }, | 151 | { USB_DEVICE(ATI_REMOTE_VENDOR_ID, MEDION_REMOTE_PRODUCT_ID) }, |
| 148 | {} /* Terminating entry */ | 152 | {} /* Terminating entry */ |
| 149 | }; | 153 | }; |
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index 0d22cb9ce42e..99d58764ef03 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c | |||
| @@ -64,7 +64,6 @@ static const struct alps_model_info alps_model_data[] = { | |||
| 64 | { { 0x62, 0x02, 0x14 }, 0xcf, 0xcf, | 64 | { { 0x62, 0x02, 0x14 }, 0xcf, 0xcf, |
| 65 | ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED }, | 65 | ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED }, |
| 66 | { { 0x73, 0x02, 0x50 }, 0xcf, 0xcf, ALPS_FOUR_BUTTONS }, /* Dell Vostro 1400 */ | 66 | { { 0x73, 0x02, 0x50 }, 0xcf, 0xcf, ALPS_FOUR_BUTTONS }, /* Dell Vostro 1400 */ |
| 67 | { { 0x73, 0x02, 0x64 }, 0xf8, 0xf8, 0 }, /* HP Pavilion dm3 */ | ||
| 68 | { { 0x52, 0x01, 0x14 }, 0xff, 0xff, | 67 | { { 0x52, 0x01, 0x14 }, 0xff, 0xff, |
| 69 | ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED }, /* Toshiba Tecra A11-11L */ | 68 | ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED }, /* Toshiba Tecra A11-11L */ |
| 70 | }; | 69 | }; |
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c index a138b5da79f9..0520c2e19927 100644 --- a/drivers/input/mouse/elantech.c +++ b/drivers/input/mouse/elantech.c | |||
| @@ -25,6 +25,10 @@ | |||
| 25 | printk(KERN_DEBUG format, ##arg); \ | 25 | printk(KERN_DEBUG format, ##arg); \ |
| 26 | } while (0) | 26 | } while (0) |
| 27 | 27 | ||
| 28 | static bool force_elantech; | ||
| 29 | module_param_named(force_elantech, force_elantech, bool, 0644); | ||
| 30 | MODULE_PARM_DESC(force_elantech, "Force the Elantech PS/2 protocol extension to be used, 1 = enabled, 0 = disabled (default)."); | ||
| 31 | |||
| 28 | /* | 32 | /* |
| 29 | * Send a Synaptics style sliced query command | 33 | * Send a Synaptics style sliced query command |
| 30 | */ | 34 | */ |
| @@ -182,13 +186,17 @@ static void elantech_report_absolute_v1(struct psmouse *psmouse) | |||
| 182 | static int old_fingers; | 186 | static int old_fingers; |
| 183 | 187 | ||
| 184 | if (etd->fw_version_maj == 0x01) { | 188 | if (etd->fw_version_maj == 0x01) { |
| 185 | /* byte 0: D U p1 p2 1 p3 R L | 189 | /* |
| 186 | byte 1: f 0 th tw x9 x8 y9 y8 */ | 190 | * byte 0: D U p1 p2 1 p3 R L |
| 191 | * byte 1: f 0 th tw x9 x8 y9 y8 | ||
| 192 | */ | ||
| 187 | fingers = ((packet[1] & 0x80) >> 7) + | 193 | fingers = ((packet[1] & 0x80) >> 7) + |
| 188 | ((packet[1] & 0x30) >> 4); | 194 | ((packet[1] & 0x30) >> 4); |
| 189 | } else { | 195 | } else { |
| 190 | /* byte 0: n1 n0 p2 p1 1 p3 R L | 196 | /* |
| 191 | byte 1: 0 0 0 0 x9 x8 y9 y8 */ | 197 | * byte 0: n1 n0 p2 p1 1 p3 R L |
| 198 | * byte 1: 0 0 0 0 x9 x8 y9 y8 | ||
| 199 | */ | ||
| 192 | fingers = (packet[0] & 0xc0) >> 6; | 200 | fingers = (packet[0] & 0xc0) >> 6; |
| 193 | } | 201 | } |
| 194 | 202 | ||
| @@ -202,13 +210,15 @@ static void elantech_report_absolute_v1(struct psmouse *psmouse) | |||
| 202 | 210 | ||
| 203 | input_report_key(dev, BTN_TOUCH, fingers != 0); | 211 | input_report_key(dev, BTN_TOUCH, fingers != 0); |
| 204 | 212 | ||
| 205 | /* byte 2: x7 x6 x5 x4 x3 x2 x1 x0 | 213 | /* |
| 206 | byte 3: y7 y6 y5 y4 y3 y2 y1 y0 */ | 214 | * byte 2: x7 x6 x5 x4 x3 x2 x1 x0 |
| 215 | * byte 3: y7 y6 y5 y4 y3 y2 y1 y0 | ||
| 216 | */ | ||
| 207 | if (fingers) { | 217 | if (fingers) { |
| 208 | input_report_abs(dev, ABS_X, | 218 | input_report_abs(dev, ABS_X, |
| 209 | ((packet[1] & 0x0c) << 6) | packet[2]); | 219 | ((packet[1] & 0x0c) << 6) | packet[2]); |
| 210 | input_report_abs(dev, ABS_Y, ETP_YMAX_V1 - | 220 | input_report_abs(dev, ABS_Y, |
| 211 | (((packet[1] & 0x03) << 8) | packet[3])); | 221 | ETP_YMAX_V1 - (((packet[1] & 0x03) << 8) | packet[3])); |
| 212 | } | 222 | } |
| 213 | 223 | ||
| 214 | input_report_key(dev, BTN_TOOL_FINGER, fingers == 1); | 224 | input_report_key(dev, BTN_TOOL_FINGER, fingers == 1); |
| @@ -247,34 +257,47 @@ static void elantech_report_absolute_v2(struct psmouse *psmouse) | |||
| 247 | 257 | ||
| 248 | switch (fingers) { | 258 | switch (fingers) { |
| 249 | case 1: | 259 | case 1: |
| 250 | /* byte 1: x15 x14 x13 x12 x11 x10 x9 x8 | 260 | /* |
| 251 | byte 2: x7 x6 x5 x4 x4 x2 x1 x0 */ | 261 | * byte 1: . . . . . x10 x9 x8 |
| 252 | input_report_abs(dev, ABS_X, (packet[1] << 8) | packet[2]); | 262 | * byte 2: x7 x6 x5 x4 x4 x2 x1 x0 |
| 253 | /* byte 4: y15 y14 y13 y12 y11 y10 y8 y8 | 263 | */ |
| 254 | byte 5: y7 y6 y5 y4 y3 y2 y1 y0 */ | 264 | input_report_abs(dev, ABS_X, |
| 255 | input_report_abs(dev, ABS_Y, ETP_YMAX_V2 - | 265 | ((packet[1] & 0x07) << 8) | packet[2]); |
| 256 | ((packet[4] << 8) | packet[5])); | 266 | /* |
| 267 | * byte 4: . . . . . . y9 y8 | ||
| 268 | * byte 5: y7 y6 y5 y4 y3 y2 y1 y0 | ||
| 269 | */ | ||
| 270 | input_report_abs(dev, ABS_Y, | ||
| 271 | ETP_YMAX_V2 - (((packet[4] & 0x03) << 8) | packet[5])); | ||
| 257 | break; | 272 | break; |
| 258 | 273 | ||
| 259 | case 2: | 274 | case 2: |
| 260 | /* The coordinate of each finger is reported separately with | 275 | /* |
| 261 | a lower resolution for two finger touches */ | 276 | * The coordinate of each finger is reported separately |
| 262 | /* byte 0: . . ay8 ax8 . . . . | 277 | * with a lower resolution for two finger touches: |
| 263 | byte 1: ax7 ax6 ax5 ax4 ax3 ax2 ax1 ax0 */ | 278 | * byte 0: . . ay8 ax8 . . . . |
| 279 | * byte 1: ax7 ax6 ax5 ax4 ax3 ax2 ax1 ax0 | ||
| 280 | */ | ||
| 264 | x1 = ((packet[0] & 0x10) << 4) | packet[1]; | 281 | x1 = ((packet[0] & 0x10) << 4) | packet[1]; |
| 265 | /* byte 2: ay7 ay6 ay5 ay4 ay3 ay2 ay1 ay0 */ | 282 | /* byte 2: ay7 ay6 ay5 ay4 ay3 ay2 ay1 ay0 */ |
| 266 | y1 = ETP_2FT_YMAX - (((packet[0] & 0x20) << 3) | packet[2]); | 283 | y1 = ETP_2FT_YMAX - (((packet[0] & 0x20) << 3) | packet[2]); |
| 267 | /* byte 3: . . by8 bx8 . . . . | 284 | /* |
| 268 | byte 4: bx7 bx6 bx5 bx4 bx3 bx2 bx1 bx0 */ | 285 | * byte 3: . . by8 bx8 . . . . |
| 286 | * byte 4: bx7 bx6 bx5 bx4 bx3 bx2 bx1 bx0 | ||
| 287 | */ | ||
| 269 | x2 = ((packet[3] & 0x10) << 4) | packet[4]; | 288 | x2 = ((packet[3] & 0x10) << 4) | packet[4]; |
| 270 | /* byte 5: by7 by8 by5 by4 by3 by2 by1 by0 */ | 289 | /* byte 5: by7 by8 by5 by4 by3 by2 by1 by0 */ |
| 271 | y2 = ETP_2FT_YMAX - (((packet[3] & 0x20) << 3) | packet[5]); | 290 | y2 = ETP_2FT_YMAX - (((packet[3] & 0x20) << 3) | packet[5]); |
| 272 | /* For compatibility with the X Synaptics driver scale up one | 291 | /* |
| 273 | coordinate and report as ordinary mouse movent */ | 292 | * For compatibility with the X Synaptics driver scale up |
| 293 | * one coordinate and report as ordinary mouse movent | ||
| 294 | */ | ||
| 274 | input_report_abs(dev, ABS_X, x1 << 2); | 295 | input_report_abs(dev, ABS_X, x1 << 2); |
| 275 | input_report_abs(dev, ABS_Y, y1 << 2); | 296 | input_report_abs(dev, ABS_Y, y1 << 2); |
| 276 | /* For compatibility with the proprietary X Elantech driver | 297 | /* |
| 277 | report both coordinates as hat coordinates */ | 298 | * For compatibility with the proprietary X Elantech driver |
| 299 | * report both coordinates as hat coordinates | ||
| 300 | */ | ||
| 278 | input_report_abs(dev, ABS_HAT0X, x1); | 301 | input_report_abs(dev, ABS_HAT0X, x1); |
| 279 | input_report_abs(dev, ABS_HAT0Y, y1); | 302 | input_report_abs(dev, ABS_HAT0Y, y1); |
| 280 | input_report_abs(dev, ABS_HAT1X, x2); | 303 | input_report_abs(dev, ABS_HAT1X, x2); |
| @@ -596,8 +619,12 @@ int elantech_detect(struct psmouse *psmouse, bool set_properties) | |||
| 596 | param[0], param[1], param[2]); | 619 | param[0], param[1], param[2]); |
| 597 | 620 | ||
| 598 | if (param[0] == 0 || param[1] != 0) { | 621 | if (param[0] == 0 || param[1] != 0) { |
| 599 | pr_debug("elantech.c: Probably not a real Elantech touchpad. Aborting.\n"); | 622 | if (!force_elantech) { |
| 600 | return -1; | 623 | pr_debug("elantech.c: Probably not a real Elantech touchpad. Aborting.\n"); |
| 624 | return -1; | ||
| 625 | } | ||
| 626 | |||
| 627 | pr_debug("elantech.c: Probably not a real Elantech touchpad. Enabling anyway due to force_elantech.\n"); | ||
| 601 | } | 628 | } |
| 602 | 629 | ||
| 603 | if (set_properties) { | 630 | if (set_properties) { |
| @@ -666,7 +693,8 @@ int elantech_init(struct psmouse *psmouse) | |||
| 666 | * Assume every version greater than this is new EeePC style | 693 | * Assume every version greater than this is new EeePC style |
| 667 | * hardware with 6 byte packets | 694 | * hardware with 6 byte packets |
| 668 | */ | 695 | */ |
| 669 | if (etd->fw_version_maj >= 0x02 && etd->fw_version_min >= 0x30) { | 696 | if ((etd->fw_version_maj == 0x02 && etd->fw_version_min >= 0x30) || |
| 697 | etd->fw_version_maj > 0x02) { | ||
| 670 | etd->hw_version = 2; | 698 | etd->hw_version = 2; |
| 671 | /* For now show extra debug information */ | 699 | /* For now show extra debug information */ |
| 672 | etd->debug = 1; | 700 | etd->debug = 1; |
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index d8c0c8d6992c..cbc807264940 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c | |||
| @@ -110,6 +110,7 @@ static struct workqueue_struct *kpsmoused_wq; | |||
| 110 | struct psmouse_protocol { | 110 | struct psmouse_protocol { |
| 111 | enum psmouse_type type; | 111 | enum psmouse_type type; |
| 112 | bool maxproto; | 112 | bool maxproto; |
| 113 | bool ignore_parity; /* Protocol should ignore parity errors from KBC */ | ||
| 113 | const char *name; | 114 | const char *name; |
| 114 | const char *alias; | 115 | const char *alias; |
| 115 | int (*detect)(struct psmouse *, bool); | 116 | int (*detect)(struct psmouse *, bool); |
| @@ -288,7 +289,9 @@ static irqreturn_t psmouse_interrupt(struct serio *serio, | |||
| 288 | if (psmouse->state == PSMOUSE_IGNORE) | 289 | if (psmouse->state == PSMOUSE_IGNORE) |
| 289 | goto out; | 290 | goto out; |
| 290 | 291 | ||
| 291 | if (flags & (SERIO_PARITY|SERIO_TIMEOUT)) { | 292 | if (unlikely((flags & SERIO_TIMEOUT) || |
| 293 | ((flags & SERIO_PARITY) && !psmouse->ignore_parity))) { | ||
| 294 | |||
| 292 | if (psmouse->state == PSMOUSE_ACTIVATED) | 295 | if (psmouse->state == PSMOUSE_ACTIVATED) |
| 293 | printk(KERN_WARNING "psmouse.c: bad data from KBC -%s%s\n", | 296 | printk(KERN_WARNING "psmouse.c: bad data from KBC -%s%s\n", |
| 294 | flags & SERIO_TIMEOUT ? " timeout" : "", | 297 | flags & SERIO_TIMEOUT ? " timeout" : "", |
| @@ -759,6 +762,7 @@ static const struct psmouse_protocol psmouse_protocols[] = { | |||
| 759 | .name = "PS/2", | 762 | .name = "PS/2", |
| 760 | .alias = "bare", | 763 | .alias = "bare", |
| 761 | .maxproto = true, | 764 | .maxproto = true, |
| 765 | .ignore_parity = true, | ||
| 762 | .detect = ps2bare_detect, | 766 | .detect = ps2bare_detect, |
| 763 | }, | 767 | }, |
| 764 | #ifdef CONFIG_MOUSE_PS2_LOGIPS2PP | 768 | #ifdef CONFIG_MOUSE_PS2_LOGIPS2PP |
| @@ -786,6 +790,7 @@ static const struct psmouse_protocol psmouse_protocols[] = { | |||
| 786 | .name = "ImPS/2", | 790 | .name = "ImPS/2", |
| 787 | .alias = "imps", | 791 | .alias = "imps", |
| 788 | .maxproto = true, | 792 | .maxproto = true, |
| 793 | .ignore_parity = true, | ||
| 789 | .detect = intellimouse_detect, | 794 | .detect = intellimouse_detect, |
| 790 | }, | 795 | }, |
| 791 | { | 796 | { |
| @@ -793,6 +798,7 @@ static const struct psmouse_protocol psmouse_protocols[] = { | |||
| 793 | .name = "ImExPS/2", | 798 | .name = "ImExPS/2", |
| 794 | .alias = "exps", | 799 | .alias = "exps", |
| 795 | .maxproto = true, | 800 | .maxproto = true, |
| 801 | .ignore_parity = true, | ||
| 796 | .detect = im_explorer_detect, | 802 | .detect = im_explorer_detect, |
| 797 | }, | 803 | }, |
| 798 | #ifdef CONFIG_MOUSE_PS2_SYNAPTICS | 804 | #ifdef CONFIG_MOUSE_PS2_SYNAPTICS |
| @@ -1222,6 +1228,7 @@ static void psmouse_disconnect(struct serio *serio) | |||
| 1222 | static int psmouse_switch_protocol(struct psmouse *psmouse, | 1228 | static int psmouse_switch_protocol(struct psmouse *psmouse, |
| 1223 | const struct psmouse_protocol *proto) | 1229 | const struct psmouse_protocol *proto) |
| 1224 | { | 1230 | { |
| 1231 | const struct psmouse_protocol *selected_proto; | ||
| 1225 | struct input_dev *input_dev = psmouse->dev; | 1232 | struct input_dev *input_dev = psmouse->dev; |
| 1226 | 1233 | ||
| 1227 | input_dev->dev.parent = &psmouse->ps2dev.serio->dev; | 1234 | input_dev->dev.parent = &psmouse->ps2dev.serio->dev; |
| @@ -1245,9 +1252,14 @@ static int psmouse_switch_protocol(struct psmouse *psmouse, | |||
| 1245 | return -1; | 1252 | return -1; |
| 1246 | 1253 | ||
| 1247 | psmouse->type = proto->type; | 1254 | psmouse->type = proto->type; |
| 1248 | } else | 1255 | selected_proto = proto; |
| 1256 | } else { | ||
| 1249 | psmouse->type = psmouse_extensions(psmouse, | 1257 | psmouse->type = psmouse_extensions(psmouse, |
| 1250 | psmouse_max_proto, true); | 1258 | psmouse_max_proto, true); |
| 1259 | selected_proto = psmouse_protocol_by_type(psmouse->type); | ||
| 1260 | } | ||
| 1261 | |||
| 1262 | psmouse->ignore_parity = selected_proto->ignore_parity; | ||
| 1251 | 1263 | ||
| 1252 | /* | 1264 | /* |
| 1253 | * If mouse's packet size is 3 there is no point in polling the | 1265 | * If mouse's packet size is 3 there is no point in polling the |
| @@ -1267,7 +1279,7 @@ static int psmouse_switch_protocol(struct psmouse *psmouse, | |||
| 1267 | psmouse->resync_time = 0; | 1279 | psmouse->resync_time = 0; |
| 1268 | 1280 | ||
| 1269 | snprintf(psmouse->devname, sizeof(psmouse->devname), "%s %s %s", | 1281 | snprintf(psmouse->devname, sizeof(psmouse->devname), "%s %s %s", |
| 1270 | psmouse_protocol_by_type(psmouse->type)->name, psmouse->vendor, psmouse->name); | 1282 | selected_proto->name, psmouse->vendor, psmouse->name); |
| 1271 | 1283 | ||
| 1272 | input_dev->name = psmouse->devname; | 1284 | input_dev->name = psmouse->devname; |
| 1273 | input_dev->phys = psmouse->phys; | 1285 | input_dev->phys = psmouse->phys; |
diff --git a/drivers/input/mouse/psmouse.h b/drivers/input/mouse/psmouse.h index e053bdd137ff..593e910bfc7a 100644 --- a/drivers/input/mouse/psmouse.h +++ b/drivers/input/mouse/psmouse.h | |||
| @@ -47,6 +47,7 @@ struct psmouse { | |||
| 47 | unsigned char pktcnt; | 47 | unsigned char pktcnt; |
| 48 | unsigned char pktsize; | 48 | unsigned char pktsize; |
| 49 | unsigned char type; | 49 | unsigned char type; |
| 50 | bool ignore_parity; | ||
| 50 | bool acks_disable_command; | 51 | bool acks_disable_command; |
| 51 | unsigned int model; | 52 | unsigned int model; |
| 52 | unsigned long last; | 53 | unsigned long last; |
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index 026df6010161..ebd7a99efeae 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c | |||
| @@ -137,7 +137,8 @@ static int synaptics_capability(struct psmouse *psmouse) | |||
| 137 | if (synaptics_send_cmd(psmouse, SYN_QUE_CAPABILITIES, cap)) | 137 | if (synaptics_send_cmd(psmouse, SYN_QUE_CAPABILITIES, cap)) |
| 138 | return -1; | 138 | return -1; |
| 139 | priv->capabilities = (cap[0] << 16) | (cap[1] << 8) | cap[2]; | 139 | priv->capabilities = (cap[0] << 16) | (cap[1] << 8) | cap[2]; |
| 140 | priv->ext_cap = 0; | 140 | priv->ext_cap = priv->ext_cap_0c = 0; |
| 141 | |||
| 141 | if (!SYN_CAP_VALID(priv->capabilities)) | 142 | if (!SYN_CAP_VALID(priv->capabilities)) |
| 142 | return -1; | 143 | return -1; |
| 143 | 144 | ||
| @@ -150,7 +151,7 @@ static int synaptics_capability(struct psmouse *psmouse) | |||
| 150 | if (SYN_EXT_CAP_REQUESTS(priv->capabilities) >= 1) { | 151 | if (SYN_EXT_CAP_REQUESTS(priv->capabilities) >= 1) { |
| 151 | if (synaptics_send_cmd(psmouse, SYN_QUE_EXT_CAPAB, cap)) { | 152 | if (synaptics_send_cmd(psmouse, SYN_QUE_EXT_CAPAB, cap)) { |
| 152 | printk(KERN_ERR "Synaptics claims to have extended capabilities," | 153 | printk(KERN_ERR "Synaptics claims to have extended capabilities," |
| 153 | " but I'm not able to read them."); | 154 | " but I'm not able to read them.\n"); |
| 154 | } else { | 155 | } else { |
| 155 | priv->ext_cap = (cap[0] << 16) | (cap[1] << 8) | cap[2]; | 156 | priv->ext_cap = (cap[0] << 16) | (cap[1] << 8) | cap[2]; |
| 156 | 157 | ||
| @@ -162,6 +163,16 @@ static int synaptics_capability(struct psmouse *psmouse) | |||
| 162 | priv->ext_cap &= 0xff0fff; | 163 | priv->ext_cap &= 0xff0fff; |
| 163 | } | 164 | } |
| 164 | } | 165 | } |
| 166 | |||
| 167 | if (SYN_EXT_CAP_REQUESTS(priv->capabilities) >= 4) { | ||
| 168 | if (synaptics_send_cmd(psmouse, SYN_QUE_EXT_CAPAB_0C, cap)) { | ||
| 169 | printk(KERN_ERR "Synaptics claims to have extended capability 0x0c," | ||
| 170 | " but I'm not able to read it.\n"); | ||
| 171 | } else { | ||
| 172 | priv->ext_cap_0c = (cap[0] << 16) | (cap[1] << 8) | cap[2]; | ||
| 173 | } | ||
| 174 | } | ||
| 175 | |||
| 165 | return 0; | 176 | return 0; |
| 166 | } | 177 | } |
| 167 | 178 | ||
| @@ -348,7 +359,15 @@ static void synaptics_parse_hw_state(unsigned char buf[], struct synaptics_data | |||
| 348 | hw->left = (buf[0] & 0x01) ? 1 : 0; | 359 | hw->left = (buf[0] & 0x01) ? 1 : 0; |
| 349 | hw->right = (buf[0] & 0x02) ? 1 : 0; | 360 | hw->right = (buf[0] & 0x02) ? 1 : 0; |
| 350 | 361 | ||
| 351 | if (SYN_CAP_MIDDLE_BUTTON(priv->capabilities)) { | 362 | if (SYN_CAP_CLICKPAD(priv->ext_cap_0c)) { |
| 363 | /* | ||
| 364 | * Clickpad's button is transmitted as middle button, | ||
| 365 | * however, since it is primary button, we will report | ||
| 366 | * it as BTN_LEFT. | ||
| 367 | */ | ||
| 368 | hw->left = ((buf[0] ^ buf[3]) & 0x01) ? 1 : 0; | ||
| 369 | |||
| 370 | } else if (SYN_CAP_MIDDLE_BUTTON(priv->capabilities)) { | ||
| 352 | hw->middle = ((buf[0] ^ buf[3]) & 0x01) ? 1 : 0; | 371 | hw->middle = ((buf[0] ^ buf[3]) & 0x01) ? 1 : 0; |
| 353 | if (hw->w == 2) | 372 | if (hw->w == 2) |
| 354 | hw->scroll = (signed char)(buf[1]); | 373 | hw->scroll = (signed char)(buf[1]); |
| @@ -593,6 +612,12 @@ static void set_input_params(struct input_dev *dev, struct synaptics_data *priv) | |||
| 593 | 612 | ||
| 594 | dev->absres[ABS_X] = priv->x_res; | 613 | dev->absres[ABS_X] = priv->x_res; |
| 595 | dev->absres[ABS_Y] = priv->y_res; | 614 | dev->absres[ABS_Y] = priv->y_res; |
| 615 | |||
| 616 | if (SYN_CAP_CLICKPAD(priv->ext_cap_0c)) { | ||
| 617 | /* Clickpads report only left button */ | ||
| 618 | __clear_bit(BTN_RIGHT, dev->keybit); | ||
| 619 | __clear_bit(BTN_MIDDLE, dev->keybit); | ||
| 620 | } | ||
| 596 | } | 621 | } |
| 597 | 622 | ||
| 598 | static void synaptics_disconnect(struct psmouse *psmouse) | 623 | static void synaptics_disconnect(struct psmouse *psmouse) |
| @@ -697,10 +722,10 @@ int synaptics_init(struct psmouse *psmouse) | |||
| 697 | 722 | ||
| 698 | priv->pkt_type = SYN_MODEL_NEWABS(priv->model_id) ? SYN_NEWABS : SYN_OLDABS; | 723 | priv->pkt_type = SYN_MODEL_NEWABS(priv->model_id) ? SYN_NEWABS : SYN_OLDABS; |
| 699 | 724 | ||
| 700 | printk(KERN_INFO "Synaptics Touchpad, model: %ld, fw: %ld.%ld, id: %#lx, caps: %#lx/%#lx\n", | 725 | printk(KERN_INFO "Synaptics Touchpad, model: %ld, fw: %ld.%ld, id: %#lx, caps: %#lx/%#lx/%#lx\n", |
| 701 | SYN_ID_MODEL(priv->identity), | 726 | SYN_ID_MODEL(priv->identity), |
| 702 | SYN_ID_MAJOR(priv->identity), SYN_ID_MINOR(priv->identity), | 727 | SYN_ID_MAJOR(priv->identity), SYN_ID_MINOR(priv->identity), |
| 703 | priv->model_id, priv->capabilities, priv->ext_cap); | 728 | priv->model_id, priv->capabilities, priv->ext_cap, priv->ext_cap_0c); |
| 704 | 729 | ||
| 705 | set_input_params(psmouse->dev, priv); | 730 | set_input_params(psmouse->dev, priv); |
| 706 | 731 | ||
diff --git a/drivers/input/mouse/synaptics.h b/drivers/input/mouse/synaptics.h index f0f40a331dc8..ae37c5d162a4 100644 --- a/drivers/input/mouse/synaptics.h +++ b/drivers/input/mouse/synaptics.h | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #define SYN_QUE_SERIAL_NUMBER_SUFFIX 0x07 | 18 | #define SYN_QUE_SERIAL_NUMBER_SUFFIX 0x07 |
| 19 | #define SYN_QUE_RESOLUTION 0x08 | 19 | #define SYN_QUE_RESOLUTION 0x08 |
| 20 | #define SYN_QUE_EXT_CAPAB 0x09 | 20 | #define SYN_QUE_EXT_CAPAB 0x09 |
| 21 | #define SYN_QUE_EXT_CAPAB_0C 0x0c | ||
| 21 | 22 | ||
| 22 | /* synatics modes */ | 23 | /* synatics modes */ |
| 23 | #define SYN_BIT_ABSOLUTE_MODE (1 << 7) | 24 | #define SYN_BIT_ABSOLUTE_MODE (1 << 7) |
| @@ -48,6 +49,8 @@ | |||
| 48 | #define SYN_CAP_VALID(c) ((((c) & 0x00ff00) >> 8) == 0x47) | 49 | #define SYN_CAP_VALID(c) ((((c) & 0x00ff00) >> 8) == 0x47) |
| 49 | #define SYN_EXT_CAP_REQUESTS(c) (((c) & 0x700000) >> 20) | 50 | #define SYN_EXT_CAP_REQUESTS(c) (((c) & 0x700000) >> 20) |
| 50 | #define SYN_CAP_MULTI_BUTTON_NO(ec) (((ec) & 0x00f000) >> 12) | 51 | #define SYN_CAP_MULTI_BUTTON_NO(ec) (((ec) & 0x00f000) >> 12) |
| 52 | #define SYN_CAP_PRODUCT_ID(ec) (((ec) & 0xff0000) >> 16) | ||
| 53 | #define SYN_CAP_CLICKPAD(ex0c) ((ex0c) & 0x100100) | ||
| 51 | 54 | ||
| 52 | /* synaptics modes query bits */ | 55 | /* synaptics modes query bits */ |
| 53 | #define SYN_MODE_ABSOLUTE(m) ((m) & (1 << 7)) | 56 | #define SYN_MODE_ABSOLUTE(m) ((m) & (1 << 7)) |
| @@ -96,6 +99,7 @@ struct synaptics_data { | |||
| 96 | unsigned long int model_id; /* Model-ID */ | 99 | unsigned long int model_id; /* Model-ID */ |
| 97 | unsigned long int capabilities; /* Capabilities */ | 100 | unsigned long int capabilities; /* Capabilities */ |
| 98 | unsigned long int ext_cap; /* Extended Capabilities */ | 101 | unsigned long int ext_cap; /* Extended Capabilities */ |
| 102 | unsigned long int ext_cap_0c; /* Ext Caps from 0x0c query */ | ||
| 99 | unsigned long int identity; /* Identification */ | 103 | unsigned long int identity; /* Identification */ |
| 100 | int x_res; /* X resolution in units/mm */ | 104 | int x_res; /* X resolution in units/mm */ |
| 101 | int y_res; /* Y resolution in units/mm */ | 105 | int y_res; /* Y resolution in units/mm */ |
diff --git a/drivers/input/touchscreen/eeti_ts.c b/drivers/input/touchscreen/eeti_ts.c index 204b8a1a601c..75f8b73010fa 100644 --- a/drivers/input/touchscreen/eeti_ts.c +++ b/drivers/input/touchscreen/eeti_ts.c | |||
| @@ -124,14 +124,25 @@ static irqreturn_t eeti_ts_isr(int irq, void *dev_id) | |||
| 124 | return IRQ_HANDLED; | 124 | return IRQ_HANDLED; |
| 125 | } | 125 | } |
| 126 | 126 | ||
| 127 | static int eeti_ts_open(struct input_dev *dev) | 127 | static void eeti_ts_start(struct eeti_ts_priv *priv) |
| 128 | { | 128 | { |
| 129 | struct eeti_ts_priv *priv = input_get_drvdata(dev); | ||
| 130 | |||
| 131 | enable_irq(priv->irq); | 129 | enable_irq(priv->irq); |
| 132 | 130 | ||
| 133 | /* Read the events once to arm the IRQ */ | 131 | /* Read the events once to arm the IRQ */ |
| 134 | eeti_ts_read(&priv->work); | 132 | eeti_ts_read(&priv->work); |
| 133 | } | ||
| 134 | |||
| 135 | static void eeti_ts_stop(struct eeti_ts_priv *priv) | ||
| 136 | { | ||
| 137 | disable_irq(priv->irq); | ||
| 138 | cancel_work_sync(&priv->work); | ||
| 139 | } | ||
| 140 | |||
| 141 | static int eeti_ts_open(struct input_dev *dev) | ||
| 142 | { | ||
| 143 | struct eeti_ts_priv *priv = input_get_drvdata(dev); | ||
| 144 | |||
| 145 | eeti_ts_start(priv); | ||
| 135 | 146 | ||
| 136 | return 0; | 147 | return 0; |
| 137 | } | 148 | } |
| @@ -140,8 +151,7 @@ static void eeti_ts_close(struct input_dev *dev) | |||
| 140 | { | 151 | { |
| 141 | struct eeti_ts_priv *priv = input_get_drvdata(dev); | 152 | struct eeti_ts_priv *priv = input_get_drvdata(dev); |
| 142 | 153 | ||
| 143 | disable_irq(priv->irq); | 154 | eeti_ts_stop(priv); |
| 144 | cancel_work_sync(&priv->work); | ||
| 145 | } | 155 | } |
| 146 | 156 | ||
| 147 | static int __devinit eeti_ts_probe(struct i2c_client *client, | 157 | static int __devinit eeti_ts_probe(struct i2c_client *client, |
| @@ -153,10 +163,12 @@ static int __devinit eeti_ts_probe(struct i2c_client *client, | |||
| 153 | unsigned int irq_flags; | 163 | unsigned int irq_flags; |
| 154 | int err = -ENOMEM; | 164 | int err = -ENOMEM; |
| 155 | 165 | ||
| 156 | /* In contrast to what's described in the datasheet, there seems | 166 | /* |
| 167 | * In contrast to what's described in the datasheet, there seems | ||
| 157 | * to be no way of probing the presence of that device using I2C | 168 | * to be no way of probing the presence of that device using I2C |
| 158 | * commands. So we need to blindly believe it is there, and wait | 169 | * commands. So we need to blindly believe it is there, and wait |
| 159 | * for interrupts to occur. */ | 170 | * for interrupts to occur. |
| 171 | */ | ||
| 160 | 172 | ||
| 161 | priv = kzalloc(sizeof(*priv), GFP_KERNEL); | 173 | priv = kzalloc(sizeof(*priv), GFP_KERNEL); |
| 162 | if (!priv) { | 174 | if (!priv) { |
| @@ -212,9 +224,11 @@ static int __devinit eeti_ts_probe(struct i2c_client *client, | |||
| 212 | goto err2; | 224 | goto err2; |
| 213 | } | 225 | } |
| 214 | 226 | ||
| 215 | /* Disable the irq for now. It will be enabled once the input device | 227 | /* |
| 216 | * is opened. */ | 228 | * Disable the device for now. It will be enabled once the |
| 217 | disable_irq(priv->irq); | 229 | * input device is opened. |
| 230 | */ | ||
| 231 | eeti_ts_stop(priv); | ||
| 218 | 232 | ||
| 219 | device_init_wakeup(&client->dev, 0); | 233 | device_init_wakeup(&client->dev, 0); |
| 220 | return 0; | 234 | return 0; |
| @@ -235,6 +249,12 @@ static int __devexit eeti_ts_remove(struct i2c_client *client) | |||
| 235 | struct eeti_ts_priv *priv = i2c_get_clientdata(client); | 249 | struct eeti_ts_priv *priv = i2c_get_clientdata(client); |
| 236 | 250 | ||
| 237 | free_irq(priv->irq, priv); | 251 | free_irq(priv->irq, priv); |
| 252 | /* | ||
| 253 | * eeti_ts_stop() leaves IRQ disabled. We need to re-enable it | ||
| 254 | * so that device still works if we reload the driver. | ||
| 255 | */ | ||
| 256 | enable_irq(priv->irq); | ||
| 257 | |||
| 238 | input_unregister_device(priv->input); | 258 | input_unregister_device(priv->input); |
| 239 | i2c_set_clientdata(client, NULL); | 259 | i2c_set_clientdata(client, NULL); |
| 240 | kfree(priv); | 260 | kfree(priv); |
| @@ -246,6 +266,14 @@ static int __devexit eeti_ts_remove(struct i2c_client *client) | |||
| 246 | static int eeti_ts_suspend(struct i2c_client *client, pm_message_t mesg) | 266 | static int eeti_ts_suspend(struct i2c_client *client, pm_message_t mesg) |
| 247 | { | 267 | { |
| 248 | struct eeti_ts_priv *priv = i2c_get_clientdata(client); | 268 | struct eeti_ts_priv *priv = i2c_get_clientdata(client); |
| 269 | struct input_dev *input_dev = priv->input; | ||
| 270 | |||
| 271 | mutex_lock(&input_dev->mutex); | ||
| 272 | |||
| 273 | if (input_dev->users) | ||
| 274 | eeti_ts_stop(priv); | ||
| 275 | |||
| 276 | mutex_unlock(&input_dev->mutex); | ||
| 249 | 277 | ||
| 250 | if (device_may_wakeup(&client->dev)) | 278 | if (device_may_wakeup(&client->dev)) |
| 251 | enable_irq_wake(priv->irq); | 279 | enable_irq_wake(priv->irq); |
| @@ -256,10 +284,18 @@ static int eeti_ts_suspend(struct i2c_client *client, pm_message_t mesg) | |||
| 256 | static int eeti_ts_resume(struct i2c_client *client) | 284 | static int eeti_ts_resume(struct i2c_client *client) |
| 257 | { | 285 | { |
| 258 | struct eeti_ts_priv *priv = i2c_get_clientdata(client); | 286 | struct eeti_ts_priv *priv = i2c_get_clientdata(client); |
| 287 | struct input_dev *input_dev = priv->input; | ||
| 259 | 288 | ||
| 260 | if (device_may_wakeup(&client->dev)) | 289 | if (device_may_wakeup(&client->dev)) |
| 261 | disable_irq_wake(priv->irq); | 290 | disable_irq_wake(priv->irq); |
| 262 | 291 | ||
| 292 | mutex_lock(&input_dev->mutex); | ||
| 293 | |||
| 294 | if (input_dev->users) | ||
| 295 | eeti_ts_start(priv); | ||
| 296 | |||
| 297 | mutex_unlock(&input_dev->mutex); | ||
| 298 | |||
| 263 | return 0; | 299 | return 0; |
| 264 | } | 300 | } |
| 265 | #else | 301 | #else |
diff --git a/drivers/mtd/internal.h b/drivers/mtd/internal.h deleted file mode 100644 index e69de29bb2d1..000000000000 --- a/drivers/mtd/internal.h +++ /dev/null | |||
diff --git a/drivers/mtd/mtdbdi.c b/drivers/mtd/mtdbdi.c deleted file mode 100644 index e69de29bb2d1..000000000000 --- a/drivers/mtd/mtdbdi.c +++ /dev/null | |||
diff --git a/drivers/net/arm/ep93xx_eth.c b/drivers/net/arm/ep93xx_eth.c index 6995169d285a..cd17d09f385c 100644 --- a/drivers/net/arm/ep93xx_eth.c +++ b/drivers/net/arm/ep93xx_eth.c | |||
| @@ -311,11 +311,6 @@ err: | |||
| 311 | processed++; | 311 | processed++; |
| 312 | } | 312 | } |
| 313 | 313 | ||
| 314 | if (processed) { | ||
| 315 | wrw(ep, REG_RXDENQ, processed); | ||
| 316 | wrw(ep, REG_RXSTSENQ, processed); | ||
| 317 | } | ||
| 318 | |||
| 319 | return processed; | 314 | return processed; |
| 320 | } | 315 | } |
| 321 | 316 | ||
| @@ -350,6 +345,11 @@ poll_some_more: | |||
| 350 | goto poll_some_more; | 345 | goto poll_some_more; |
| 351 | } | 346 | } |
| 352 | 347 | ||
| 348 | if (rx) { | ||
| 349 | wrw(ep, REG_RXDENQ, rx); | ||
| 350 | wrw(ep, REG_RXSTSENQ, rx); | ||
| 351 | } | ||
| 352 | |||
| 353 | return rx; | 353 | return rx; |
| 354 | } | 354 | } |
| 355 | 355 | ||
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index fb8fc7d1b50d..dbf81788bb40 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c | |||
| @@ -4633,6 +4633,9 @@ static void __e1000e_disable_aspm(struct pci_dev *pdev, u16 state) | |||
| 4633 | reg16 &= ~state; | 4633 | reg16 &= ~state; |
| 4634 | pci_write_config_word(pdev, pos + PCI_EXP_LNKCTL, reg16); | 4634 | pci_write_config_word(pdev, pos + PCI_EXP_LNKCTL, reg16); |
| 4635 | 4635 | ||
| 4636 | if (!pdev->bus->self) | ||
| 4637 | return; | ||
| 4638 | |||
| 4636 | pos = pci_pcie_cap(pdev->bus->self); | 4639 | pos = pci_pcie_cap(pdev->bus->self); |
| 4637 | pci_read_config_word(pdev->bus->self, pos + PCI_EXP_LNKCTL, ®16); | 4640 | pci_read_config_word(pdev->bus->self, pos + PCI_EXP_LNKCTL, ®16); |
| 4638 | reg16 &= ~state; | 4641 | reg16 &= ~state; |
diff --git a/drivers/net/fec.c b/drivers/net/fec.c index 9f98c1c4a344..9b4e8f797a7a 100644 --- a/drivers/net/fec.c +++ b/drivers/net/fec.c | |||
| @@ -1653,7 +1653,7 @@ fec_set_mac_address(struct net_device *dev, void *p) | |||
| 1653 | (dev->dev_addr[1] << 16) | (dev->dev_addr[0] << 24), | 1653 | (dev->dev_addr[1] << 16) | (dev->dev_addr[0] << 24), |
| 1654 | fep->hwp + FEC_ADDR_LOW); | 1654 | fep->hwp + FEC_ADDR_LOW); |
| 1655 | writel((dev->dev_addr[5] << 16) | (dev->dev_addr[4] << 24), | 1655 | writel((dev->dev_addr[5] << 16) | (dev->dev_addr[4] << 24), |
| 1656 | fep + FEC_ADDR_HIGH); | 1656 | fep->hwp + FEC_ADDR_HIGH); |
| 1657 | return 0; | 1657 | return 0; |
| 1658 | } | 1658 | } |
| 1659 | 1659 | ||
diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig index fc5938ba3d78..a527e37728cd 100644 --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig | |||
| @@ -88,6 +88,11 @@ config LSI_ET1011C_PHY | |||
| 88 | ---help--- | 88 | ---help--- |
| 89 | Supports the LSI ET1011C PHY. | 89 | Supports the LSI ET1011C PHY. |
| 90 | 90 | ||
| 91 | config MICREL_PHY | ||
| 92 | tristate "Driver for Micrel PHYs" | ||
| 93 | ---help--- | ||
| 94 | Supports the KSZ9021, VSC8201, KS8001 PHYs. | ||
| 95 | |||
| 91 | config FIXED_PHY | 96 | config FIXED_PHY |
| 92 | bool "Driver for MDIO Bus/PHY emulation with fixed speed/link PHYs" | 97 | bool "Driver for MDIO Bus/PHY emulation with fixed speed/link PHYs" |
| 93 | depends on PHYLIB=y | 98 | depends on PHYLIB=y |
diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile index 1342585af381..13bebab65d02 100644 --- a/drivers/net/phy/Makefile +++ b/drivers/net/phy/Makefile | |||
| @@ -20,4 +20,5 @@ obj-$(CONFIG_MDIO_BITBANG) += mdio-bitbang.o | |||
| 20 | obj-$(CONFIG_MDIO_GPIO) += mdio-gpio.o | 20 | obj-$(CONFIG_MDIO_GPIO) += mdio-gpio.o |
| 21 | obj-$(CONFIG_NATIONAL_PHY) += national.o | 21 | obj-$(CONFIG_NATIONAL_PHY) += national.o |
| 22 | obj-$(CONFIG_STE10XP) += ste10Xp.o | 22 | obj-$(CONFIG_STE10XP) += ste10Xp.o |
| 23 | obj-$(CONFIG_MICREL_PHY) += micrel.o | ||
| 23 | obj-$(CONFIG_MDIO_OCTEON) += mdio-octeon.o | 24 | obj-$(CONFIG_MDIO_OCTEON) += mdio-octeon.o |
diff --git a/drivers/net/phy/mdio-octeon.c b/drivers/net/phy/mdio-octeon.c index a872aea4ed74..f443d43edd80 100644 --- a/drivers/net/phy/mdio-octeon.c +++ b/drivers/net/phy/mdio-octeon.c | |||
| @@ -88,6 +88,7 @@ static int octeon_mdiobus_write(struct mii_bus *bus, int phy_id, | |||
| 88 | static int __init octeon_mdiobus_probe(struct platform_device *pdev) | 88 | static int __init octeon_mdiobus_probe(struct platform_device *pdev) |
| 89 | { | 89 | { |
| 90 | struct octeon_mdiobus *bus; | 90 | struct octeon_mdiobus *bus; |
| 91 | union cvmx_smix_en smi_en; | ||
| 91 | int i; | 92 | int i; |
| 92 | int err = -ENOENT; | 93 | int err = -ENOENT; |
| 93 | 94 | ||
| @@ -103,6 +104,10 @@ static int __init octeon_mdiobus_probe(struct platform_device *pdev) | |||
| 103 | if (!bus->mii_bus) | 104 | if (!bus->mii_bus) |
| 104 | goto err; | 105 | goto err; |
| 105 | 106 | ||
| 107 | smi_en.u64 = 0; | ||
| 108 | smi_en.s.en = 1; | ||
| 109 | cvmx_write_csr(CVMX_SMIX_EN(bus->unit), smi_en.u64); | ||
| 110 | |||
| 106 | /* | 111 | /* |
| 107 | * Standard Octeon evaluation boards don't support phy | 112 | * Standard Octeon evaluation boards don't support phy |
| 108 | * interrupts, we need to poll. | 113 | * interrupts, we need to poll. |
| @@ -133,17 +138,22 @@ err_register: | |||
| 133 | 138 | ||
| 134 | err: | 139 | err: |
| 135 | devm_kfree(&pdev->dev, bus); | 140 | devm_kfree(&pdev->dev, bus); |
| 141 | smi_en.u64 = 0; | ||
| 142 | cvmx_write_csr(CVMX_SMIX_EN(bus->unit), smi_en.u64); | ||
| 136 | return err; | 143 | return err; |
| 137 | } | 144 | } |
| 138 | 145 | ||
| 139 | static int __exit octeon_mdiobus_remove(struct platform_device *pdev) | 146 | static int __exit octeon_mdiobus_remove(struct platform_device *pdev) |
| 140 | { | 147 | { |
| 141 | struct octeon_mdiobus *bus; | 148 | struct octeon_mdiobus *bus; |
| 149 | union cvmx_smix_en smi_en; | ||
| 142 | 150 | ||
| 143 | bus = dev_get_drvdata(&pdev->dev); | 151 | bus = dev_get_drvdata(&pdev->dev); |
| 144 | 152 | ||
| 145 | mdiobus_unregister(bus->mii_bus); | 153 | mdiobus_unregister(bus->mii_bus); |
| 146 | mdiobus_free(bus->mii_bus); | 154 | mdiobus_free(bus->mii_bus); |
| 155 | smi_en.u64 = 0; | ||
| 156 | cvmx_write_csr(CVMX_SMIX_EN(bus->unit), smi_en.u64); | ||
| 147 | return 0; | 157 | return 0; |
| 148 | } | 158 | } |
| 149 | 159 | ||
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c new file mode 100644 index 000000000000..0cd80e4d71d9 --- /dev/null +++ b/drivers/net/phy/micrel.c | |||
| @@ -0,0 +1,104 @@ | |||
| 1 | /* | ||
| 2 | * drivers/net/phy/micrel.c | ||
| 3 | * | ||
| 4 | * Driver for Micrel PHYs | ||
| 5 | * | ||
| 6 | * Author: David J. Choi | ||
| 7 | * | ||
| 8 | * Copyright (c) 2010 Micrel, Inc. | ||
| 9 | * | ||
| 10 | * This program is free software; you can redistribute it and/or modify it | ||
| 11 | * under the terms of the GNU General Public License as published by the | ||
| 12 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 13 | * option) any later version. | ||
| 14 | * | ||
| 15 | * Support : ksz9021 , vsc8201, ks8001 | ||
| 16 | */ | ||
| 17 | |||
| 18 | #include <linux/kernel.h> | ||
| 19 | #include <linux/module.h> | ||
| 20 | #include <linux/phy.h> | ||
| 21 | |||
| 22 | #define PHY_ID_KSZ9021 0x00221611 | ||
| 23 | #define PHY_ID_VSC8201 0x000FC413 | ||
| 24 | #define PHY_ID_KS8001 0x0022161A | ||
| 25 | |||
| 26 | |||
| 27 | static int kszphy_config_init(struct phy_device *phydev) | ||
| 28 | { | ||
| 29 | return 0; | ||
| 30 | } | ||
| 31 | |||
| 32 | |||
| 33 | static struct phy_driver ks8001_driver = { | ||
| 34 | .phy_id = PHY_ID_KS8001, | ||
| 35 | .phy_id_mask = 0x00fffff0, | ||
| 36 | .features = PHY_BASIC_FEATURES, | ||
| 37 | .flags = PHY_POLL, | ||
| 38 | .config_init = kszphy_config_init, | ||
| 39 | .config_aneg = genphy_config_aneg, | ||
| 40 | .read_status = genphy_read_status, | ||
| 41 | .driver = { .owner = THIS_MODULE,}, | ||
| 42 | }; | ||
| 43 | |||
| 44 | static struct phy_driver vsc8201_driver = { | ||
| 45 | .phy_id = PHY_ID_VSC8201, | ||
| 46 | .name = "Micrel VSC8201", | ||
| 47 | .phy_id_mask = 0x00fffff0, | ||
| 48 | .features = PHY_BASIC_FEATURES, | ||
| 49 | .flags = PHY_POLL, | ||
| 50 | .config_init = kszphy_config_init, | ||
| 51 | .config_aneg = genphy_config_aneg, | ||
| 52 | .read_status = genphy_read_status, | ||
| 53 | .driver = { .owner = THIS_MODULE,}, | ||
| 54 | }; | ||
| 55 | |||
| 56 | static struct phy_driver ksz9021_driver = { | ||
| 57 | .phy_id = PHY_ID_KSZ9021, | ||
| 58 | .phy_id_mask = 0x000fff10, | ||
| 59 | .name = "Micrel KSZ9021 Gigabit PHY", | ||
| 60 | .features = PHY_GBIT_FEATURES | SUPPORTED_Pause, | ||
| 61 | .flags = PHY_POLL, | ||
| 62 | .config_init = kszphy_config_init, | ||
| 63 | .config_aneg = genphy_config_aneg, | ||
| 64 | .read_status = genphy_read_status, | ||
| 65 | .driver = { .owner = THIS_MODULE, }, | ||
| 66 | }; | ||
| 67 | |||
| 68 | static int __init ksphy_init(void) | ||
| 69 | { | ||
| 70 | int ret; | ||
| 71 | |||
| 72 | ret = phy_driver_register(&ks8001_driver); | ||
| 73 | if (ret) | ||
| 74 | goto err1; | ||
| 75 | ret = phy_driver_register(&vsc8201_driver); | ||
| 76 | if (ret) | ||
| 77 | goto err2; | ||
| 78 | |||
| 79 | ret = phy_driver_register(&ksz9021_driver); | ||
| 80 | if (ret) | ||
| 81 | goto err3; | ||
| 82 | return 0; | ||
| 83 | |||
| 84 | err3: | ||
| 85 | phy_driver_unregister(&vsc8201_driver); | ||
| 86 | err2: | ||
| 87 | phy_driver_unregister(&ks8001_driver); | ||
| 88 | err1: | ||
| 89 | return ret; | ||
| 90 | } | ||
| 91 | |||
| 92 | static void __exit ksphy_exit(void) | ||
| 93 | { | ||
| 94 | phy_driver_unregister(&ks8001_driver); | ||
| 95 | phy_driver_unregister(&vsc8201_driver); | ||
| 96 | phy_driver_unregister(&ksz9021_driver); | ||
| 97 | } | ||
| 98 | |||
| 99 | module_init(ksphy_init); | ||
| 100 | module_exit(ksphy_exit); | ||
| 101 | |||
| 102 | MODULE_DESCRIPTION("Micrel PHY driver"); | ||
| 103 | MODULE_AUTHOR("David J. Choi"); | ||
| 104 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c index 6e281bc825e5..8518a2e58e53 100644 --- a/drivers/net/ppp_generic.c +++ b/drivers/net/ppp_generic.c | |||
| @@ -405,6 +405,7 @@ static ssize_t ppp_read(struct file *file, char __user *buf, | |||
| 405 | DECLARE_WAITQUEUE(wait, current); | 405 | DECLARE_WAITQUEUE(wait, current); |
| 406 | ssize_t ret; | 406 | ssize_t ret; |
| 407 | struct sk_buff *skb = NULL; | 407 | struct sk_buff *skb = NULL; |
| 408 | struct iovec iov; | ||
| 408 | 409 | ||
| 409 | ret = count; | 410 | ret = count; |
| 410 | 411 | ||
| @@ -448,7 +449,9 @@ static ssize_t ppp_read(struct file *file, char __user *buf, | |||
| 448 | if (skb->len > count) | 449 | if (skb->len > count) |
| 449 | goto outf; | 450 | goto outf; |
| 450 | ret = -EFAULT; | 451 | ret = -EFAULT; |
| 451 | if (copy_to_user(buf, skb->data, skb->len)) | 452 | iov.iov_base = buf; |
| 453 | iov.iov_len = count; | ||
| 454 | if (skb_copy_datagram_iovec(skb, 0, &iov, skb->len)) | ||
| 452 | goto outf; | 455 | goto outf; |
| 453 | ret = skb->len; | 456 | ret = skb->len; |
| 454 | 457 | ||
| @@ -1567,13 +1570,22 @@ ppp_input(struct ppp_channel *chan, struct sk_buff *skb) | |||
| 1567 | struct channel *pch = chan->ppp; | 1570 | struct channel *pch = chan->ppp; |
| 1568 | int proto; | 1571 | int proto; |
| 1569 | 1572 | ||
| 1570 | if (!pch || skb->len == 0) { | 1573 | if (!pch) { |
| 1571 | kfree_skb(skb); | 1574 | kfree_skb(skb); |
| 1572 | return; | 1575 | return; |
| 1573 | } | 1576 | } |
| 1574 | 1577 | ||
| 1575 | proto = PPP_PROTO(skb); | ||
| 1576 | read_lock_bh(&pch->upl); | 1578 | read_lock_bh(&pch->upl); |
| 1579 | if (!pskb_may_pull(skb, 2)) { | ||
| 1580 | kfree_skb(skb); | ||
| 1581 | if (pch->ppp) { | ||
| 1582 | ++pch->ppp->dev->stats.rx_length_errors; | ||
| 1583 | ppp_receive_error(pch->ppp); | ||
| 1584 | } | ||
| 1585 | goto done; | ||
| 1586 | } | ||
| 1587 | |||
| 1588 | proto = PPP_PROTO(skb); | ||
| 1577 | if (!pch->ppp || proto >= 0xc000 || proto == PPP_CCPFRAG) { | 1589 | if (!pch->ppp || proto >= 0xc000 || proto == PPP_CCPFRAG) { |
| 1578 | /* put it on the channel queue */ | 1590 | /* put it on the channel queue */ |
| 1579 | skb_queue_tail(&pch->file.rq, skb); | 1591 | skb_queue_tail(&pch->file.rq, skb); |
| @@ -1585,6 +1597,8 @@ ppp_input(struct ppp_channel *chan, struct sk_buff *skb) | |||
| 1585 | } else { | 1597 | } else { |
| 1586 | ppp_do_recv(pch->ppp, skb, pch); | 1598 | ppp_do_recv(pch->ppp, skb, pch); |
| 1587 | } | 1599 | } |
| 1600 | |||
| 1601 | done: | ||
| 1588 | read_unlock_bh(&pch->upl); | 1602 | read_unlock_bh(&pch->upl); |
| 1589 | } | 1603 | } |
| 1590 | 1604 | ||
| @@ -1617,7 +1631,8 @@ ppp_input_error(struct ppp_channel *chan, int code) | |||
| 1617 | static void | 1631 | static void |
| 1618 | ppp_receive_frame(struct ppp *ppp, struct sk_buff *skb, struct channel *pch) | 1632 | ppp_receive_frame(struct ppp *ppp, struct sk_buff *skb, struct channel *pch) |
| 1619 | { | 1633 | { |
| 1620 | if (pskb_may_pull(skb, 2)) { | 1634 | /* note: a 0-length skb is used as an error indication */ |
| 1635 | if (skb->len > 0) { | ||
| 1621 | #ifdef CONFIG_PPP_MULTILINK | 1636 | #ifdef CONFIG_PPP_MULTILINK |
| 1622 | /* XXX do channel-level decompression here */ | 1637 | /* XXX do channel-level decompression here */ |
| 1623 | if (PPP_PROTO(skb) == PPP_MP) | 1638 | if (PPP_PROTO(skb) == PPP_MP) |
| @@ -1625,15 +1640,10 @@ ppp_receive_frame(struct ppp *ppp, struct sk_buff *skb, struct channel *pch) | |||
| 1625 | else | 1640 | else |
| 1626 | #endif /* CONFIG_PPP_MULTILINK */ | 1641 | #endif /* CONFIG_PPP_MULTILINK */ |
| 1627 | ppp_receive_nonmp_frame(ppp, skb); | 1642 | ppp_receive_nonmp_frame(ppp, skb); |
| 1628 | return; | 1643 | } else { |
| 1644 | kfree_skb(skb); | ||
| 1645 | ppp_receive_error(ppp); | ||
| 1629 | } | 1646 | } |
| 1630 | |||
| 1631 | if (skb->len > 0) | ||
| 1632 | /* note: a 0-length skb is used as an error indication */ | ||
| 1633 | ++ppp->dev->stats.rx_length_errors; | ||
| 1634 | |||
| 1635 | kfree_skb(skb); | ||
| 1636 | ppp_receive_error(ppp); | ||
| 1637 | } | 1647 | } |
| 1638 | 1648 | ||
| 1639 | static void | 1649 | static void |
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 4748c21eb72e..dd8106ff35aa 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
| @@ -1042,14 +1042,14 @@ static void rtl8169_vlan_rx_register(struct net_device *dev, | |||
| 1042 | } | 1042 | } |
| 1043 | 1043 | ||
| 1044 | static int rtl8169_rx_vlan_skb(struct rtl8169_private *tp, struct RxDesc *desc, | 1044 | static int rtl8169_rx_vlan_skb(struct rtl8169_private *tp, struct RxDesc *desc, |
| 1045 | struct sk_buff *skb) | 1045 | struct sk_buff *skb, int polling) |
| 1046 | { | 1046 | { |
| 1047 | u32 opts2 = le32_to_cpu(desc->opts2); | 1047 | u32 opts2 = le32_to_cpu(desc->opts2); |
| 1048 | struct vlan_group *vlgrp = tp->vlgrp; | 1048 | struct vlan_group *vlgrp = tp->vlgrp; |
| 1049 | int ret; | 1049 | int ret; |
| 1050 | 1050 | ||
| 1051 | if (vlgrp && (opts2 & RxVlanTag)) { | 1051 | if (vlgrp && (opts2 & RxVlanTag)) { |
| 1052 | vlan_hwaccel_receive_skb(skb, vlgrp, swab16(opts2 & 0xffff)); | 1052 | __vlan_hwaccel_rx(skb, vlgrp, swab16(opts2 & 0xffff), polling); |
| 1053 | ret = 0; | 1053 | ret = 0; |
| 1054 | } else | 1054 | } else |
| 1055 | ret = -1; | 1055 | ret = -1; |
| @@ -1066,7 +1066,7 @@ static inline u32 rtl8169_tx_vlan_tag(struct rtl8169_private *tp, | |||
| 1066 | } | 1066 | } |
| 1067 | 1067 | ||
| 1068 | static int rtl8169_rx_vlan_skb(struct rtl8169_private *tp, struct RxDesc *desc, | 1068 | static int rtl8169_rx_vlan_skb(struct rtl8169_private *tp, struct RxDesc *desc, |
| 1069 | struct sk_buff *skb) | 1069 | struct sk_buff *skb, int polling) |
| 1070 | { | 1070 | { |
| 1071 | return -1; | 1071 | return -1; |
| 1072 | } | 1072 | } |
| @@ -4445,12 +4445,20 @@ out: | |||
| 4445 | return done; | 4445 | return done; |
| 4446 | } | 4446 | } |
| 4447 | 4447 | ||
| 4448 | /* | ||
| 4449 | * Warning : rtl8169_rx_interrupt() might be called : | ||
| 4450 | * 1) from NAPI (softirq) context | ||
| 4451 | * (polling = 1 : we should call netif_receive_skb()) | ||
| 4452 | * 2) from process context (rtl8169_reset_task()) | ||
| 4453 | * (polling = 0 : we must call netif_rx() instead) | ||
| 4454 | */ | ||
| 4448 | static int rtl8169_rx_interrupt(struct net_device *dev, | 4455 | static int rtl8169_rx_interrupt(struct net_device *dev, |
| 4449 | struct rtl8169_private *tp, | 4456 | struct rtl8169_private *tp, |
| 4450 | void __iomem *ioaddr, u32 budget) | 4457 | void __iomem *ioaddr, u32 budget) |
| 4451 | { | 4458 | { |
| 4452 | unsigned int cur_rx, rx_left; | 4459 | unsigned int cur_rx, rx_left; |
| 4453 | unsigned int delta, count; | 4460 | unsigned int delta, count; |
| 4461 | int polling = (budget != ~(u32)0) ? 1 : 0; | ||
| 4454 | 4462 | ||
| 4455 | cur_rx = tp->cur_rx; | 4463 | cur_rx = tp->cur_rx; |
| 4456 | rx_left = NUM_RX_DESC + tp->dirty_rx - cur_rx; | 4464 | rx_left = NUM_RX_DESC + tp->dirty_rx - cur_rx; |
| @@ -4512,8 +4520,12 @@ static int rtl8169_rx_interrupt(struct net_device *dev, | |||
| 4512 | skb_put(skb, pkt_size); | 4520 | skb_put(skb, pkt_size); |
| 4513 | skb->protocol = eth_type_trans(skb, dev); | 4521 | skb->protocol = eth_type_trans(skb, dev); |
| 4514 | 4522 | ||
| 4515 | if (rtl8169_rx_vlan_skb(tp, desc, skb) < 0) | 4523 | if (rtl8169_rx_vlan_skb(tp, desc, skb, polling) < 0) { |
| 4516 | netif_receive_skb(skb); | 4524 | if (likely(polling)) |
| 4525 | netif_receive_skb(skb); | ||
| 4526 | else | ||
| 4527 | netif_rx(skb); | ||
| 4528 | } | ||
| 4517 | 4529 | ||
| 4518 | dev->stats.rx_bytes += pkt_size; | 4530 | dev->stats.rx_bytes += pkt_size; |
| 4519 | dev->stats.rx_packets++; | 4531 | dev->stats.rx_packets++; |
diff --git a/drivers/net/sb1250-mac.c b/drivers/net/sb1250-mac.c index 9944e5d662c0..04efc0c1bda9 100644 --- a/drivers/net/sb1250-mac.c +++ b/drivers/net/sb1250-mac.c | |||
| @@ -2353,17 +2353,36 @@ static int sbmac_init(struct platform_device *pldev, long long base) | |||
| 2353 | 2353 | ||
| 2354 | sc->mii_bus = mdiobus_alloc(); | 2354 | sc->mii_bus = mdiobus_alloc(); |
| 2355 | if (sc->mii_bus == NULL) { | 2355 | if (sc->mii_bus == NULL) { |
| 2356 | sbmac_uninitctx(sc); | 2356 | err = -ENOMEM; |
| 2357 | return -ENOMEM; | 2357 | goto uninit_ctx; |
| 2358 | } | 2358 | } |
| 2359 | 2359 | ||
| 2360 | sc->mii_bus->name = sbmac_mdio_string; | ||
| 2361 | snprintf(sc->mii_bus->id, MII_BUS_ID_SIZE, "%x", idx); | ||
| 2362 | sc->mii_bus->priv = sc; | ||
| 2363 | sc->mii_bus->read = sbmac_mii_read; | ||
| 2364 | sc->mii_bus->write = sbmac_mii_write; | ||
| 2365 | sc->mii_bus->irq = sc->phy_irq; | ||
| 2366 | for (i = 0; i < PHY_MAX_ADDR; ++i) | ||
| 2367 | sc->mii_bus->irq[i] = SBMAC_PHY_INT; | ||
| 2368 | |||
| 2369 | sc->mii_bus->parent = &pldev->dev; | ||
| 2370 | /* | ||
| 2371 | * Probe PHY address | ||
| 2372 | */ | ||
| 2373 | err = mdiobus_register(sc->mii_bus); | ||
| 2374 | if (err) { | ||
| 2375 | printk(KERN_ERR "%s: unable to register MDIO bus\n", | ||
| 2376 | dev->name); | ||
| 2377 | goto free_mdio; | ||
| 2378 | } | ||
| 2379 | dev_set_drvdata(&pldev->dev, sc->mii_bus); | ||
| 2380 | |||
| 2360 | err = register_netdev(dev); | 2381 | err = register_netdev(dev); |
| 2361 | if (err) { | 2382 | if (err) { |
| 2362 | printk(KERN_ERR "%s.%d: unable to register netdev\n", | 2383 | printk(KERN_ERR "%s.%d: unable to register netdev\n", |
| 2363 | sbmac_string, idx); | 2384 | sbmac_string, idx); |
| 2364 | mdiobus_free(sc->mii_bus); | 2385 | goto unreg_mdio; |
| 2365 | sbmac_uninitctx(sc); | ||
| 2366 | return err; | ||
| 2367 | } | 2386 | } |
| 2368 | 2387 | ||
| 2369 | pr_info("%s.%d: registered as %s\n", sbmac_string, idx, dev->name); | 2388 | pr_info("%s.%d: registered as %s\n", sbmac_string, idx, dev->name); |
| @@ -2379,19 +2398,15 @@ static int sbmac_init(struct platform_device *pldev, long long base) | |||
| 2379 | pr_info("%s: SiByte Ethernet at 0x%08Lx, address: %pM\n", | 2398 | pr_info("%s: SiByte Ethernet at 0x%08Lx, address: %pM\n", |
| 2380 | dev->name, base, eaddr); | 2399 | dev->name, base, eaddr); |
| 2381 | 2400 | ||
| 2382 | sc->mii_bus->name = sbmac_mdio_string; | ||
| 2383 | snprintf(sc->mii_bus->id, MII_BUS_ID_SIZE, "%x", idx); | ||
| 2384 | sc->mii_bus->priv = sc; | ||
| 2385 | sc->mii_bus->read = sbmac_mii_read; | ||
| 2386 | sc->mii_bus->write = sbmac_mii_write; | ||
| 2387 | sc->mii_bus->irq = sc->phy_irq; | ||
| 2388 | for (i = 0; i < PHY_MAX_ADDR; ++i) | ||
| 2389 | sc->mii_bus->irq[i] = SBMAC_PHY_INT; | ||
| 2390 | |||
| 2391 | sc->mii_bus->parent = &pldev->dev; | ||
| 2392 | dev_set_drvdata(&pldev->dev, sc->mii_bus); | ||
| 2393 | |||
| 2394 | return 0; | 2401 | return 0; |
| 2402 | unreg_mdio: | ||
| 2403 | mdiobus_unregister(sc->mii_bus); | ||
| 2404 | dev_set_drvdata(&pldev->dev, NULL); | ||
| 2405 | free_mdio: | ||
| 2406 | mdiobus_free(sc->mii_bus); | ||
| 2407 | uninit_ctx: | ||
| 2408 | sbmac_uninitctx(sc); | ||
| 2409 | return err; | ||
| 2395 | } | 2410 | } |
| 2396 | 2411 | ||
| 2397 | 2412 | ||
| @@ -2417,16 +2432,6 @@ static int sbmac_open(struct net_device *dev) | |||
| 2417 | goto out_err; | 2432 | goto out_err; |
| 2418 | } | 2433 | } |
| 2419 | 2434 | ||
| 2420 | /* | ||
| 2421 | * Probe PHY address | ||
| 2422 | */ | ||
| 2423 | err = mdiobus_register(sc->mii_bus); | ||
| 2424 | if (err) { | ||
| 2425 | printk(KERN_ERR "%s: unable to register MDIO bus\n", | ||
| 2426 | dev->name); | ||
| 2427 | goto out_unirq; | ||
| 2428 | } | ||
| 2429 | |||
| 2430 | sc->sbm_speed = sbmac_speed_none; | 2435 | sc->sbm_speed = sbmac_speed_none; |
| 2431 | sc->sbm_duplex = sbmac_duplex_none; | 2436 | sc->sbm_duplex = sbmac_duplex_none; |
| 2432 | sc->sbm_fc = sbmac_fc_none; | 2437 | sc->sbm_fc = sbmac_fc_none; |
| @@ -2457,11 +2462,7 @@ static int sbmac_open(struct net_device *dev) | |||
| 2457 | return 0; | 2462 | return 0; |
| 2458 | 2463 | ||
| 2459 | out_unregister: | 2464 | out_unregister: |
| 2460 | mdiobus_unregister(sc->mii_bus); | ||
| 2461 | |||
| 2462 | out_unirq: | ||
| 2463 | free_irq(dev->irq, dev); | 2465 | free_irq(dev->irq, dev); |
| 2464 | |||
| 2465 | out_err: | 2466 | out_err: |
| 2466 | return err; | 2467 | return err; |
| 2467 | } | 2468 | } |
| @@ -2650,9 +2651,6 @@ static int sbmac_close(struct net_device *dev) | |||
| 2650 | 2651 | ||
| 2651 | phy_disconnect(sc->phy_dev); | 2652 | phy_disconnect(sc->phy_dev); |
| 2652 | sc->phy_dev = NULL; | 2653 | sc->phy_dev = NULL; |
| 2653 | |||
| 2654 | mdiobus_unregister(sc->mii_bus); | ||
| 2655 | |||
| 2656 | free_irq(dev->irq, dev); | 2654 | free_irq(dev->irq, dev); |
| 2657 | 2655 | ||
| 2658 | sbdma_emptyring(&(sc->sbm_txdma)); | 2656 | sbdma_emptyring(&(sc->sbm_txdma)); |
| @@ -2760,6 +2758,7 @@ static int __exit sbmac_remove(struct platform_device *pldev) | |||
| 2760 | 2758 | ||
| 2761 | unregister_netdev(dev); | 2759 | unregister_netdev(dev); |
| 2762 | sbmac_uninitctx(sc); | 2760 | sbmac_uninitctx(sc); |
| 2761 | mdiobus_unregister(sc->mii_bus); | ||
| 2763 | mdiobus_free(sc->mii_bus); | 2762 | mdiobus_free(sc->mii_bus); |
| 2764 | iounmap(sc->sbm_base); | 2763 | iounmap(sc->sbm_base); |
| 2765 | free_netdev(dev); | 2764 | free_netdev(dev); |
diff --git a/drivers/net/usb/Kconfig b/drivers/net/usb/Kconfig index 5d58abc224f4..d7b7018a1de1 100644 --- a/drivers/net/usb/Kconfig +++ b/drivers/net/usb/Kconfig | |||
| @@ -400,7 +400,6 @@ config USB_IPHETH | |||
| 400 | config USB_SIERRA_NET | 400 | config USB_SIERRA_NET |
| 401 | tristate "USB-to-WWAN Driver for Sierra Wireless modems" | 401 | tristate "USB-to-WWAN Driver for Sierra Wireless modems" |
| 402 | depends on USB_USBNET | 402 | depends on USB_USBNET |
| 403 | default y | ||
| 404 | help | 403 | help |
| 405 | Choose this option if you have a Sierra Wireless USB-to-WWAN device. | 404 | Choose this option if you have a Sierra Wireless USB-to-WWAN device. |
| 406 | 405 | ||
diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c index 04b281002a76..5dfed9297b22 100644 --- a/drivers/net/usb/dm9601.c +++ b/drivers/net/usb/dm9601.c | |||
| @@ -240,7 +240,7 @@ static int dm_write_shared_word(struct usbnet *dev, int phy, u8 reg, __le16 valu | |||
| 240 | goto out; | 240 | goto out; |
| 241 | 241 | ||
| 242 | dm_write_reg(dev, DM_SHARED_ADDR, phy ? (reg | 0x40) : reg); | 242 | dm_write_reg(dev, DM_SHARED_ADDR, phy ? (reg | 0x40) : reg); |
| 243 | dm_write_reg(dev, DM_SHARED_CTRL, phy ? 0x1c : 0x14); | 243 | dm_write_reg(dev, DM_SHARED_CTRL, phy ? 0x1a : 0x12); |
| 244 | 244 | ||
| 245 | for (i = 0; i < DM_TIMEOUT; i++) { | 245 | for (i = 0; i < DM_TIMEOUT; i++) { |
| 246 | u8 tmp; | 246 | u8 tmp; |
diff --git a/drivers/net/usb/sierra_net.c b/drivers/net/usb/sierra_net.c index a44f9e0ea098..f1942d69a0d5 100644 --- a/drivers/net/usb/sierra_net.c +++ b/drivers/net/usb/sierra_net.c | |||
| @@ -789,6 +789,9 @@ static int sierra_net_bind(struct usbnet *dev, struct usb_interface *intf) | |||
| 789 | /* prepare sync message from template */ | 789 | /* prepare sync message from template */ |
| 790 | memcpy(priv->sync_msg, sync_tmplate, sizeof(priv->sync_msg)); | 790 | memcpy(priv->sync_msg, sync_tmplate, sizeof(priv->sync_msg)); |
| 791 | 791 | ||
| 792 | /* initiate the sync sequence */ | ||
| 793 | sierra_net_dosync(dev); | ||
| 794 | |||
| 792 | return 0; | 795 | return 0; |
| 793 | } | 796 | } |
| 794 | 797 | ||
diff --git a/drivers/net/wireless/p54/p54pci.c b/drivers/net/wireless/p54/p54pci.c index 269fda362836..c24067f1a0cb 100644 --- a/drivers/net/wireless/p54/p54pci.c +++ b/drivers/net/wireless/p54/p54pci.c | |||
| @@ -246,7 +246,7 @@ static void p54p_check_tx_ring(struct ieee80211_hw *dev, u32 *index, | |||
| 246 | u32 idx, i; | 246 | u32 idx, i; |
| 247 | 247 | ||
| 248 | i = (*index) % ring_limit; | 248 | i = (*index) % ring_limit; |
| 249 | (*index) = idx = le32_to_cpu(ring_control->device_idx[1]); | 249 | (*index) = idx = le32_to_cpu(ring_control->device_idx[ring_index]); |
| 250 | idx %= ring_limit; | 250 | idx %= ring_limit; |
| 251 | 251 | ||
| 252 | while (i != idx) { | 252 | while (i != idx) { |
diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c index 18ecae4a4375..b4748337223b 100644 --- a/drivers/of/of_mdio.c +++ b/drivers/of/of_mdio.c | |||
| @@ -69,7 +69,7 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np) | |||
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | phy = get_phy_device(mdio, be32_to_cpup(addr)); | 71 | phy = get_phy_device(mdio, be32_to_cpup(addr)); |
| 72 | if (!phy) { | 72 | if (!phy || IS_ERR(phy)) { |
| 73 | dev_err(&mdio->dev, "error probing PHY at address %i\n", | 73 | dev_err(&mdio->dev, "error probing PHY at address %i\n", |
| 74 | *addr); | 74 | *addr); |
| 75 | continue; | 75 | continue; |
diff --git a/drivers/pcmcia/db1xxx_ss.c b/drivers/pcmcia/db1xxx_ss.c index 2d48196a48cd..0f4cc3f00028 100644 --- a/drivers/pcmcia/db1xxx_ss.c +++ b/drivers/pcmcia/db1xxx_ss.c | |||
| @@ -146,7 +146,6 @@ static irqreturn_t db1200_pcmcia_cdirq(int irq, void *data) | |||
| 146 | static int db1x_pcmcia_setup_irqs(struct db1x_pcmcia_sock *sock) | 146 | static int db1x_pcmcia_setup_irqs(struct db1x_pcmcia_sock *sock) |
| 147 | { | 147 | { |
| 148 | int ret; | 148 | int ret; |
| 149 | unsigned long flags; | ||
| 150 | 149 | ||
| 151 | if (sock->stschg_irq != -1) { | 150 | if (sock->stschg_irq != -1) { |
| 152 | ret = request_irq(sock->stschg_irq, db1000_pcmcia_stschgirq, | 151 | ret = request_irq(sock->stschg_irq, db1000_pcmcia_stschgirq, |
| @@ -162,30 +161,23 @@ static int db1x_pcmcia_setup_irqs(struct db1x_pcmcia_sock *sock) | |||
| 162 | * active one disabled. | 161 | * active one disabled. |
| 163 | */ | 162 | */ |
| 164 | if (sock->board_type == BOARD_TYPE_DB1200) { | 163 | if (sock->board_type == BOARD_TYPE_DB1200) { |
| 165 | local_irq_save(flags); | ||
| 166 | |||
| 167 | ret = request_irq(sock->insert_irq, db1200_pcmcia_cdirq, | 164 | ret = request_irq(sock->insert_irq, db1200_pcmcia_cdirq, |
| 168 | IRQF_DISABLED, "pcmcia_insert", sock); | 165 | IRQF_DISABLED, "pcmcia_insert", sock); |
| 169 | if (ret) { | 166 | if (ret) |
| 170 | local_irq_restore(flags); | ||
| 171 | goto out1; | 167 | goto out1; |
| 172 | } | ||
| 173 | 168 | ||
| 174 | ret = request_irq(sock->eject_irq, db1200_pcmcia_cdirq, | 169 | ret = request_irq(sock->eject_irq, db1200_pcmcia_cdirq, |
| 175 | IRQF_DISABLED, "pcmcia_eject", sock); | 170 | IRQF_DISABLED, "pcmcia_eject", sock); |
| 176 | if (ret) { | 171 | if (ret) { |
| 177 | free_irq(sock->insert_irq, sock); | 172 | free_irq(sock->insert_irq, sock); |
| 178 | local_irq_restore(flags); | ||
| 179 | goto out1; | 173 | goto out1; |
| 180 | } | 174 | } |
| 181 | 175 | ||
| 182 | /* disable the currently active one */ | 176 | /* enable the currently silent one */ |
| 183 | if (db1200_card_inserted(sock)) | 177 | if (db1200_card_inserted(sock)) |
| 184 | disable_irq_nosync(sock->insert_irq); | 178 | enable_irq(sock->eject_irq); |
| 185 | else | 179 | else |
| 186 | disable_irq_nosync(sock->eject_irq); | 180 | enable_irq(sock->insert_irq); |
| 187 | |||
| 188 | local_irq_restore(flags); | ||
| 189 | } else { | 181 | } else { |
| 190 | /* all other (older) Db1x00 boards use a GPIO to show | 182 | /* all other (older) Db1x00 boards use a GPIO to show |
| 191 | * card detection status: use both-edge triggers. | 183 | * card detection status: use both-edge triggers. |
diff --git a/drivers/serial/8250_pnp.c b/drivers/serial/8250_pnp.c index 24485cc62ff8..4822cb50cd0f 100644 --- a/drivers/serial/8250_pnp.c +++ b/drivers/serial/8250_pnp.c | |||
| @@ -348,6 +348,8 @@ static const struct pnp_device_id pnp_dev_table[] = { | |||
| 348 | { "FUJ02E6", 0 }, | 348 | { "FUJ02E6", 0 }, |
| 349 | /* Fujitsu Wacom 2FGT Tablet PC device */ | 349 | /* Fujitsu Wacom 2FGT Tablet PC device */ |
| 350 | { "FUJ02E7", 0 }, | 350 | { "FUJ02E7", 0 }, |
| 351 | /* Fujitsu Wacom 1FGT Tablet PC device */ | ||
| 352 | { "FUJ02E9", 0 }, | ||
| 351 | /* | 353 | /* |
| 352 | * LG C1 EXPRESS DUAL (C1-PB11A3) touch screen (actually a FUJ02E6 in | 354 | * LG C1 EXPRESS DUAL (C1-PB11A3) touch screen (actually a FUJ02E6 in |
| 353 | * disguise) | 355 | * disguise) |
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c index 3119fddaedb5..a176ab4bd65b 100644 --- a/drivers/serial/mpc52xx_uart.c +++ b/drivers/serial/mpc52xx_uart.c | |||
| @@ -29,39 +29,6 @@ | |||
| 29 | * kind, whether express or implied. | 29 | * kind, whether express or implied. |
| 30 | */ | 30 | */ |
| 31 | 31 | ||
| 32 | /* Platform device Usage : | ||
| 33 | * | ||
| 34 | * Since PSCs can have multiple function, the correct driver for each one | ||
| 35 | * is selected by calling mpc52xx_match_psc_function(...). The function | ||
| 36 | * handled by this driver is "uart". | ||
| 37 | * | ||
| 38 | * The driver init all necessary registers to place the PSC in uart mode without | ||
| 39 | * DCD. However, the pin multiplexing aren't changed and should be set either | ||
| 40 | * by the bootloader or in the platform init code. | ||
| 41 | * | ||
| 42 | * The idx field must be equal to the PSC index (e.g. 0 for PSC1, 1 for PSC2, | ||
| 43 | * and so on). So the PSC1 is mapped to /dev/ttyPSC0, PSC2 to /dev/ttyPSC1 and | ||
| 44 | * so on. But be warned, it's an ABSOLUTE REQUIREMENT ! This is needed mainly | ||
| 45 | * fpr the console code : without this 1:1 mapping, at early boot time, when we | ||
| 46 | * are parsing the kernel args console=ttyPSC?, we wouldn't know which PSC it | ||
| 47 | * will be mapped to. | ||
| 48 | */ | ||
| 49 | |||
| 50 | /* OF Platform device Usage : | ||
| 51 | * | ||
| 52 | * This driver is only used for PSCs configured in uart mode. The device | ||
| 53 | * tree will have a node for each PSC with "mpc52xx-psc-uart" in the compatible | ||
| 54 | * list. | ||
| 55 | * | ||
| 56 | * By default, PSC devices are enumerated in the order they are found. However | ||
| 57 | * a particular PSC number can be forces by adding 'device_no = <port#>' | ||
| 58 | * to the device node. | ||
| 59 | * | ||
| 60 | * The driver init all necessary registers to place the PSC in uart mode without | ||
| 61 | * DCD. However, the pin multiplexing aren't changed and should be set either | ||
| 62 | * by the bootloader or in the platform init code. | ||
| 63 | */ | ||
| 64 | |||
| 65 | #undef DEBUG | 32 | #undef DEBUG |
| 66 | 33 | ||
| 67 | #include <linux/device.h> | 34 | #include <linux/device.h> |
diff --git a/drivers/serial/pmac_zilog.c b/drivers/serial/pmac_zilog.c index 4eaa043ca2a8..700e10833bf9 100644 --- a/drivers/serial/pmac_zilog.c +++ b/drivers/serial/pmac_zilog.c | |||
| @@ -752,8 +752,10 @@ static void pmz_break_ctl(struct uart_port *port, int break_state) | |||
| 752 | uap->curregs[R5] = new_reg; | 752 | uap->curregs[R5] = new_reg; |
| 753 | 753 | ||
| 754 | /* NOTE: Not subject to 'transmitter active' rule. */ | 754 | /* NOTE: Not subject to 'transmitter active' rule. */ |
| 755 | if (ZS_IS_ASLEEP(uap)) | 755 | if (ZS_IS_ASLEEP(uap)) { |
| 756 | spin_unlock_irqrestore(&port->lock, flags); | ||
| 756 | return; | 757 | return; |
| 758 | } | ||
| 757 | write_zsreg(uap, R5, uap->curregs[R5]); | 759 | write_zsreg(uap, R5, uap->curregs[R5]); |
| 758 | } | 760 | } |
| 759 | 761 | ||
diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c index d8356af118a8..e0de0d0eedea 100644 --- a/drivers/spi/omap2_mcspi.c +++ b/drivers/spi/omap2_mcspi.c | |||
| @@ -204,6 +204,7 @@ static inline void mcspi_write_chconf0(const struct spi_device *spi, u32 val) | |||
| 204 | 204 | ||
| 205 | cs->chconf0 = val; | 205 | cs->chconf0 = val; |
| 206 | mcspi_write_cs_reg(spi, OMAP2_MCSPI_CHCONF0, val); | 206 | mcspi_write_cs_reg(spi, OMAP2_MCSPI_CHCONF0, val); |
| 207 | mcspi_read_cs_reg(spi, OMAP2_MCSPI_CHCONF0); | ||
| 207 | } | 208 | } |
| 208 | 209 | ||
| 209 | static void omap2_mcspi_set_dma_req(const struct spi_device *spi, | 210 | static void omap2_mcspi_set_dma_req(const struct spi_device *spi, |
| @@ -532,7 +533,7 @@ omap2_mcspi_txrx_pio(struct spi_device *spi, struct spi_transfer *xfer) | |||
| 532 | goto out; | 533 | goto out; |
| 533 | } | 534 | } |
| 534 | #ifdef VERBOSE | 535 | #ifdef VERBOSE |
| 535 | dev_dbg(&spi->dev, "write-%d %04x\n", | 536 | dev_dbg(&spi->dev, "write-%d %08x\n", |
| 536 | word_len, *tx); | 537 | word_len, *tx); |
| 537 | #endif | 538 | #endif |
| 538 | __raw_writel(*tx++, tx_reg); | 539 | __raw_writel(*tx++, tx_reg); |
| @@ -550,7 +551,7 @@ omap2_mcspi_txrx_pio(struct spi_device *spi, struct spi_transfer *xfer) | |||
| 550 | mcspi_write_chconf0(spi, l); | 551 | mcspi_write_chconf0(spi, l); |
| 551 | *rx++ = __raw_readl(rx_reg); | 552 | *rx++ = __raw_readl(rx_reg); |
| 552 | #ifdef VERBOSE | 553 | #ifdef VERBOSE |
| 553 | dev_dbg(&spi->dev, "read-%d %04x\n", | 554 | dev_dbg(&spi->dev, "read-%d %08x\n", |
| 554 | word_len, *(rx - 1)); | 555 | word_len, *(rx - 1)); |
| 555 | #endif | 556 | #endif |
| 556 | } | 557 | } |
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 9ffb0fdbd6fe..b3a1f9259b62 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c | |||
| @@ -41,7 +41,7 @@ static void spidev_release(struct device *dev) | |||
| 41 | spi->master->cleanup(spi); | 41 | spi->master->cleanup(spi); |
| 42 | 42 | ||
| 43 | spi_master_put(spi->master); | 43 | spi_master_put(spi->master); |
| 44 | kfree(dev); | 44 | kfree(spi); |
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | static ssize_t | 47 | static ssize_t |
| @@ -257,6 +257,7 @@ int spi_add_device(struct spi_device *spi) | |||
| 257 | { | 257 | { |
| 258 | static DEFINE_MUTEX(spi_add_lock); | 258 | static DEFINE_MUTEX(spi_add_lock); |
| 259 | struct device *dev = spi->master->dev.parent; | 259 | struct device *dev = spi->master->dev.parent; |
| 260 | struct device *d; | ||
| 260 | int status; | 261 | int status; |
| 261 | 262 | ||
| 262 | /* Chipselects are numbered 0..max; validate. */ | 263 | /* Chipselects are numbered 0..max; validate. */ |
| @@ -278,10 +279,11 @@ int spi_add_device(struct spi_device *spi) | |||
| 278 | */ | 279 | */ |
| 279 | mutex_lock(&spi_add_lock); | 280 | mutex_lock(&spi_add_lock); |
| 280 | 281 | ||
| 281 | if (bus_find_device_by_name(&spi_bus_type, NULL, dev_name(&spi->dev)) | 282 | d = bus_find_device_by_name(&spi_bus_type, NULL, dev_name(&spi->dev)); |
| 282 | != NULL) { | 283 | if (d != NULL) { |
| 283 | dev_err(dev, "chipselect %d already in use\n", | 284 | dev_err(dev, "chipselect %d already in use\n", |
| 284 | spi->chip_select); | 285 | spi->chip_select); |
| 286 | put_device(d); | ||
| 285 | status = -EBUSY; | 287 | status = -EBUSY; |
| 286 | goto done; | 288 | goto done; |
| 287 | } | 289 | } |
diff --git a/drivers/staging/dt3155/dt3155_drv.c b/drivers/staging/dt3155/dt3155_drv.c index e2c44ec6fc45..7ac2c6d8e9a3 100644 --- a/drivers/staging/dt3155/dt3155_drv.c +++ b/drivers/staging/dt3155/dt3155_drv.c | |||
| @@ -464,9 +464,9 @@ static void dt3155_init_isr(int minor) | |||
| 464 | /* 50/60 Hz should be set before this point but let's make sure it is */ | 464 | /* 50/60 Hz should be set before this point but let's make sure it is */ |
| 465 | /* right anyway */ | 465 | /* right anyway */ |
| 466 | 466 | ||
| 467 | ReadI2C(dt3155_lbase[ minor ], CONFIG, &i2c_csr2.reg); | 467 | ReadI2C(dt3155_lbase[ minor ], CSR2, &i2c_csr2.reg); |
| 468 | i2c_csr2.fld.HZ50 = FORMAT50HZ; | 468 | i2c_csr2.fld.HZ50 = FORMAT50HZ; |
| 469 | WriteI2C(dt3155_lbase[ minor ], CONFIG, i2c_config.reg); | 469 | WriteI2C(dt3155_lbase[ minor ], CSR2, i2c_csr2.reg); |
| 470 | 470 | ||
| 471 | /* enable busmaster chip, clear flags */ | 471 | /* enable busmaster chip, clear flags */ |
| 472 | 472 | ||
diff --git a/drivers/staging/hv/Hv.c b/drivers/staging/hv/Hv.c index 5d53889fb4a4..3a1112d29aeb 100644 --- a/drivers/staging/hv/Hv.c +++ b/drivers/staging/hv/Hv.c | |||
| @@ -306,9 +306,9 @@ void HvCleanup(void) | |||
| 306 | DPRINT_ENTER(VMBUS); | 306 | DPRINT_ENTER(VMBUS); |
| 307 | 307 | ||
| 308 | if (gHvContext.SignalEventBuffer) { | 308 | if (gHvContext.SignalEventBuffer) { |
| 309 | kfree(gHvContext.SignalEventBuffer); | ||
| 309 | gHvContext.SignalEventBuffer = NULL; | 310 | gHvContext.SignalEventBuffer = NULL; |
| 310 | gHvContext.SignalEventParam = NULL; | 311 | gHvContext.SignalEventParam = NULL; |
| 311 | kfree(gHvContext.SignalEventBuffer); | ||
| 312 | } | 312 | } |
| 313 | 313 | ||
| 314 | if (gHvContext.HypercallPage) { | 314 | if (gHvContext.HypercallPage) { |
diff --git a/drivers/staging/hv/RndisFilter.c b/drivers/staging/hv/RndisFilter.c index cd2930de2176..6704f64c93f0 100644 --- a/drivers/staging/hv/RndisFilter.c +++ b/drivers/staging/hv/RndisFilter.c | |||
| @@ -751,6 +751,7 @@ static int RndisFilterOpenDevice(struct rndis_device *Device) | |||
| 751 | 751 | ||
| 752 | ret = RndisFilterSetPacketFilter(Device, | 752 | ret = RndisFilterSetPacketFilter(Device, |
| 753 | NDIS_PACKET_TYPE_BROADCAST | | 753 | NDIS_PACKET_TYPE_BROADCAST | |
| 754 | NDIS_PACKET_TYPE_ALL_MULTICAST | | ||
| 754 | NDIS_PACKET_TYPE_DIRECTED); | 755 | NDIS_PACKET_TYPE_DIRECTED); |
| 755 | if (ret == 0) | 756 | if (ret == 0) |
| 756 | Device->State = RNDIS_DEV_DATAINITIALIZED; | 757 | Device->State = RNDIS_DEV_DATAINITIALIZED; |
diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c index 2ccb6b93fe47..ab27d9a4446d 100644 --- a/drivers/staging/hv/netvsc_drv.c +++ b/drivers/staging/hv/netvsc_drv.c | |||
| @@ -403,8 +403,7 @@ static int netvsc_probe(struct device *device) | |||
| 403 | if (!net_drv_obj->Base.OnDeviceAdd) | 403 | if (!net_drv_obj->Base.OnDeviceAdd) |
| 404 | return -1; | 404 | return -1; |
| 405 | 405 | ||
| 406 | net = alloc_netdev(sizeof(struct net_device_context), "seth%d", | 406 | net = alloc_etherdev(sizeof(struct net_device_context)); |
| 407 | ether_setup); | ||
| 408 | if (!net) | 407 | if (!net) |
| 409 | return -1; | 408 | return -1; |
| 410 | 409 | ||
diff --git a/drivers/staging/iio/accel/lis3l02dq_core.c b/drivers/staging/iio/accel/lis3l02dq_core.c index ea76902797bb..82e43588e8a5 100644 --- a/drivers/staging/iio/accel/lis3l02dq_core.c +++ b/drivers/staging/iio/accel/lis3l02dq_core.c | |||
| @@ -618,7 +618,7 @@ static int lis3l02dq_thresh_handler_th(struct iio_dev *dev_info, | |||
| 618 | static void lis3l02dq_thresh_handler_bh_no_check(struct work_struct *work_s) | 618 | static void lis3l02dq_thresh_handler_bh_no_check(struct work_struct *work_s) |
| 619 | { | 619 | { |
| 620 | struct iio_work_cont *wc | 620 | struct iio_work_cont *wc |
| 621 | = container_of(work_s, struct iio_work_cont, ws_nocheck); | 621 | = container_of(work_s, struct iio_work_cont, ws); |
| 622 | struct lis3l02dq_state *st = wc->st; | 622 | struct lis3l02dq_state *st = wc->st; |
| 623 | u8 t; | 623 | u8 t; |
| 624 | 624 | ||
diff --git a/drivers/staging/iio/accel/lis3l02dq_ring.c b/drivers/staging/iio/accel/lis3l02dq_ring.c index 93712430e579..a4d97ea0df3d 100644 --- a/drivers/staging/iio/accel/lis3l02dq_ring.c +++ b/drivers/staging/iio/accel/lis3l02dq_ring.c | |||
| @@ -493,6 +493,9 @@ int lis3l02dq_probe_trigger(struct iio_dev *indio_dev) | |||
| 493 | struct lis3l02dq_state *state = indio_dev->dev_data; | 493 | struct lis3l02dq_state *state = indio_dev->dev_data; |
| 494 | 494 | ||
| 495 | state->trig = iio_allocate_trigger(); | 495 | state->trig = iio_allocate_trigger(); |
| 496 | if (!state->trig) | ||
| 497 | return -ENOMEM; | ||
| 498 | |||
| 496 | state->trig->name = kmalloc(IIO_TRIGGER_NAME_LENGTH, GFP_KERNEL); | 499 | state->trig->name = kmalloc(IIO_TRIGGER_NAME_LENGTH, GFP_KERNEL); |
| 497 | if (!state->trig->name) { | 500 | if (!state->trig->name) { |
| 498 | ret = -ENOMEM; | 501 | ret = -ENOMEM; |
diff --git a/drivers/staging/iio/adc/max1363_core.c b/drivers/staging/iio/adc/max1363_core.c index 790d1cc9cdc3..773f1d1d9c6e 100644 --- a/drivers/staging/iio/adc/max1363_core.c +++ b/drivers/staging/iio/adc/max1363_core.c | |||
| @@ -557,6 +557,7 @@ error_put_reg: | |||
| 557 | if (!IS_ERR(st->reg)) | 557 | if (!IS_ERR(st->reg)) |
| 558 | regulator_put(st->reg); | 558 | regulator_put(st->reg); |
| 559 | error_free_st: | 559 | error_free_st: |
| 560 | i2c_set_clientdata(client, NULL); | ||
| 560 | kfree(st); | 561 | kfree(st); |
| 561 | 562 | ||
| 562 | error_ret: | 563 | error_ret: |
| @@ -574,6 +575,7 @@ static int max1363_remove(struct i2c_client *client) | |||
| 574 | regulator_disable(st->reg); | 575 | regulator_disable(st->reg); |
| 575 | regulator_put(st->reg); | 576 | regulator_put(st->reg); |
| 576 | } | 577 | } |
| 578 | i2c_set_clientdata(client, NULL); | ||
| 577 | kfree(st); | 579 | kfree(st); |
| 578 | 580 | ||
| 579 | return 0; | 581 | return 0; |
diff --git a/drivers/staging/iio/industrialio-core.c b/drivers/staging/iio/industrialio-core.c index 37f58f66e491..1d77082c8531 100644 --- a/drivers/staging/iio/industrialio-core.c +++ b/drivers/staging/iio/industrialio-core.c | |||
| @@ -537,6 +537,7 @@ static void iio_device_unregister_sysfs(struct iio_dev *dev_info) | |||
| 537 | sysfs_remove_group(&dev_info->dev.kobj, dev_info->attrs); | 537 | sysfs_remove_group(&dev_info->dev.kobj, dev_info->attrs); |
| 538 | } | 538 | } |
| 539 | 539 | ||
| 540 | /* Return a negative errno on failure */ | ||
| 540 | int iio_get_new_idr_val(struct idr *this_idr) | 541 | int iio_get_new_idr_val(struct idr *this_idr) |
| 541 | { | 542 | { |
| 542 | int ret; | 543 | int ret; |
| @@ -660,7 +661,7 @@ static int iio_device_register_eventset(struct iio_dev *dev_info) | |||
| 660 | for (i = 0; i < dev_info->num_interrupt_lines; i++) { | 661 | for (i = 0; i < dev_info->num_interrupt_lines; i++) { |
| 661 | dev_info->event_interfaces[i].owner = dev_info->driver_module; | 662 | dev_info->event_interfaces[i].owner = dev_info->driver_module; |
| 662 | ret = iio_get_new_idr_val(&iio_event_idr); | 663 | ret = iio_get_new_idr_val(&iio_event_idr); |
| 663 | if (ret) | 664 | if (ret < 0) |
| 664 | goto error_free_setup_ev_ints; | 665 | goto error_free_setup_ev_ints; |
| 665 | else | 666 | else |
| 666 | dev_info->event_interfaces[i].id = ret; | 667 | dev_info->event_interfaces[i].id = ret; |
diff --git a/drivers/staging/iio/light/tsl2563.c b/drivers/staging/iio/light/tsl2563.c index 1ba4aa392f6e..8770a00e3652 100644 --- a/drivers/staging/iio/light/tsl2563.c +++ b/drivers/staging/iio/light/tsl2563.c | |||
| @@ -682,6 +682,7 @@ static int __devinit tsl2563_probe(struct i2c_client *client, | |||
| 682 | fail2: | 682 | fail2: |
| 683 | iio_device_unregister(chip->indio_dev); | 683 | iio_device_unregister(chip->indio_dev); |
| 684 | fail1: | 684 | fail1: |
| 685 | i2c_set_clientdata(client, NULL); | ||
| 685 | kfree(chip); | 686 | kfree(chip); |
| 686 | return err; | 687 | return err; |
| 687 | } | 688 | } |
| @@ -692,6 +693,7 @@ static int tsl2563_remove(struct i2c_client *client) | |||
| 692 | 693 | ||
| 693 | iio_device_unregister(chip->indio_dev); | 694 | iio_device_unregister(chip->indio_dev); |
| 694 | 695 | ||
| 696 | i2c_set_clientdata(client, NULL); | ||
| 695 | kfree(chip); | 697 | kfree(chip); |
| 696 | return 0; | 698 | return 0; |
| 697 | } | 699 | } |
diff --git a/drivers/staging/iio/ring_sw.c b/drivers/staging/iio/ring_sw.c index b104c3d9c35e..cf22c091668c 100644 --- a/drivers/staging/iio/ring_sw.c +++ b/drivers/staging/iio/ring_sw.c | |||
| @@ -293,7 +293,7 @@ again: | |||
| 293 | return -EAGAIN; | 293 | return -EAGAIN; |
| 294 | memcpy(data, last_written_p_copy, ring->buf.bpd); | 294 | memcpy(data, last_written_p_copy, ring->buf.bpd); |
| 295 | 295 | ||
| 296 | if (unlikely(ring->last_written_p >= last_written_p_copy)) | 296 | if (unlikely(ring->last_written_p != last_written_p_copy)) |
| 297 | goto again; | 297 | goto again; |
| 298 | 298 | ||
| 299 | iio_unmark_sw_rb_in_use(&ring->buf); | 299 | iio_unmark_sw_rb_in_use(&ring->buf); |
diff --git a/drivers/staging/octeon/cvmx-helper-board.c b/drivers/staging/octeon/cvmx-helper-board.c index 3085e38a6f99..00a555b83354 100644 --- a/drivers/staging/octeon/cvmx-helper-board.c +++ b/drivers/staging/octeon/cvmx-helper-board.c | |||
| @@ -153,6 +153,14 @@ int cvmx_helper_board_get_mii_address(int ipd_port) | |||
| 153 | * through switch. | 153 | * through switch. |
| 154 | */ | 154 | */ |
| 155 | return -1; | 155 | return -1; |
| 156 | |||
| 157 | case CVMX_BOARD_TYPE_CUST_WSX16: | ||
| 158 | if (ipd_port >= 0 && ipd_port <= 3) | ||
| 159 | return ipd_port; | ||
| 160 | else if (ipd_port >= 16 && ipd_port <= 19) | ||
| 161 | return ipd_port - 16 + 4; | ||
| 162 | else | ||
| 163 | return -1; | ||
| 156 | } | 164 | } |
| 157 | 165 | ||
| 158 | /* Some unknown board. Somebody forgot to update this function... */ | 166 | /* Some unknown board. Somebody forgot to update this function... */ |
diff --git a/drivers/staging/rt2860/usb_main_dev.c b/drivers/staging/rt2860/usb_main_dev.c index 1873a79bb033..740db0c1ac01 100644 --- a/drivers/staging/rt2860/usb_main_dev.c +++ b/drivers/staging/rt2860/usb_main_dev.c | |||
| @@ -63,6 +63,7 @@ struct usb_device_id rtusb_usb_id[] = { | |||
| 63 | {USB_DEVICE(0x07D1, 0x3C11)}, /* D-Link */ | 63 | {USB_DEVICE(0x07D1, 0x3C11)}, /* D-Link */ |
| 64 | {USB_DEVICE(0x14B2, 0x3C07)}, /* AL */ | 64 | {USB_DEVICE(0x14B2, 0x3C07)}, /* AL */ |
| 65 | {USB_DEVICE(0x050D, 0x8053)}, /* Belkin */ | 65 | {USB_DEVICE(0x050D, 0x8053)}, /* Belkin */ |
| 66 | {USB_DEVICE(0x050D, 0x825B)}, /* Belkin */ | ||
| 66 | {USB_DEVICE(0x14B2, 0x3C23)}, /* Airlink */ | 67 | {USB_DEVICE(0x14B2, 0x3C23)}, /* Airlink */ |
| 67 | {USB_DEVICE(0x14B2, 0x3C27)}, /* Airlink */ | 68 | {USB_DEVICE(0x14B2, 0x3C27)}, /* Airlink */ |
| 68 | {USB_DEVICE(0x07AA, 0x002F)}, /* Corega */ | 69 | {USB_DEVICE(0x07AA, 0x002F)}, /* Corega */ |
diff --git a/drivers/staging/rtl8192su/r8192U_core.c b/drivers/staging/rtl8192su/r8192U_core.c index e16256fe595a..04d9b85f3d4c 100644 --- a/drivers/staging/rtl8192su/r8192U_core.c +++ b/drivers/staging/rtl8192su/r8192U_core.c | |||
| @@ -113,14 +113,17 @@ u32 rt_global_debug_component = \ | |||
| 113 | 113 | ||
| 114 | static const struct usb_device_id rtl8192_usb_id_tbl[] = { | 114 | static const struct usb_device_id rtl8192_usb_id_tbl[] = { |
| 115 | /* Realtek */ | 115 | /* Realtek */ |
| 116 | {USB_DEVICE(0x0bda, 0x8171)}, | ||
| 116 | {USB_DEVICE(0x0bda, 0x8192)}, | 117 | {USB_DEVICE(0x0bda, 0x8192)}, |
| 117 | {USB_DEVICE(0x0bda, 0x8709)}, | 118 | {USB_DEVICE(0x0bda, 0x8709)}, |
| 118 | /* Corega */ | 119 | /* Corega */ |
| 119 | {USB_DEVICE(0x07aa, 0x0043)}, | 120 | {USB_DEVICE(0x07aa, 0x0043)}, |
| 120 | /* Belkin */ | 121 | /* Belkin */ |
| 121 | {USB_DEVICE(0x050d, 0x805E)}, | 122 | {USB_DEVICE(0x050d, 0x805E)}, |
| 123 | {USB_DEVICE(0x050d, 0x815F)}, /* Belkin F5D8053 v6 */ | ||
| 122 | /* Sitecom */ | 124 | /* Sitecom */ |
| 123 | {USB_DEVICE(0x0df6, 0x0031)}, | 125 | {USB_DEVICE(0x0df6, 0x0031)}, |
| 126 | {USB_DEVICE(0x0df6, 0x004b)}, /* WL-349 */ | ||
| 124 | /* EnGenius */ | 127 | /* EnGenius */ |
| 125 | {USB_DEVICE(0x1740, 0x9201)}, | 128 | {USB_DEVICE(0x1740, 0x9201)}, |
| 126 | /* Dlink */ | 129 | /* Dlink */ |
diff --git a/drivers/staging/usbip/usbip_event.c b/drivers/staging/usbip/usbip_event.c index 6da1021e8a65..a2566f1075d5 100644 --- a/drivers/staging/usbip/usbip_event.c +++ b/drivers/staging/usbip/usbip_event.c | |||
| @@ -117,6 +117,9 @@ void usbip_stop_eh(struct usbip_device *ud) | |||
| 117 | { | 117 | { |
| 118 | struct usbip_task *eh = &ud->eh; | 118 | struct usbip_task *eh = &ud->eh; |
| 119 | 119 | ||
| 120 | if (eh->thread == current) | ||
| 121 | return; /* do not wait for myself */ | ||
| 122 | |||
| 120 | wait_for_completion(&eh->thread_done); | 123 | wait_for_completion(&eh->thread_done); |
| 121 | usbip_dbg_eh("usbip_eh has finished\n"); | 124 | usbip_dbg_eh("usbip_eh has finished\n"); |
| 122 | } | 125 | } |
diff --git a/drivers/staging/vme/bridges/vme_tsi148.c b/drivers/staging/vme/bridges/vme_tsi148.c index 68f24425977f..783051f59f19 100644 --- a/drivers/staging/vme/bridges/vme_tsi148.c +++ b/drivers/staging/vme/bridges/vme_tsi148.c | |||
| @@ -2455,9 +2455,10 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
| 2455 | dev_info(&pdev->dev, "VME Write and flush and error check is %s\n", | 2455 | dev_info(&pdev->dev, "VME Write and flush and error check is %s\n", |
| 2456 | err_chk ? "enabled" : "disabled"); | 2456 | err_chk ? "enabled" : "disabled"); |
| 2457 | 2457 | ||
| 2458 | if (tsi148_crcsr_init(tsi148_bridge, pdev)) | 2458 | if (tsi148_crcsr_init(tsi148_bridge, pdev)) { |
| 2459 | dev_err(&pdev->dev, "CR/CSR configuration failed.\n"); | 2459 | dev_err(&pdev->dev, "CR/CSR configuration failed.\n"); |
| 2460 | goto err_crcsr; | 2460 | goto err_crcsr; |
| 2461 | } | ||
| 2461 | 2462 | ||
| 2462 | retval = vme_register_bridge(tsi148_bridge); | 2463 | retval = vme_register_bridge(tsi148_bridge); |
| 2463 | if (retval != 0) { | 2464 | if (retval != 0) { |
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index be6331e2c276..5e1a253b08a0 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
| @@ -1542,6 +1542,9 @@ static const struct usb_device_id acm_ids[] = { | |||
| 1542 | { USB_DEVICE(0x1bbb, 0x0003), /* Alcatel OT-I650 */ | 1542 | { USB_DEVICE(0x1bbb, 0x0003), /* Alcatel OT-I650 */ |
| 1543 | .driver_info = NO_UNION_NORMAL, /* reports zero length descriptor */ | 1543 | .driver_info = NO_UNION_NORMAL, /* reports zero length descriptor */ |
| 1544 | }, | 1544 | }, |
| 1545 | { USB_DEVICE(0x1576, 0x03b1), /* Maretron USB100 */ | ||
| 1546 | .driver_info = NO_UNION_NORMAL, /* reports zero length descriptor */ | ||
| 1547 | }, | ||
| 1545 | 1548 | ||
| 1546 | /* Nokia S60 phones expose two ACM channels. The first is | 1549 | /* Nokia S60 phones expose two ACM channels. The first is |
| 1547 | * a modem and is picked up by the standard AT-command | 1550 | * a modem and is picked up by the standard AT-command |
diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig index 97a819c23ef3..7e594449600e 100644 --- a/drivers/usb/core/Kconfig +++ b/drivers/usb/core/Kconfig | |||
| @@ -109,7 +109,7 @@ config USB_SUSPEND | |||
| 109 | config USB_OTG | 109 | config USB_OTG |
| 110 | bool | 110 | bool |
| 111 | depends on USB && EXPERIMENTAL | 111 | depends on USB && EXPERIMENTAL |
| 112 | select USB_SUSPEND | 112 | depends on USB_SUSPEND |
| 113 | default n | 113 | default n |
| 114 | 114 | ||
| 115 | 115 | ||
diff --git a/drivers/usb/core/generic.c b/drivers/usb/core/generic.c index bdf87a8414a1..2c95153c0f24 100644 --- a/drivers/usb/core/generic.c +++ b/drivers/usb/core/generic.c | |||
| @@ -120,7 +120,7 @@ int usb_choose_configuration(struct usb_device *udev) | |||
| 120 | * than a vendor-specific driver. */ | 120 | * than a vendor-specific driver. */ |
| 121 | else if (udev->descriptor.bDeviceClass != | 121 | else if (udev->descriptor.bDeviceClass != |
| 122 | USB_CLASS_VENDOR_SPEC && | 122 | USB_CLASS_VENDOR_SPEC && |
| 123 | (!desc || desc->bInterfaceClass != | 123 | (desc && desc->bInterfaceClass != |
| 124 | USB_CLASS_VENDOR_SPEC)) { | 124 | USB_CLASS_VENDOR_SPEC)) { |
| 125 | best = c; | 125 | best = c; |
| 126 | break; | 126 | break; |
diff --git a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c index 97b40ce133f0..4a6366a42129 100644 --- a/drivers/usb/core/inode.c +++ b/drivers/usb/core/inode.c | |||
| @@ -515,13 +515,13 @@ static int fs_create_by_name (const char *name, mode_t mode, | |||
| 515 | *dentry = NULL; | 515 | *dentry = NULL; |
| 516 | mutex_lock(&parent->d_inode->i_mutex); | 516 | mutex_lock(&parent->d_inode->i_mutex); |
| 517 | *dentry = lookup_one_len(name, parent, strlen(name)); | 517 | *dentry = lookup_one_len(name, parent, strlen(name)); |
| 518 | if (!IS_ERR(dentry)) { | 518 | if (!IS_ERR(*dentry)) { |
| 519 | if ((mode & S_IFMT) == S_IFDIR) | 519 | if ((mode & S_IFMT) == S_IFDIR) |
| 520 | error = usbfs_mkdir (parent->d_inode, *dentry, mode); | 520 | error = usbfs_mkdir (parent->d_inode, *dentry, mode); |
| 521 | else | 521 | else |
| 522 | error = usbfs_create (parent->d_inode, *dentry, mode); | 522 | error = usbfs_create (parent->d_inode, *dentry, mode); |
| 523 | } else | 523 | } else |
| 524 | error = PTR_ERR(dentry); | 524 | error = PTR_ERR(*dentry); |
| 525 | mutex_unlock(&parent->d_inode->i_mutex); | 525 | mutex_unlock(&parent->d_inode->i_mutex); |
| 526 | 526 | ||
| 527 | return error; | 527 | return error; |
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index 1297e9b16a51..0561430f2ede 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c | |||
| @@ -718,7 +718,7 @@ int __usb_get_extra_descriptor(char *buffer, unsigned size, | |||
| 718 | EXPORT_SYMBOL_GPL(__usb_get_extra_descriptor); | 718 | EXPORT_SYMBOL_GPL(__usb_get_extra_descriptor); |
| 719 | 719 | ||
| 720 | /** | 720 | /** |
| 721 | * usb_buffer_alloc - allocate dma-consistent buffer for URB_NO_xxx_DMA_MAP | 721 | * usb_alloc_coherent - allocate dma-consistent buffer for URB_NO_xxx_DMA_MAP |
| 722 | * @dev: device the buffer will be used with | 722 | * @dev: device the buffer will be used with |
| 723 | * @size: requested buffer size | 723 | * @size: requested buffer size |
| 724 | * @mem_flags: affect whether allocation may block | 724 | * @mem_flags: affect whether allocation may block |
| @@ -737,30 +737,30 @@ EXPORT_SYMBOL_GPL(__usb_get_extra_descriptor); | |||
| 737 | * architectures where CPU caches are not DMA-coherent. On systems without | 737 | * architectures where CPU caches are not DMA-coherent. On systems without |
| 738 | * bus-snooping caches, these buffers are uncached. | 738 | * bus-snooping caches, these buffers are uncached. |
| 739 | * | 739 | * |
| 740 | * When the buffer is no longer used, free it with usb_buffer_free(). | 740 | * When the buffer is no longer used, free it with usb_free_coherent(). |
| 741 | */ | 741 | */ |
| 742 | void *usb_buffer_alloc(struct usb_device *dev, size_t size, gfp_t mem_flags, | 742 | void *usb_alloc_coherent(struct usb_device *dev, size_t size, gfp_t mem_flags, |
| 743 | dma_addr_t *dma) | 743 | dma_addr_t *dma) |
| 744 | { | 744 | { |
| 745 | if (!dev || !dev->bus) | 745 | if (!dev || !dev->bus) |
| 746 | return NULL; | 746 | return NULL; |
| 747 | return hcd_buffer_alloc(dev->bus, size, mem_flags, dma); | 747 | return hcd_buffer_alloc(dev->bus, size, mem_flags, dma); |
| 748 | } | 748 | } |
| 749 | EXPORT_SYMBOL_GPL(usb_buffer_alloc); | 749 | EXPORT_SYMBOL_GPL(usb_alloc_coherent); |
| 750 | 750 | ||
| 751 | /** | 751 | /** |
| 752 | * usb_buffer_free - free memory allocated with usb_buffer_alloc() | 752 | * usb_free_coherent - free memory allocated with usb_alloc_coherent() |
| 753 | * @dev: device the buffer was used with | 753 | * @dev: device the buffer was used with |
| 754 | * @size: requested buffer size | 754 | * @size: requested buffer size |
| 755 | * @addr: CPU address of buffer | 755 | * @addr: CPU address of buffer |
| 756 | * @dma: DMA address of buffer | 756 | * @dma: DMA address of buffer |
| 757 | * | 757 | * |
| 758 | * This reclaims an I/O buffer, letting it be reused. The memory must have | 758 | * This reclaims an I/O buffer, letting it be reused. The memory must have |
| 759 | * been allocated using usb_buffer_alloc(), and the parameters must match | 759 | * been allocated using usb_alloc_coherent(), and the parameters must match |
| 760 | * those provided in that allocation request. | 760 | * those provided in that allocation request. |
| 761 | */ | 761 | */ |
| 762 | void usb_buffer_free(struct usb_device *dev, size_t size, void *addr, | 762 | void usb_free_coherent(struct usb_device *dev, size_t size, void *addr, |
| 763 | dma_addr_t dma) | 763 | dma_addr_t dma) |
| 764 | { | 764 | { |
| 765 | if (!dev || !dev->bus) | 765 | if (!dev || !dev->bus) |
| 766 | return; | 766 | return; |
| @@ -768,7 +768,7 @@ void usb_buffer_free(struct usb_device *dev, size_t size, void *addr, | |||
| 768 | return; | 768 | return; |
| 769 | hcd_buffer_free(dev->bus, size, addr, dma); | 769 | hcd_buffer_free(dev->bus, size, addr, dma); |
| 770 | } | 770 | } |
| 771 | EXPORT_SYMBOL_GPL(usb_buffer_free); | 771 | EXPORT_SYMBOL_GPL(usb_free_coherent); |
| 772 | 772 | ||
| 773 | /** | 773 | /** |
| 774 | * usb_buffer_map - create DMA mapping(s) for an urb | 774 | * usb_buffer_map - create DMA mapping(s) for an urb |
diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c index 124a8ccfdcda..1f73b485732d 100644 --- a/drivers/usb/gadget/s3c-hsotg.c +++ b/drivers/usb/gadget/s3c-hsotg.c | |||
| @@ -2145,6 +2145,7 @@ static int s3c_hsotg_ep_enable(struct usb_ep *ep, | |||
| 2145 | u32 epctrl; | 2145 | u32 epctrl; |
| 2146 | u32 mps; | 2146 | u32 mps; |
| 2147 | int dir_in; | 2147 | int dir_in; |
| 2148 | int ret = 0; | ||
| 2148 | 2149 | ||
| 2149 | dev_dbg(hsotg->dev, | 2150 | dev_dbg(hsotg->dev, |
| 2150 | "%s: ep %s: a 0x%02x, attr 0x%02x, mps 0x%04x, intr %d\n", | 2151 | "%s: ep %s: a 0x%02x, attr 0x%02x, mps 0x%04x, intr %d\n", |
| @@ -2196,7 +2197,8 @@ static int s3c_hsotg_ep_enable(struct usb_ep *ep, | |||
| 2196 | switch (desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) { | 2197 | switch (desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) { |
| 2197 | case USB_ENDPOINT_XFER_ISOC: | 2198 | case USB_ENDPOINT_XFER_ISOC: |
| 2198 | dev_err(hsotg->dev, "no current ISOC support\n"); | 2199 | dev_err(hsotg->dev, "no current ISOC support\n"); |
| 2199 | return -EINVAL; | 2200 | ret = -EINVAL; |
| 2201 | goto out; | ||
| 2200 | 2202 | ||
| 2201 | case USB_ENDPOINT_XFER_BULK: | 2203 | case USB_ENDPOINT_XFER_BULK: |
| 2202 | epctrl |= S3C_DxEPCTL_EPType_Bulk; | 2204 | epctrl |= S3C_DxEPCTL_EPType_Bulk; |
| @@ -2235,8 +2237,9 @@ static int s3c_hsotg_ep_enable(struct usb_ep *ep, | |||
| 2235 | /* enable the endpoint interrupt */ | 2237 | /* enable the endpoint interrupt */ |
| 2236 | s3c_hsotg_ctrl_epint(hsotg, index, dir_in, 1); | 2238 | s3c_hsotg_ctrl_epint(hsotg, index, dir_in, 1); |
| 2237 | 2239 | ||
| 2240 | out: | ||
| 2238 | spin_unlock_irqrestore(&hs_ep->lock, flags); | 2241 | spin_unlock_irqrestore(&hs_ep->lock, flags); |
| 2239 | return 0; | 2242 | return ret; |
| 2240 | } | 2243 | } |
| 2241 | 2244 | ||
| 2242 | static int s3c_hsotg_ep_disable(struct usb_ep *ep) | 2245 | static int s3c_hsotg_ep_disable(struct usb_ep *ep) |
diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c index 68b83ab70719..944291e10f97 100644 --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c | |||
| @@ -331,6 +331,8 @@ ohci_hcd_at91_drv_suspend(struct platform_device *pdev, pm_message_t mesg) | |||
| 331 | */ | 331 | */ |
| 332 | if (at91_suspend_entering_slow_clock()) { | 332 | if (at91_suspend_entering_slow_clock()) { |
| 333 | ohci_usb_reset (ohci); | 333 | ohci_usb_reset (ohci); |
| 334 | /* flush the writes */ | ||
| 335 | (void) ohci_readl (ohci, &ohci->regs->control); | ||
| 334 | at91_stop_clock(); | 336 | at91_stop_clock(); |
| 335 | } | 337 | } |
| 336 | 338 | ||
diff --git a/drivers/usb/host/ohci-hub.c b/drivers/usb/host/ohci-hub.c index 32bbce9718f0..65cac8cc8921 100644 --- a/drivers/usb/host/ohci-hub.c +++ b/drivers/usb/host/ohci-hub.c | |||
| @@ -697,7 +697,7 @@ static int ohci_hub_control ( | |||
| 697 | u16 wLength | 697 | u16 wLength |
| 698 | ) { | 698 | ) { |
| 699 | struct ohci_hcd *ohci = hcd_to_ohci (hcd); | 699 | struct ohci_hcd *ohci = hcd_to_ohci (hcd); |
| 700 | int ports = hcd_to_bus (hcd)->root_hub->maxchild; | 700 | int ports = ohci->num_ports; |
| 701 | u32 temp; | 701 | u32 temp; |
| 702 | int retval = 0; | 702 | int retval = 0; |
| 703 | 703 | ||
diff --git a/drivers/usb/host/oxu210hp-hcd.c b/drivers/usb/host/oxu210hp-hcd.c index 50f57f468836..e62b30b3e429 100644 --- a/drivers/usb/host/oxu210hp-hcd.c +++ b/drivers/usb/host/oxu210hp-hcd.c | |||
| @@ -660,13 +660,13 @@ static struct ehci_qh *oxu_qh_alloc(struct oxu_hcd *oxu) | |||
| 660 | if (qh->dummy == NULL) { | 660 | if (qh->dummy == NULL) { |
| 661 | oxu_dbg(oxu, "no dummy td\n"); | 661 | oxu_dbg(oxu, "no dummy td\n"); |
| 662 | oxu->qh_used[i] = 0; | 662 | oxu->qh_used[i] = 0; |
| 663 | 663 | qh = NULL; | |
| 664 | return NULL; | 664 | goto unlock; |
| 665 | } | 665 | } |
| 666 | 666 | ||
| 667 | oxu->qh_used[i] = 1; | 667 | oxu->qh_used[i] = 1; |
| 668 | } | 668 | } |
| 669 | 669 | unlock: | |
| 670 | spin_unlock(&oxu->mem_lock); | 670 | spin_unlock(&oxu->mem_lock); |
| 671 | 671 | ||
| 672 | return qh; | 672 | return qh; |
diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c index e11cc3aa4b82..3b867a8af7b2 100644 --- a/drivers/usb/host/sl811-hcd.c +++ b/drivers/usb/host/sl811-hcd.c | |||
| @@ -720,10 +720,10 @@ retry: | |||
| 720 | /* port status seems weird until after reset, so | 720 | /* port status seems weird until after reset, so |
| 721 | * force the reset and make khubd clean up later. | 721 | * force the reset and make khubd clean up later. |
| 722 | */ | 722 | */ |
| 723 | if (sl811->stat_insrmv & 1) | 723 | if (irqstat & SL11H_INTMASK_RD) |
| 724 | sl811->port1 |= 1 << USB_PORT_FEAT_CONNECTION; | ||
| 725 | else | ||
| 726 | sl811->port1 &= ~(1 << USB_PORT_FEAT_CONNECTION); | 724 | sl811->port1 &= ~(1 << USB_PORT_FEAT_CONNECTION); |
| 725 | else | ||
| 726 | sl811->port1 |= 1 << USB_PORT_FEAT_CONNECTION; | ||
| 727 | 727 | ||
| 728 | sl811->port1 |= 1 << USB_PORT_FEAT_C_CONNECTION; | 728 | sl811->port1 |= 1 << USB_PORT_FEAT_C_CONNECTION; |
| 729 | 729 | ||
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index c09539bad1ee..d64f5724bfc4 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c | |||
| @@ -582,6 +582,19 @@ static inline unsigned int xhci_get_endpoint_interval(struct usb_device *udev, | |||
| 582 | return EP_INTERVAL(interval); | 582 | return EP_INTERVAL(interval); |
| 583 | } | 583 | } |
| 584 | 584 | ||
| 585 | /* The "Mult" field in the endpoint context is only set for SuperSpeed devices. | ||
| 586 | * High speed endpoint descriptors can define "the number of additional | ||
| 587 | * transaction opportunities per microframe", but that goes in the Max Burst | ||
| 588 | * endpoint context field. | ||
| 589 | */ | ||
| 590 | static inline u32 xhci_get_endpoint_mult(struct usb_device *udev, | ||
| 591 | struct usb_host_endpoint *ep) | ||
| 592 | { | ||
| 593 | if (udev->speed != USB_SPEED_SUPER || !ep->ss_ep_comp) | ||
| 594 | return 0; | ||
| 595 | return ep->ss_ep_comp->desc.bmAttributes; | ||
| 596 | } | ||
| 597 | |||
| 585 | static inline u32 xhci_get_endpoint_type(struct usb_device *udev, | 598 | static inline u32 xhci_get_endpoint_type(struct usb_device *udev, |
| 586 | struct usb_host_endpoint *ep) | 599 | struct usb_host_endpoint *ep) |
| 587 | { | 600 | { |
| @@ -612,6 +625,36 @@ static inline u32 xhci_get_endpoint_type(struct usb_device *udev, | |||
| 612 | return type; | 625 | return type; |
| 613 | } | 626 | } |
| 614 | 627 | ||
| 628 | /* Return the maximum endpoint service interval time (ESIT) payload. | ||
| 629 | * Basically, this is the maxpacket size, multiplied by the burst size | ||
| 630 | * and mult size. | ||
| 631 | */ | ||
| 632 | static inline u32 xhci_get_max_esit_payload(struct xhci_hcd *xhci, | ||
| 633 | struct usb_device *udev, | ||
| 634 | struct usb_host_endpoint *ep) | ||
| 635 | { | ||
| 636 | int max_burst; | ||
| 637 | int max_packet; | ||
| 638 | |||
| 639 | /* Only applies for interrupt or isochronous endpoints */ | ||
| 640 | if (usb_endpoint_xfer_control(&ep->desc) || | ||
| 641 | usb_endpoint_xfer_bulk(&ep->desc)) | ||
| 642 | return 0; | ||
| 643 | |||
| 644 | if (udev->speed == USB_SPEED_SUPER) { | ||
| 645 | if (ep->ss_ep_comp) | ||
| 646 | return ep->ss_ep_comp->desc.wBytesPerInterval; | ||
| 647 | xhci_warn(xhci, "WARN no SS endpoint companion descriptor.\n"); | ||
| 648 | /* Assume no bursts, no multiple opportunities to send. */ | ||
| 649 | return ep->desc.wMaxPacketSize; | ||
| 650 | } | ||
| 651 | |||
| 652 | max_packet = ep->desc.wMaxPacketSize & 0x3ff; | ||
| 653 | max_burst = (ep->desc.wMaxPacketSize & 0x1800) >> 11; | ||
| 654 | /* A 0 in max burst means 1 transfer per ESIT */ | ||
| 655 | return max_packet * (max_burst + 1); | ||
| 656 | } | ||
| 657 | |||
| 615 | int xhci_endpoint_init(struct xhci_hcd *xhci, | 658 | int xhci_endpoint_init(struct xhci_hcd *xhci, |
| 616 | struct xhci_virt_device *virt_dev, | 659 | struct xhci_virt_device *virt_dev, |
| 617 | struct usb_device *udev, | 660 | struct usb_device *udev, |
| @@ -623,6 +666,7 @@ int xhci_endpoint_init(struct xhci_hcd *xhci, | |||
| 623 | struct xhci_ring *ep_ring; | 666 | struct xhci_ring *ep_ring; |
| 624 | unsigned int max_packet; | 667 | unsigned int max_packet; |
| 625 | unsigned int max_burst; | 668 | unsigned int max_burst; |
| 669 | u32 max_esit_payload; | ||
| 626 | 670 | ||
| 627 | ep_index = xhci_get_endpoint_index(&ep->desc); | 671 | ep_index = xhci_get_endpoint_index(&ep->desc); |
| 628 | ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, ep_index); | 672 | ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, ep_index); |
| @@ -644,6 +688,7 @@ int xhci_endpoint_init(struct xhci_hcd *xhci, | |||
| 644 | ep_ctx->deq = ep_ring->first_seg->dma | ep_ring->cycle_state; | 688 | ep_ctx->deq = ep_ring->first_seg->dma | ep_ring->cycle_state; |
| 645 | 689 | ||
| 646 | ep_ctx->ep_info = xhci_get_endpoint_interval(udev, ep); | 690 | ep_ctx->ep_info = xhci_get_endpoint_interval(udev, ep); |
| 691 | ep_ctx->ep_info |= EP_MULT(xhci_get_endpoint_mult(udev, ep)); | ||
| 647 | 692 | ||
| 648 | /* FIXME dig Mult and streams info out of ep companion desc */ | 693 | /* FIXME dig Mult and streams info out of ep companion desc */ |
| 649 | 694 | ||
| @@ -689,6 +734,26 @@ int xhci_endpoint_init(struct xhci_hcd *xhci, | |||
| 689 | default: | 734 | default: |
| 690 | BUG(); | 735 | BUG(); |
| 691 | } | 736 | } |
| 737 | max_esit_payload = xhci_get_max_esit_payload(xhci, udev, ep); | ||
| 738 | ep_ctx->tx_info = MAX_ESIT_PAYLOAD_FOR_EP(max_esit_payload); | ||
| 739 | |||
| 740 | /* | ||
| 741 | * XXX no idea how to calculate the average TRB buffer length for bulk | ||
| 742 | * endpoints, as the driver gives us no clue how big each scatter gather | ||
| 743 | * list entry (or buffer) is going to be. | ||
| 744 | * | ||
| 745 | * For isochronous and interrupt endpoints, we set it to the max | ||
| 746 | * available, until we have new API in the USB core to allow drivers to | ||
| 747 | * declare how much bandwidth they actually need. | ||
| 748 | * | ||
| 749 | * Normally, it would be calculated by taking the total of the buffer | ||
| 750 | * lengths in the TD and then dividing by the number of TRBs in a TD, | ||
| 751 | * including link TRBs, No-op TRBs, and Event data TRBs. Since we don't | ||
| 752 | * use Event Data TRBs, and we don't chain in a link TRB on short | ||
| 753 | * transfers, we're basically dividing by 1. | ||
| 754 | */ | ||
| 755 | ep_ctx->tx_info |= AVG_TRB_LENGTH_FOR_EP(max_esit_payload); | ||
| 756 | |||
| 692 | /* FIXME Debug endpoint context */ | 757 | /* FIXME Debug endpoint context */ |
| 693 | return 0; | 758 | return 0; |
| 694 | } | 759 | } |
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index e5eb09b2f38e..ea389e9a4931 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h | |||
| @@ -609,6 +609,10 @@ struct xhci_ep_ctx { | |||
| 609 | #define MAX_PACKET_MASK (0xffff << 16) | 609 | #define MAX_PACKET_MASK (0xffff << 16) |
| 610 | #define MAX_PACKET_DECODED(p) (((p) >> 16) & 0xffff) | 610 | #define MAX_PACKET_DECODED(p) (((p) >> 16) & 0xffff) |
| 611 | 611 | ||
| 612 | /* tx_info bitmasks */ | ||
| 613 | #define AVG_TRB_LENGTH_FOR_EP(p) ((p) & 0xffff) | ||
| 614 | #define MAX_ESIT_PAYLOAD_FOR_EP(p) (((p) & 0xffff) << 16) | ||
| 615 | |||
| 612 | 616 | ||
| 613 | /** | 617 | /** |
| 614 | * struct xhci_input_control_context | 618 | * struct xhci_input_control_context |
diff --git a/drivers/usb/musb/Kconfig b/drivers/usb/musb/Kconfig index b4c783c284ba..07fe490b44d8 100644 --- a/drivers/usb/musb/Kconfig +++ b/drivers/usb/musb/Kconfig | |||
| @@ -42,7 +42,7 @@ config USB_MUSB_SOC | |||
| 42 | default y if (BF52x && !BF522 && !BF523) | 42 | default y if (BF52x && !BF522 && !BF523) |
| 43 | 43 | ||
| 44 | comment "DaVinci 35x and 644x USB support" | 44 | comment "DaVinci 35x and 644x USB support" |
| 45 | depends on USB_MUSB_HDRC && ARCH_DAVINCI | 45 | depends on USB_MUSB_HDRC && ARCH_DAVINCI_DMx |
| 46 | 46 | ||
| 47 | comment "OMAP 243x high speed USB support" | 47 | comment "OMAP 243x high speed USB support" |
| 48 | depends on USB_MUSB_HDRC && ARCH_OMAP2430 | 48 | depends on USB_MUSB_HDRC && ARCH_OMAP2430 |
diff --git a/drivers/usb/musb/Makefile b/drivers/usb/musb/Makefile index 85710ccc1887..3a485dabebbb 100644 --- a/drivers/usb/musb/Makefile +++ b/drivers/usb/musb/Makefile | |||
| @@ -6,7 +6,7 @@ musb_hdrc-objs := musb_core.o | |||
| 6 | 6 | ||
| 7 | obj-$(CONFIG_USB_MUSB_HDRC) += musb_hdrc.o | 7 | obj-$(CONFIG_USB_MUSB_HDRC) += musb_hdrc.o |
| 8 | 8 | ||
| 9 | ifeq ($(CONFIG_ARCH_DAVINCI),y) | 9 | ifeq ($(CONFIG_ARCH_DAVINCI_DMx),y) |
| 10 | musb_hdrc-objs += davinci.o | 10 | musb_hdrc-objs += davinci.o |
| 11 | endif | 11 | endif |
| 12 | 12 | ||
diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c index 719a22d664ef..ec8d324237f6 100644 --- a/drivers/usb/musb/blackfin.c +++ b/drivers/usb/musb/blackfin.c | |||
| @@ -172,13 +172,7 @@ static irqreturn_t blackfin_interrupt(int irq, void *__hci) | |||
| 172 | 172 | ||
| 173 | spin_unlock_irqrestore(&musb->lock, flags); | 173 | spin_unlock_irqrestore(&musb->lock, flags); |
| 174 | 174 | ||
| 175 | /* REVISIT we sometimes get spurious IRQs on g_ep0 | 175 | return retval; |
| 176 | * not clear why... fall in BF54x too. | ||
| 177 | */ | ||
| 178 | if (retval != IRQ_HANDLED) | ||
| 179 | DBG(5, "spurious?\n"); | ||
| 180 | |||
| 181 | return IRQ_HANDLED; | ||
| 182 | } | 176 | } |
| 183 | 177 | ||
| 184 | static void musb_conn_timer_handler(unsigned long _musb) | 178 | static void musb_conn_timer_handler(unsigned long _musb) |
diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c index 29bce5c0fd10..ce2e16fee0df 100644 --- a/drivers/usb/musb/davinci.c +++ b/drivers/usb/musb/davinci.c | |||
| @@ -444,6 +444,8 @@ int __init musb_platform_init(struct musb *musb) | |||
| 444 | return 0; | 444 | return 0; |
| 445 | 445 | ||
| 446 | fail: | 446 | fail: |
| 447 | clk_disable(musb->clock); | ||
| 448 | |||
| 447 | usb_nop_xceiv_unregister(); | 449 | usb_nop_xceiv_unregister(); |
| 448 | return -ENODEV; | 450 | return -ENODEV; |
| 449 | } | 451 | } |
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 0e8b8ab1d168..705cc4ad8737 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c | |||
| @@ -965,10 +965,8 @@ static void musb_shutdown(struct platform_device *pdev) | |||
| 965 | spin_lock_irqsave(&musb->lock, flags); | 965 | spin_lock_irqsave(&musb->lock, flags); |
| 966 | musb_platform_disable(musb); | 966 | musb_platform_disable(musb); |
| 967 | musb_generic_disable(musb); | 967 | musb_generic_disable(musb); |
| 968 | if (musb->clock) { | 968 | if (musb->clock) |
| 969 | clk_put(musb->clock); | 969 | clk_put(musb->clock); |
| 970 | musb->clock = NULL; | ||
| 971 | } | ||
| 972 | spin_unlock_irqrestore(&musb->lock, flags); | 970 | spin_unlock_irqrestore(&musb->lock, flags); |
| 973 | 971 | ||
| 974 | /* FIXME power down */ | 972 | /* FIXME power down */ |
| @@ -1853,15 +1851,6 @@ static void musb_free(struct musb *musb) | |||
| 1853 | put_device(musb->xceiv->dev); | 1851 | put_device(musb->xceiv->dev); |
| 1854 | #endif | 1852 | #endif |
| 1855 | 1853 | ||
| 1856 | musb_writeb(musb->mregs, MUSB_DEVCTL, 0); | ||
| 1857 | musb_platform_exit(musb); | ||
| 1858 | musb_writeb(musb->mregs, MUSB_DEVCTL, 0); | ||
| 1859 | |||
| 1860 | if (musb->clock) { | ||
| 1861 | clk_disable(musb->clock); | ||
| 1862 | clk_put(musb->clock); | ||
| 1863 | } | ||
| 1864 | |||
| 1865 | #ifdef CONFIG_USB_MUSB_HDRC_HCD | 1854 | #ifdef CONFIG_USB_MUSB_HDRC_HCD |
| 1866 | usb_put_hcd(musb_to_hcd(musb)); | 1855 | usb_put_hcd(musb_to_hcd(musb)); |
| 1867 | #else | 1856 | #else |
| @@ -1889,8 +1878,10 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) | |||
| 1889 | */ | 1878 | */ |
| 1890 | if (!plat) { | 1879 | if (!plat) { |
| 1891 | dev_dbg(dev, "no platform_data?\n"); | 1880 | dev_dbg(dev, "no platform_data?\n"); |
| 1892 | return -ENODEV; | 1881 | status = -ENODEV; |
| 1882 | goto fail0; | ||
| 1893 | } | 1883 | } |
| 1884 | |||
| 1894 | switch (plat->mode) { | 1885 | switch (plat->mode) { |
| 1895 | case MUSB_HOST: | 1886 | case MUSB_HOST: |
| 1896 | #ifdef CONFIG_USB_MUSB_HDRC_HCD | 1887 | #ifdef CONFIG_USB_MUSB_HDRC_HCD |
| @@ -1912,13 +1903,16 @@ bad_config: | |||
| 1912 | #endif | 1903 | #endif |
| 1913 | default: | 1904 | default: |
| 1914 | dev_err(dev, "incompatible Kconfig role setting\n"); | 1905 | dev_err(dev, "incompatible Kconfig role setting\n"); |
| 1915 | return -EINVAL; | 1906 | status = -EINVAL; |
| 1907 | goto fail0; | ||
| 1916 | } | 1908 | } |
| 1917 | 1909 | ||
| 1918 | /* allocate */ | 1910 | /* allocate */ |
| 1919 | musb = allocate_instance(dev, plat->config, ctrl); | 1911 | musb = allocate_instance(dev, plat->config, ctrl); |
| 1920 | if (!musb) | 1912 | if (!musb) { |
| 1921 | return -ENOMEM; | 1913 | status = -ENOMEM; |
| 1914 | goto fail0; | ||
| 1915 | } | ||
| 1922 | 1916 | ||
| 1923 | spin_lock_init(&musb->lock); | 1917 | spin_lock_init(&musb->lock); |
| 1924 | musb->board_mode = plat->mode; | 1918 | musb->board_mode = plat->mode; |
| @@ -1936,7 +1930,7 @@ bad_config: | |||
| 1936 | if (IS_ERR(musb->clock)) { | 1930 | if (IS_ERR(musb->clock)) { |
| 1937 | status = PTR_ERR(musb->clock); | 1931 | status = PTR_ERR(musb->clock); |
| 1938 | musb->clock = NULL; | 1932 | musb->clock = NULL; |
| 1939 | goto fail; | 1933 | goto fail1; |
| 1940 | } | 1934 | } |
| 1941 | } | 1935 | } |
| 1942 | 1936 | ||
| @@ -1955,12 +1949,12 @@ bad_config: | |||
| 1955 | */ | 1949 | */ |
| 1956 | musb->isr = generic_interrupt; | 1950 | musb->isr = generic_interrupt; |
| 1957 | status = musb_platform_init(musb); | 1951 | status = musb_platform_init(musb); |
| 1958 | |||
| 1959 | if (status < 0) | 1952 | if (status < 0) |
| 1960 | goto fail; | 1953 | goto fail2; |
| 1954 | |||
| 1961 | if (!musb->isr) { | 1955 | if (!musb->isr) { |
| 1962 | status = -ENODEV; | 1956 | status = -ENODEV; |
| 1963 | goto fail2; | 1957 | goto fail3; |
| 1964 | } | 1958 | } |
| 1965 | 1959 | ||
| 1966 | #ifndef CONFIG_MUSB_PIO_ONLY | 1960 | #ifndef CONFIG_MUSB_PIO_ONLY |
| @@ -1986,7 +1980,7 @@ bad_config: | |||
| 1986 | ? MUSB_CONTROLLER_MHDRC | 1980 | ? MUSB_CONTROLLER_MHDRC |
| 1987 | : MUSB_CONTROLLER_HDRC, musb); | 1981 | : MUSB_CONTROLLER_HDRC, musb); |
| 1988 | if (status < 0) | 1982 | if (status < 0) |
| 1989 | goto fail2; | 1983 | goto fail3; |
| 1990 | 1984 | ||
| 1991 | #ifdef CONFIG_USB_MUSB_OTG | 1985 | #ifdef CONFIG_USB_MUSB_OTG |
| 1992 | setup_timer(&musb->otg_timer, musb_otg_timer_func, (unsigned long) musb); | 1986 | setup_timer(&musb->otg_timer, musb_otg_timer_func, (unsigned long) musb); |
| @@ -1999,7 +1993,7 @@ bad_config: | |||
| 1999 | if (request_irq(nIrq, musb->isr, 0, dev_name(dev), musb)) { | 1993 | if (request_irq(nIrq, musb->isr, 0, dev_name(dev), musb)) { |
| 2000 | dev_err(dev, "request_irq %d failed!\n", nIrq); | 1994 | dev_err(dev, "request_irq %d failed!\n", nIrq); |
| 2001 | status = -ENODEV; | 1995 | status = -ENODEV; |
| 2002 | goto fail2; | 1996 | goto fail3; |
| 2003 | } | 1997 | } |
| 2004 | musb->nIrq = nIrq; | 1998 | musb->nIrq = nIrq; |
| 2005 | /* FIXME this handles wakeup irqs wrong */ | 1999 | /* FIXME this handles wakeup irqs wrong */ |
| @@ -2039,8 +2033,6 @@ bad_config: | |||
| 2039 | musb->xceiv->state = OTG_STATE_A_IDLE; | 2033 | musb->xceiv->state = OTG_STATE_A_IDLE; |
| 2040 | 2034 | ||
| 2041 | status = usb_add_hcd(musb_to_hcd(musb), -1, 0); | 2035 | status = usb_add_hcd(musb_to_hcd(musb), -1, 0); |
| 2042 | if (status) | ||
| 2043 | goto fail; | ||
| 2044 | 2036 | ||
| 2045 | DBG(1, "%s mode, status %d, devctl %02x %c\n", | 2037 | DBG(1, "%s mode, status %d, devctl %02x %c\n", |
| 2046 | "HOST", status, | 2038 | "HOST", status, |
| @@ -2055,8 +2047,6 @@ bad_config: | |||
| 2055 | musb->xceiv->state = OTG_STATE_B_IDLE; | 2047 | musb->xceiv->state = OTG_STATE_B_IDLE; |
| 2056 | 2048 | ||
| 2057 | status = musb_gadget_setup(musb); | 2049 | status = musb_gadget_setup(musb); |
| 2058 | if (status) | ||
| 2059 | goto fail; | ||
| 2060 | 2050 | ||
| 2061 | DBG(1, "%s mode, status %d, dev%02x\n", | 2051 | DBG(1, "%s mode, status %d, dev%02x\n", |
| 2062 | is_otg_enabled(musb) ? "OTG" : "PERIPHERAL", | 2052 | is_otg_enabled(musb) ? "OTG" : "PERIPHERAL", |
| @@ -2064,12 +2054,14 @@ bad_config: | |||
| 2064 | musb_readb(musb->mregs, MUSB_DEVCTL)); | 2054 | musb_readb(musb->mregs, MUSB_DEVCTL)); |
| 2065 | 2055 | ||
| 2066 | } | 2056 | } |
| 2057 | if (status < 0) | ||
| 2058 | goto fail3; | ||
| 2067 | 2059 | ||
| 2068 | #ifdef CONFIG_SYSFS | 2060 | #ifdef CONFIG_SYSFS |
| 2069 | status = sysfs_create_group(&musb->controller->kobj, &musb_attr_group); | 2061 | status = sysfs_create_group(&musb->controller->kobj, &musb_attr_group); |
| 2070 | #endif | ||
| 2071 | if (status) | 2062 | if (status) |
| 2072 | goto fail2; | 2063 | goto fail4; |
| 2064 | #endif | ||
| 2073 | 2065 | ||
| 2074 | dev_info(dev, "USB %s mode controller at %p using %s, IRQ %d\n", | 2066 | dev_info(dev, "USB %s mode controller at %p using %s, IRQ %d\n", |
| 2075 | ({char *s; | 2067 | ({char *s; |
| @@ -2085,17 +2077,29 @@ bad_config: | |||
| 2085 | 2077 | ||
| 2086 | return 0; | 2078 | return 0; |
| 2087 | 2079 | ||
| 2088 | fail2: | 2080 | fail4: |
| 2081 | if (!is_otg_enabled(musb) && is_host_enabled(musb)) | ||
| 2082 | usb_remove_hcd(musb_to_hcd(musb)); | ||
| 2083 | else | ||
| 2084 | musb_gadget_cleanup(musb); | ||
| 2085 | |||
| 2086 | fail3: | ||
| 2087 | if (musb->irq_wake) | ||
| 2088 | device_init_wakeup(dev, 0); | ||
| 2089 | musb_platform_exit(musb); | 2089 | musb_platform_exit(musb); |
| 2090 | fail: | ||
| 2091 | dev_err(musb->controller, | ||
| 2092 | "musb_init_controller failed with status %d\n", status); | ||
| 2093 | 2090 | ||
| 2091 | fail2: | ||
| 2094 | if (musb->clock) | 2092 | if (musb->clock) |
| 2095 | clk_put(musb->clock); | 2093 | clk_put(musb->clock); |
| 2096 | device_init_wakeup(dev, 0); | 2094 | |
| 2095 | fail1: | ||
| 2096 | dev_err(musb->controller, | ||
| 2097 | "musb_init_controller failed with status %d\n", status); | ||
| 2098 | |||
| 2097 | musb_free(musb); | 2099 | musb_free(musb); |
| 2098 | 2100 | ||
| 2101 | fail0: | ||
| 2102 | |||
| 2099 | return status; | 2103 | return status; |
| 2100 | 2104 | ||
| 2101 | } | 2105 | } |
| @@ -2132,7 +2136,6 @@ static int __init musb_probe(struct platform_device *pdev) | |||
| 2132 | /* clobbered by use_dma=n */ | 2136 | /* clobbered by use_dma=n */ |
| 2133 | orig_dma_mask = dev->dma_mask; | 2137 | orig_dma_mask = dev->dma_mask; |
| 2134 | #endif | 2138 | #endif |
| 2135 | |||
| 2136 | status = musb_init_controller(dev, irq, base); | 2139 | status = musb_init_controller(dev, irq, base); |
| 2137 | if (status < 0) | 2140 | if (status < 0) |
| 2138 | iounmap(base); | 2141 | iounmap(base); |
| @@ -2155,6 +2158,10 @@ static int __exit musb_remove(struct platform_device *pdev) | |||
| 2155 | if (musb->board_mode == MUSB_HOST) | 2158 | if (musb->board_mode == MUSB_HOST) |
| 2156 | usb_remove_hcd(musb_to_hcd(musb)); | 2159 | usb_remove_hcd(musb_to_hcd(musb)); |
| 2157 | #endif | 2160 | #endif |
| 2161 | musb_writeb(musb->mregs, MUSB_DEVCTL, 0); | ||
| 2162 | musb_platform_exit(musb); | ||
| 2163 | musb_writeb(musb->mregs, MUSB_DEVCTL, 0); | ||
| 2164 | |||
| 2158 | musb_free(musb); | 2165 | musb_free(musb); |
| 2159 | iounmap(ctrl_base); | 2166 | iounmap(ctrl_base); |
| 2160 | device_init_wakeup(&pdev->dev, 0); | 2167 | device_init_wakeup(&pdev->dev, 0); |
| @@ -2176,6 +2183,7 @@ void musb_save_context(struct musb *musb) | |||
| 2176 | if (is_host_enabled(musb)) { | 2183 | if (is_host_enabled(musb)) { |
| 2177 | musb_context.frame = musb_readw(musb_base, MUSB_FRAME); | 2184 | musb_context.frame = musb_readw(musb_base, MUSB_FRAME); |
| 2178 | musb_context.testmode = musb_readb(musb_base, MUSB_TESTMODE); | 2185 | musb_context.testmode = musb_readb(musb_base, MUSB_TESTMODE); |
| 2186 | musb_context.busctl = musb_read_ulpi_buscontrol(musb->mregs); | ||
| 2179 | } | 2187 | } |
| 2180 | musb_context.power = musb_readb(musb_base, MUSB_POWER); | 2188 | musb_context.power = musb_readb(musb_base, MUSB_POWER); |
| 2181 | musb_context.intrtxe = musb_readw(musb_base, MUSB_INTRTXE); | 2189 | musb_context.intrtxe = musb_readw(musb_base, MUSB_INTRTXE); |
| @@ -2247,6 +2255,7 @@ void musb_restore_context(struct musb *musb) | |||
| 2247 | if (is_host_enabled(musb)) { | 2255 | if (is_host_enabled(musb)) { |
| 2248 | musb_writew(musb_base, MUSB_FRAME, musb_context.frame); | 2256 | musb_writew(musb_base, MUSB_FRAME, musb_context.frame); |
| 2249 | musb_writeb(musb_base, MUSB_TESTMODE, musb_context.testmode); | 2257 | musb_writeb(musb_base, MUSB_TESTMODE, musb_context.testmode); |
| 2258 | musb_write_ulpi_buscontrol(musb->mregs, musb_context.busctl); | ||
| 2250 | } | 2259 | } |
| 2251 | musb_writeb(musb_base, MUSB_POWER, musb_context.power); | 2260 | musb_writeb(musb_base, MUSB_POWER, musb_context.power); |
| 2252 | musb_writew(musb_base, MUSB_INTRTXE, musb_context.intrtxe); | 2261 | musb_writew(musb_base, MUSB_INTRTXE, musb_context.intrtxe); |
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h index cd9f4a9a06c6..ac17b004909b 100644 --- a/drivers/usb/musb/musb_core.h +++ b/drivers/usb/musb/musb_core.h | |||
| @@ -478,7 +478,7 @@ struct musb_context_registers { | |||
| 478 | u16 frame; | 478 | u16 frame; |
| 479 | u8 index, testmode; | 479 | u8 index, testmode; |
| 480 | 480 | ||
| 481 | u8 devctl, misc; | 481 | u8 devctl, busctl, misc; |
| 482 | 482 | ||
| 483 | struct musb_csr_regs index_regs[MUSB_C_NUM_EPS]; | 483 | struct musb_csr_regs index_regs[MUSB_C_NUM_EPS]; |
| 484 | }; | 484 | }; |
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c index dec896e888db..877d20b1dff9 100644 --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c | |||
| @@ -2042,6 +2042,7 @@ static int musb_urb_enqueue( | |||
| 2042 | * odd, rare, error prone, but legal. | 2042 | * odd, rare, error prone, but legal. |
| 2043 | */ | 2043 | */ |
| 2044 | kfree(qh); | 2044 | kfree(qh); |
| 2045 | qh = NULL; | ||
| 2045 | ret = 0; | 2046 | ret = 0; |
| 2046 | } else | 2047 | } else |
| 2047 | ret = musb_schedule(musb, qh, | 2048 | ret = musb_schedule(musb, qh, |
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index 490cdf15ccb6..82592633502f 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c | |||
| @@ -331,8 +331,5 @@ int musb_platform_exit(struct musb *musb) | |||
| 331 | 331 | ||
| 332 | musb_platform_suspend(musb); | 332 | musb_platform_suspend(musb); |
| 333 | 333 | ||
| 334 | clk_put(musb->clock); | ||
| 335 | musb->clock = NULL; | ||
| 336 | |||
| 337 | return 0; | 334 | return 0; |
| 338 | } | 335 | } |
diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c index ab776a8d98ca..60d3938cafcf 100644 --- a/drivers/usb/musb/tusb6010.c +++ b/drivers/usb/musb/tusb6010.c | |||
| @@ -29,6 +29,19 @@ static void tusb_source_power(struct musb *musb, int is_on); | |||
| 29 | #define TUSB_REV_MAJOR(reg_val) ((reg_val >> 4) & 0xf) | 29 | #define TUSB_REV_MAJOR(reg_val) ((reg_val >> 4) & 0xf) |
| 30 | #define TUSB_REV_MINOR(reg_val) (reg_val & 0xf) | 30 | #define TUSB_REV_MINOR(reg_val) (reg_val & 0xf) |
| 31 | 31 | ||
| 32 | #ifdef CONFIG_PM | ||
| 33 | /* REVISIT: These should be only needed if somebody implements off idle */ | ||
| 34 | void musb_platform_save_context(struct musb *musb, | ||
| 35 | struct musb_context_registers *musb_context) | ||
| 36 | { | ||
| 37 | } | ||
| 38 | |||
| 39 | void musb_platform_restore_context(struct musb *musb, | ||
| 40 | struct musb_context_registers *musb_context) | ||
| 41 | { | ||
| 42 | } | ||
| 43 | #endif | ||
| 44 | |||
| 32 | /* | 45 | /* |
| 33 | * Checks the revision. We need to use the DMA register as 3.0 does not | 46 | * Checks the revision. We need to use the DMA register as 3.0 does not |
| 34 | * have correct versions for TUSB_PRCM_REV or TUSB_INT_CTRL_REV. | 47 | * have correct versions for TUSB_PRCM_REV or TUSB_INT_CTRL_REV. |
diff --git a/drivers/usb/musb/tusb6010_omap.c b/drivers/usb/musb/tusb6010_omap.c index 5afa070d7dc9..c061a88f2b0f 100644 --- a/drivers/usb/musb/tusb6010_omap.c +++ b/drivers/usb/musb/tusb6010_omap.c | |||
| @@ -39,7 +39,7 @@ struct tusb_omap_dma_ch { | |||
| 39 | 39 | ||
| 40 | struct tusb_omap_dma *tusb_dma; | 40 | struct tusb_omap_dma *tusb_dma; |
| 41 | 41 | ||
| 42 | void __iomem *dma_addr; | 42 | dma_addr_t dma_addr; |
| 43 | 43 | ||
| 44 | u32 len; | 44 | u32 len; |
| 45 | u16 packet_sz; | 45 | u16 packet_sz; |
| @@ -126,6 +126,7 @@ static void tusb_omap_dma_cb(int lch, u16 ch_status, void *data) | |||
| 126 | struct tusb_omap_dma_ch *chdat = to_chdat(channel); | 126 | struct tusb_omap_dma_ch *chdat = to_chdat(channel); |
| 127 | struct tusb_omap_dma *tusb_dma = chdat->tusb_dma; | 127 | struct tusb_omap_dma *tusb_dma = chdat->tusb_dma; |
| 128 | struct musb *musb = chdat->musb; | 128 | struct musb *musb = chdat->musb; |
| 129 | struct device *dev = musb->controller; | ||
| 129 | struct musb_hw_ep *hw_ep = chdat->hw_ep; | 130 | struct musb_hw_ep *hw_ep = chdat->hw_ep; |
| 130 | void __iomem *ep_conf = hw_ep->conf; | 131 | void __iomem *ep_conf = hw_ep->conf; |
| 131 | void __iomem *mbase = musb->mregs; | 132 | void __iomem *mbase = musb->mregs; |
| @@ -173,13 +174,15 @@ static void tusb_omap_dma_cb(int lch, u16 ch_status, void *data) | |||
| 173 | DBG(3, "Using PIO for remaining %lu bytes\n", pio); | 174 | DBG(3, "Using PIO for remaining %lu bytes\n", pio); |
| 174 | buf = phys_to_virt((u32)chdat->dma_addr) + chdat->transfer_len; | 175 | buf = phys_to_virt((u32)chdat->dma_addr) + chdat->transfer_len; |
| 175 | if (chdat->tx) { | 176 | if (chdat->tx) { |
| 176 | dma_cache_maint(phys_to_virt((u32)chdat->dma_addr), | 177 | dma_unmap_single(dev, chdat->dma_addr, |
| 177 | chdat->transfer_len, DMA_TO_DEVICE); | 178 | chdat->transfer_len, |
| 179 | DMA_TO_DEVICE); | ||
| 178 | musb_write_fifo(hw_ep, pio, buf); | 180 | musb_write_fifo(hw_ep, pio, buf); |
| 179 | } else { | 181 | } else { |
| 182 | dma_unmap_single(dev, chdat->dma_addr, | ||
| 183 | chdat->transfer_len, | ||
| 184 | DMA_FROM_DEVICE); | ||
| 180 | musb_read_fifo(hw_ep, pio, buf); | 185 | musb_read_fifo(hw_ep, pio, buf); |
| 181 | dma_cache_maint(phys_to_virt((u32)chdat->dma_addr), | ||
| 182 | chdat->transfer_len, DMA_FROM_DEVICE); | ||
| 183 | } | 186 | } |
| 184 | channel->actual_len += pio; | 187 | channel->actual_len += pio; |
| 185 | } | 188 | } |
| @@ -224,6 +227,7 @@ static int tusb_omap_dma_program(struct dma_channel *channel, u16 packet_sz, | |||
| 224 | struct tusb_omap_dma_ch *chdat = to_chdat(channel); | 227 | struct tusb_omap_dma_ch *chdat = to_chdat(channel); |
| 225 | struct tusb_omap_dma *tusb_dma = chdat->tusb_dma; | 228 | struct tusb_omap_dma *tusb_dma = chdat->tusb_dma; |
| 226 | struct musb *musb = chdat->musb; | 229 | struct musb *musb = chdat->musb; |
| 230 | struct device *dev = musb->controller; | ||
| 227 | struct musb_hw_ep *hw_ep = chdat->hw_ep; | 231 | struct musb_hw_ep *hw_ep = chdat->hw_ep; |
| 228 | void __iomem *mbase = musb->mregs; | 232 | void __iomem *mbase = musb->mregs; |
| 229 | void __iomem *ep_conf = hw_ep->conf; | 233 | void __iomem *ep_conf = hw_ep->conf; |
| @@ -299,14 +303,16 @@ static int tusb_omap_dma_program(struct dma_channel *channel, u16 packet_sz, | |||
| 299 | chdat->packet_sz = packet_sz; | 303 | chdat->packet_sz = packet_sz; |
| 300 | chdat->len = len; | 304 | chdat->len = len; |
| 301 | channel->actual_len = 0; | 305 | channel->actual_len = 0; |
| 302 | chdat->dma_addr = (void __iomem *)dma_addr; | 306 | chdat->dma_addr = dma_addr; |
| 303 | channel->status = MUSB_DMA_STATUS_BUSY; | 307 | channel->status = MUSB_DMA_STATUS_BUSY; |
| 304 | 308 | ||
| 305 | /* Since we're recycling dma areas, we need to clean or invalidate */ | 309 | /* Since we're recycling dma areas, we need to clean or invalidate */ |
| 306 | if (chdat->tx) | 310 | if (chdat->tx) |
| 307 | dma_cache_maint(phys_to_virt(dma_addr), len, DMA_TO_DEVICE); | 311 | dma_map_single(dev, phys_to_virt(dma_addr), len, |
| 312 | DMA_TO_DEVICE); | ||
| 308 | else | 313 | else |
| 309 | dma_cache_maint(phys_to_virt(dma_addr), len, DMA_FROM_DEVICE); | 314 | dma_map_single(dev, phys_to_virt(dma_addr), len, |
| 315 | DMA_FROM_DEVICE); | ||
| 310 | 316 | ||
| 311 | /* Use 16-bit transfer if dma_addr is not 32-bit aligned */ | 317 | /* Use 16-bit transfer if dma_addr is not 32-bit aligned */ |
| 312 | if ((dma_addr & 0x3) == 0) { | 318 | if ((dma_addr & 0x3) == 0) { |
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index ca9d866672aa..84d0edad8e4f 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
| @@ -305,6 +305,11 @@ static int option_resume(struct usb_serial *serial); | |||
| 305 | #define ZTE_PRODUCT_CDMA_TECH 0xfffe | 305 | #define ZTE_PRODUCT_CDMA_TECH 0xfffe |
| 306 | #define ZTE_PRODUCT_AC8710 0xfff1 | 306 | #define ZTE_PRODUCT_AC8710 0xfff1 |
| 307 | #define ZTE_PRODUCT_AC2726 0xfff5 | 307 | #define ZTE_PRODUCT_AC2726 0xfff5 |
| 308 | #define ZTE_PRODUCT_AC8710T 0xffff | ||
| 309 | |||
| 310 | /* ZTE PRODUCTS -- alternate vendor ID */ | ||
| 311 | #define ZTE_VENDOR_ID2 0x1d6b | ||
| 312 | #define ZTE_PRODUCT_MF_330 0x0002 | ||
| 308 | 313 | ||
| 309 | #define BENQ_VENDOR_ID 0x04a5 | 314 | #define BENQ_VENDOR_ID 0x04a5 |
| 310 | #define BENQ_PRODUCT_H10 0x4068 | 315 | #define BENQ_PRODUCT_H10 0x4068 |
| @@ -373,6 +378,8 @@ static int option_resume(struct usb_serial *serial); | |||
| 373 | #define HAIER_VENDOR_ID 0x201e | 378 | #define HAIER_VENDOR_ID 0x201e |
| 374 | #define HAIER_PRODUCT_CE100 0x2009 | 379 | #define HAIER_PRODUCT_CE100 0x2009 |
| 375 | 380 | ||
| 381 | #define CINTERION_VENDOR_ID 0x0681 | ||
| 382 | |||
| 376 | /* some devices interfaces need special handling due to a number of reasons */ | 383 | /* some devices interfaces need special handling due to a number of reasons */ |
| 377 | enum option_blacklist_reason { | 384 | enum option_blacklist_reason { |
| 378 | OPTION_BLACKLIST_NONE = 0, | 385 | OPTION_BLACKLIST_NONE = 0, |
| @@ -679,6 +686,8 @@ static const struct usb_device_id option_ids[] = { | |||
| 679 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH, 0xff, 0xff, 0xff) }, | 686 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH, 0xff, 0xff, 0xff) }, |
| 680 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710, 0xff, 0xff, 0xff) }, | 687 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710, 0xff, 0xff, 0xff) }, |
| 681 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC2726, 0xff, 0xff, 0xff) }, | 688 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC2726, 0xff, 0xff, 0xff) }, |
| 689 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710T, 0xff, 0xff, 0xff) }, | ||
| 690 | { USB_DEVICE(ZTE_VENDOR_ID2, ZTE_PRODUCT_MF_330) }, | ||
| 682 | { USB_DEVICE(BENQ_VENDOR_ID, BENQ_PRODUCT_H10) }, | 691 | { USB_DEVICE(BENQ_VENDOR_ID, BENQ_PRODUCT_H10) }, |
| 683 | { USB_DEVICE(DLINK_VENDOR_ID, DLINK_PRODUCT_DWM_652) }, | 692 | { USB_DEVICE(DLINK_VENDOR_ID, DLINK_PRODUCT_DWM_652) }, |
| 684 | { USB_DEVICE(ALINK_VENDOR_ID, DLINK_PRODUCT_DWM_652_U5) }, /* Yes, ALINK_VENDOR_ID */ | 693 | { USB_DEVICE(ALINK_VENDOR_ID, DLINK_PRODUCT_DWM_652_U5) }, /* Yes, ALINK_VENDOR_ID */ |
| @@ -716,6 +725,7 @@ static const struct usb_device_id option_ids[] = { | |||
| 716 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1011)}, | 725 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1011)}, |
| 717 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1012)}, | 726 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1012)}, |
| 718 | 727 | ||
| 728 | { USB_DEVICE(CINTERION_VENDOR_ID, 0x0047) }, | ||
| 719 | { } /* Terminating entry */ | 729 | { } /* Terminating entry */ |
| 720 | }; | 730 | }; |
| 721 | MODULE_DEVICE_TABLE(usb, option_ids); | 731 | MODULE_DEVICE_TABLE(usb, option_ids); |
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c index c97a0bb5b6db..c28b1607eacc 100644 --- a/drivers/usb/serial/pl2303.c +++ b/drivers/usb/serial/pl2303.c | |||
| @@ -59,6 +59,7 @@ static const struct usb_device_id id_table[] = { | |||
| 59 | { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_ALDIGA) }, | 59 | { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_ALDIGA) }, |
| 60 | { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_MMX) }, | 60 | { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_MMX) }, |
| 61 | { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_GPRS) }, | 61 | { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_GPRS) }, |
| 62 | { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_HCR331) }, | ||
| 62 | { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID) }, | 63 | { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID) }, |
| 63 | { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID_RSAQ5) }, | 64 | { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID_RSAQ5) }, |
| 64 | { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID) }, | 65 | { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID) }, |
diff --git a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h index a352d5f3a59c..23c09b38b9ec 100644 --- a/drivers/usb/serial/pl2303.h +++ b/drivers/usb/serial/pl2303.h | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #define PL2303_PRODUCT_ID_ALDIGA 0x0611 | 20 | #define PL2303_PRODUCT_ID_ALDIGA 0x0611 |
| 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 | 24 | ||
| 24 | #define ATEN_VENDOR_ID 0x0557 | 25 | #define ATEN_VENDOR_ID 0x0557 |
| 25 | #define ATEN_VENDOR_ID2 0x0547 | 26 | #define ATEN_VENDOR_ID2 0x0547 |
diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index 880e990abb07..e1bfda33f5b9 100644 --- a/drivers/usb/serial/ti_usb_3410_5052.c +++ b/drivers/usb/serial/ti_usb_3410_5052.c | |||
| @@ -1735,7 +1735,7 @@ static int ti_download_firmware(struct ti_device *tdev) | |||
| 1735 | return -ENOENT; | 1735 | return -ENOENT; |
| 1736 | } | 1736 | } |
| 1737 | if (fw_p->size > TI_FIRMWARE_BUF_SIZE) { | 1737 | if (fw_p->size > TI_FIRMWARE_BUF_SIZE) { |
| 1738 | dev_err(&dev->dev, "%s - firmware too large %d \n", __func__, fw_p->size); | 1738 | dev_err(&dev->dev, "%s - firmware too large %zu\n", __func__, fw_p->size); |
| 1739 | return -ENOENT; | 1739 | return -ENOENT; |
| 1740 | } | 1740 | } |
| 1741 | 1741 | ||
diff --git a/drivers/watchdog/ep93xx_wdt.c b/drivers/watchdog/ep93xx_wdt.c index 88ed54e50f74..59359c9a5e01 100644 --- a/drivers/watchdog/ep93xx_wdt.c +++ b/drivers/watchdog/ep93xx_wdt.c | |||
| @@ -244,7 +244,7 @@ MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started"); | |||
| 244 | module_param(timeout, int, 0); | 244 | module_param(timeout, int, 0); |
| 245 | MODULE_PARM_DESC(timeout, | 245 | MODULE_PARM_DESC(timeout, |
| 246 | "Watchdog timeout in seconds. (1<=timeout<=3600, default=" | 246 | "Watchdog timeout in seconds. (1<=timeout<=3600, default=" |
| 247 | __MODULE_STRING(WATCHDOG_TIMEOUT) ")"); | 247 | __MODULE_STRING(WDT_TIMEOUT) ")"); |
| 248 | 248 | ||
| 249 | MODULE_AUTHOR("Ray Lehtiniemi <rayl@mail.com>," | 249 | MODULE_AUTHOR("Ray Lehtiniemi <rayl@mail.com>," |
| 250 | "Alessandro Zummo <a.zummo@towertech.it>"); | 250 | "Alessandro Zummo <a.zummo@towertech.it>"); |
