From 9c113dc67ab712e1bb82e974e51c49a678562713 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 25 Apr 2012 14:48:31 -0700 Subject: USB: appletouch.c: remove err() usage err() was a very old USB-specific macro that I thought had gone away. This patch removes it from being used in the driver and uses dev_err() instead. CC: Alessandro Rubini CC: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman --- drivers/input/mouse/appletouch.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'drivers/input/mouse') diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c index 0acbc7d50d05..90db679b44af 100644 --- a/drivers/input/mouse/appletouch.c +++ b/drivers/input/mouse/appletouch.c @@ -262,7 +262,7 @@ static int atp_geyser_init(struct usb_device *udev) data = kmalloc(8, GFP_KERNEL); if (!data) { - err("Out of memory"); + dev_err(&udev->dev, "Out of memory\n"); return -ENOMEM; } @@ -277,7 +277,7 @@ static int atp_geyser_init(struct usb_device *udev) for (i = 0; i < 8; i++) dprintk("appletouch[%d]: %d\n", i, data[i]); - err("Failed to read mode from device."); + dev_err(&udev->dev, "Failed to read mode from device.\n"); ret = -EIO; goto out_free; } @@ -296,7 +296,7 @@ static int atp_geyser_init(struct usb_device *udev) for (i = 0; i < 8; i++) dprintk("appletouch[%d]: %d\n", i, data[i]); - err("Failed to request geyser raw mode"); + dev_err(&udev->dev, "Failed to request geyser raw mode\n"); ret = -EIO; goto out_free; } @@ -321,8 +321,9 @@ static void atp_reinit(struct work_struct *work) retval = usb_submit_urb(dev->urb, GFP_ATOMIC); if (retval) - err("atp_reinit: usb_submit_urb failed with error %d", - retval); + dev_err(&udev->dev, + "atp_reinit: usb_submit_urb failed with error %d\n", + retval); } static int atp_calculate_abs(int *xy_sensors, int nb_sensors, int fact, @@ -588,8 +589,9 @@ static void atp_complete_geyser_1_2(struct urb *urb) exit: retval = usb_submit_urb(dev->urb, GFP_ATOMIC); if (retval) - err("atp_complete: usb_submit_urb failed with result %d", - retval); + dev_err(&dev->udev->dev, + "atp_complete: usb_submit_urb failed with result %d\n", + retval); } /* Interrupt function for older touchpads: GEYSER3/GEYSER4 */ @@ -722,8 +724,9 @@ static void atp_complete_geyser_3_4(struct urb *urb) exit: retval = usb_submit_urb(dev->urb, GFP_ATOMIC); if (retval) - err("atp_complete: usb_submit_urb failed with result %d", - retval); + dev_err(&dev->udev->dev, + "atp_complete: usb_submit_urb failed with result %d\n", + retval); } static int atp_open(struct input_dev *input) @@ -785,7 +788,7 @@ static int atp_probe(struct usb_interface *iface, } } if (!int_in_endpointAddr) { - err("Could not find int-in endpoint"); + dev_err(&iface->dev, "Could not find int-in endpoint\n"); return -EIO; } @@ -793,7 +796,7 @@ static int atp_probe(struct usb_interface *iface, dev = kzalloc(sizeof(struct atp), GFP_KERNEL); input_dev = input_allocate_device(); if (!dev || !input_dev) { - err("Out of memory"); + dev_err(&iface->dev, "Out of memory\n"); goto err_free_devs; } -- cgit v1.2.3 From 6c1d1b246199c75486f5ffa677cf0e411ce4ac6e Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 25 Apr 2012 14:48:31 -0700 Subject: USB: bcm5974.c: remove err() usage err() was a very old USB-specific macro that I thought had gone away. This patch removes it from being used in the driver and uses dev_err() instead. CC: Henrik Rydberg CC: Alessandro Rubini CC: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman --- drivers/input/mouse/bcm5974.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'drivers/input/mouse') diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c index f9e2758b9f46..8cd7c932c202 100644 --- a/drivers/input/mouse/bcm5974.c +++ b/drivers/input/mouse/bcm5974.c @@ -584,7 +584,7 @@ static int bcm5974_wellspring_mode(struct bcm5974 *dev, bool on) int retval = 0, size; if (!data) { - err("bcm5974: out of memory"); + dev_err(&dev->intf->dev, "out of memory\n"); retval = -ENOMEM; goto out; } @@ -597,7 +597,7 @@ static int bcm5974_wellspring_mode(struct bcm5974 *dev, bool on) BCM5974_WELLSPRING_MODE_REQUEST_INDEX, data, 8, 5000); if (size != 8) { - err("bcm5974: could not read from device"); + dev_err(&dev->intf->dev, "could not read from device\n"); retval = -EIO; goto out; } @@ -615,7 +615,7 @@ static int bcm5974_wellspring_mode(struct bcm5974 *dev, bool on) BCM5974_WELLSPRING_MODE_REQUEST_INDEX, data, 8, 5000); if (size != 8) { - err("bcm5974: could not write to device"); + dev_err(&dev->intf->dev, "could not write to device\n"); retval = -EIO; goto out; } @@ -654,7 +654,7 @@ static void bcm5974_irq_button(struct urb *urb) exit: error = usb_submit_urb(dev->bt_urb, GFP_ATOMIC); if (error) - err("bcm5974: button urb failed: %d", error); + dev_err(&dev->intf->dev, "button urb failed: %d\n", error); } static void bcm5974_irq_trackpad(struct urb *urb) @@ -687,7 +687,7 @@ static void bcm5974_irq_trackpad(struct urb *urb) exit: error = usb_submit_urb(dev->tp_urb, GFP_ATOMIC); if (error) - err("bcm5974: trackpad urb failed: %d", error); + dev_err(&dev->intf->dev, "trackpad urb failed: %d\n", error); } /* @@ -833,7 +833,7 @@ static int bcm5974_probe(struct usb_interface *iface, dev = kzalloc(sizeof(struct bcm5974), GFP_KERNEL); input_dev = input_allocate_device(); if (!dev || !input_dev) { - err("bcm5974: out of memory"); + dev_err(&iface->dev, "out of memory\n"); goto err_free_devs; } -- cgit v1.2.3 From 80f8594f63dd35179235aa22901dfa5ce786fe00 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 1 May 2012 20:56:47 -0400 Subject: USB: input: appletouch.c: fix up dev_err() usage We should always reference the input device for dev_err(), not the USB device. Fix up the places where I got this wrong. Reported-by: Dmitry Torokhov CC: Alessandro Rubini Signed-off-by: Greg Kroah-Hartman --- drivers/input/mouse/appletouch.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'drivers/input/mouse') diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c index 90db679b44af..a5f15477a7ea 100644 --- a/drivers/input/mouse/appletouch.c +++ b/drivers/input/mouse/appletouch.c @@ -253,8 +253,9 @@ MODULE_PARM_DESC(debug, "Activate debugging output"); * packets (Report ID 2). This code changes device mode, so it * sends raw sensor reports (Report ID 5). */ -static int atp_geyser_init(struct usb_device *udev) +static int atp_geyser_init(struct atp *dev) { + struct usb_device *udev = dev->udev; char *data; int size; int i; @@ -262,7 +263,7 @@ static int atp_geyser_init(struct usb_device *udev) data = kmalloc(8, GFP_KERNEL); if (!data) { - dev_err(&udev->dev, "Out of memory\n"); + dev_err(&dev->input->dev, "Out of memory\n"); return -ENOMEM; } @@ -277,7 +278,7 @@ static int atp_geyser_init(struct usb_device *udev) for (i = 0; i < 8; i++) dprintk("appletouch[%d]: %d\n", i, data[i]); - dev_err(&udev->dev, "Failed to read mode from device.\n"); + dev_err(&dev->input->dev, "Failed to read mode from device.\n"); ret = -EIO; goto out_free; } @@ -296,7 +297,7 @@ static int atp_geyser_init(struct usb_device *udev) for (i = 0; i < 8; i++) dprintk("appletouch[%d]: %d\n", i, data[i]); - dev_err(&udev->dev, "Failed to request geyser raw mode\n"); + dev_err(&dev->input->dev, "Failed to request geyser raw mode\n"); ret = -EIO; goto out_free; } @@ -313,15 +314,14 @@ out_free: static void atp_reinit(struct work_struct *work) { struct atp *dev = container_of(work, struct atp, work); - struct usb_device *udev = dev->udev; int retval; dprintk("appletouch: putting appletouch to sleep (reinit)\n"); - atp_geyser_init(udev); + atp_geyser_init(dev); retval = usb_submit_urb(dev->urb, GFP_ATOMIC); if (retval) - dev_err(&udev->dev, + dev_err(&dev->input->dev, "atp_reinit: usb_submit_urb failed with error %d\n", retval); } @@ -589,7 +589,7 @@ static void atp_complete_geyser_1_2(struct urb *urb) exit: retval = usb_submit_urb(dev->urb, GFP_ATOMIC); if (retval) - dev_err(&dev->udev->dev, + dev_err(&dev->input->dev, "atp_complete: usb_submit_urb failed with result %d\n", retval); } @@ -724,7 +724,7 @@ static void atp_complete_geyser_3_4(struct urb *urb) exit: retval = usb_submit_urb(dev->urb, GFP_ATOMIC); if (retval) - dev_err(&dev->udev->dev, + dev_err(&dev->input->dev, "atp_complete: usb_submit_urb failed with result %d\n", retval); } @@ -751,14 +751,12 @@ static void atp_close(struct input_dev *input) static int atp_handle_geyser(struct atp *dev) { - struct usb_device *udev = dev->udev; - if (dev->info != &fountain_info) { /* switch to raw sensor mode */ - if (atp_geyser_init(udev)) + if (atp_geyser_init(dev)) return -EIO; - printk(KERN_INFO "appletouch: Geyser mode initialized.\n"); + dev_info(&dev->input->dev, "Geyser mode initialized.\n"); } return 0; -- cgit v1.2.3 From 140b1230a19b65489317271da36465e42865f2e4 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 1 May 2012 20:56:47 -0400 Subject: USB: input: bcm5974.c: fix up dev_err() usage We should always reference the input device for dev_err(), not the USB device. Fix up the places where I got this wrong. Reported-by: Dmitry Torokhov CC: Henrik Rydberg CC: Alessandro Rubini Signed-off-by: Greg Kroah-Hartman --- drivers/input/mouse/bcm5974.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers/input/mouse') diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c index 8cd7c932c202..e2e8d815da76 100644 --- a/drivers/input/mouse/bcm5974.c +++ b/drivers/input/mouse/bcm5974.c @@ -584,7 +584,7 @@ static int bcm5974_wellspring_mode(struct bcm5974 *dev, bool on) int retval = 0, size; if (!data) { - dev_err(&dev->intf->dev, "out of memory\n"); + dev_err(&dev->input->dev, "out of memory\n"); retval = -ENOMEM; goto out; } @@ -597,7 +597,7 @@ static int bcm5974_wellspring_mode(struct bcm5974 *dev, bool on) BCM5974_WELLSPRING_MODE_REQUEST_INDEX, data, 8, 5000); if (size != 8) { - dev_err(&dev->intf->dev, "could not read from device\n"); + dev_err(&dev->input->dev, "could not read from device\n"); retval = -EIO; goto out; } @@ -615,7 +615,7 @@ static int bcm5974_wellspring_mode(struct bcm5974 *dev, bool on) BCM5974_WELLSPRING_MODE_REQUEST_INDEX, data, 8, 5000); if (size != 8) { - dev_err(&dev->intf->dev, "could not write to device\n"); + dev_err(&dev->input->dev, "could not write to device\n"); retval = -EIO; goto out; } @@ -654,7 +654,7 @@ static void bcm5974_irq_button(struct urb *urb) exit: error = usb_submit_urb(dev->bt_urb, GFP_ATOMIC); if (error) - dev_err(&dev->intf->dev, "button urb failed: %d\n", error); + dev_err(&dev->input->dev, "button urb failed: %d\n", error); } static void bcm5974_irq_trackpad(struct urb *urb) @@ -687,7 +687,7 @@ static void bcm5974_irq_trackpad(struct urb *urb) exit: error = usb_submit_urb(dev->tp_urb, GFP_ATOMIC); if (error) - dev_err(&dev->intf->dev, "trackpad urb failed: %d\n", error); + dev_err(&dev->input->dev, "trackpad urb failed: %d\n", error); } /* -- cgit v1.2.3 From 67946d136879a129fccd35b79a87e1f05ace148e Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 1 May 2012 21:33:04 -0700 Subject: USB: appletouch.c: remove dbg() usage dbg() was a very old USB-specific macro that should no longer be used. This patch removes it from being used in the driver and uses dev_dbg() instead. CC: Alessandro Rubini CC: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman --- drivers/input/mouse/appletouch.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'drivers/input/mouse') diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c index a5f15477a7ea..d0a590f87c2b 100644 --- a/drivers/input/mouse/appletouch.c +++ b/drivers/input/mouse/appletouch.c @@ -401,6 +401,7 @@ static inline void atp_report_fingers(struct input_dev *input, int fingers) static int atp_status_check(struct urb *urb) { struct atp *dev = urb->context; + struct input_dev *idev = dev->input; switch (urb->status) { case 0: @@ -408,8 +409,8 @@ static int atp_status_check(struct urb *urb) break; case -EOVERFLOW: if (!dev->overflow_warned) { - printk(KERN_WARNING "appletouch: OVERFLOW with data " - "length %d, actual length is %d\n", + dev_warn(&idev->dev, + "appletouch: OVERFLOW with data length %d, actual length is %d\n", dev->info->datalen, dev->urb->actual_length); dev->overflow_warned = true; } @@ -417,13 +418,15 @@ static int atp_status_check(struct urb *urb) case -ENOENT: case -ESHUTDOWN: /* This urb is terminated, clean up */ - dbg("atp_complete: urb shutting down with status: %d", - urb->status); + dev_dbg(&idev->dev, + "atp_complete: urb shutting down with status: %d\n", + urb->status); return ATP_URB_STATUS_ERROR_FATAL; default: - dbg("atp_complete: nonzero urb status received: %d", - urb->status); + dev_dbg(&idev->dev, + "atp_complete: nonzero urb status received: %d\n", + urb->status); return ATP_URB_STATUS_ERROR; } @@ -446,7 +449,8 @@ static void atp_detect_size(struct atp *dev) for (i = dev->info->xsensors; i < ATP_XSENSORS; i++) { if (dev->xy_cur[i]) { - printk(KERN_INFO "appletouch: 17\" model detected.\n"); + dev_info(&dev->input->dev, + "appletouch: 17\" model detected.\n"); input_set_abs_params(dev->input, ABS_X, 0, (dev->info->xsensors_17 - 1) * -- cgit v1.2.3 From bd028769f741b88dc06831bfe7edb181671758ea Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 1 May 2012 21:33:05 -0700 Subject: USB: bcm5974.c: remove dbg() usage dbg() was a very old USB-specific macro that should no longer be used. This patch removes it from being used in the driver and uses dev_dbg() instead. CC: Henrik Rydberg CC: Alessandro Rubini CC: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman --- drivers/input/mouse/bcm5974.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'drivers/input/mouse') diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c index e2e8d815da76..e32928ee7cc2 100644 --- a/drivers/input/mouse/bcm5974.c +++ b/drivers/input/mouse/bcm5974.c @@ -631,6 +631,7 @@ static int bcm5974_wellspring_mode(struct bcm5974 *dev, bool on) static void bcm5974_irq_button(struct urb *urb) { struct bcm5974 *dev = urb->context; + struct input_dev *idev = dev->input; int error; switch (urb->status) { @@ -640,10 +641,11 @@ static void bcm5974_irq_button(struct urb *urb) case -ECONNRESET: case -ENOENT: case -ESHUTDOWN: - dbg("bcm5974: button urb shutting down: %d", urb->status); + dev_dbg(&idev->dev, "button urb shutting down: %d\n", + urb->status); return; default: - dbg("bcm5974: button urb status: %d", urb->status); + dev_dbg(&idev->dev, "button urb status: %d\n", urb->status); goto exit; } @@ -654,12 +656,13 @@ static void bcm5974_irq_button(struct urb *urb) exit: error = usb_submit_urb(dev->bt_urb, GFP_ATOMIC); if (error) - dev_err(&dev->input->dev, "button urb failed: %d\n", error); + dev_err(&idev->dev, "button urb failed: %d\n", error); } static void bcm5974_irq_trackpad(struct urb *urb) { struct bcm5974 *dev = urb->context; + struct input_dev *idev = dev->input; int error; switch (urb->status) { @@ -669,10 +672,11 @@ static void bcm5974_irq_trackpad(struct urb *urb) case -ECONNRESET: case -ENOENT: case -ESHUTDOWN: - dbg("bcm5974: trackpad urb shutting down: %d", urb->status); + dev_dbg(&idev->dev, "trackpad urb shutting down: %d\n", + urb->status); return; default: - dbg("bcm5974: trackpad urb status: %d", urb->status); + dev_dbg(&idev->dev, "trackpad urb status: %d\n", urb->status); goto exit; } @@ -687,7 +691,7 @@ static void bcm5974_irq_trackpad(struct urb *urb) exit: error = usb_submit_urb(dev->tp_urb, GFP_ATOMIC); if (error) - dev_err(&dev->input->dev, "trackpad urb failed: %d\n", error); + dev_err(&idev->dev, "trackpad urb failed: %d\n", error); } /* -- cgit v1.2.3 From 2d744b09199d2481c99563fdcf7f1c60f87fd965 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 4 May 2012 15:33:01 -0700 Subject: USB: input: appletouch.c: fix up dev_* messages Previously I had made the struct device point to the input device, but after talking with Dmitry, he said that the USB device would make more sense for this driver to point to. So converted it to use that instead. CC: Alessandro Rubini CC: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman --- drivers/input/mouse/appletouch.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'drivers/input/mouse') diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c index d0a590f87c2b..38268e8ea469 100644 --- a/drivers/input/mouse/appletouch.c +++ b/drivers/input/mouse/appletouch.c @@ -195,6 +195,7 @@ enum atp_status_bits { struct atp { char phys[64]; struct usb_device *udev; /* usb device */ + struct usb_interface *intf; /* usb interface */ struct urb *urb; /* usb request block */ u8 *data; /* transferred data */ struct input_dev *input; /* input dev */ @@ -263,7 +264,7 @@ static int atp_geyser_init(struct atp *dev) data = kmalloc(8, GFP_KERNEL); if (!data) { - dev_err(&dev->input->dev, "Out of memory\n"); + dev_err(&dev->intf->dev, "Out of memory\n"); return -ENOMEM; } @@ -278,7 +279,7 @@ static int atp_geyser_init(struct atp *dev) for (i = 0; i < 8; i++) dprintk("appletouch[%d]: %d\n", i, data[i]); - dev_err(&dev->input->dev, "Failed to read mode from device.\n"); + dev_err(&dev->intf->dev, "Failed to read mode from device.\n"); ret = -EIO; goto out_free; } @@ -297,7 +298,7 @@ static int atp_geyser_init(struct atp *dev) for (i = 0; i < 8; i++) dprintk("appletouch[%d]: %d\n", i, data[i]); - dev_err(&dev->input->dev, "Failed to request geyser raw mode\n"); + dev_err(&dev->intf->dev, "Failed to request geyser raw mode\n"); ret = -EIO; goto out_free; } @@ -321,7 +322,7 @@ static void atp_reinit(struct work_struct *work) retval = usb_submit_urb(dev->urb, GFP_ATOMIC); if (retval) - dev_err(&dev->input->dev, + dev_err(&dev->intf->dev, "atp_reinit: usb_submit_urb failed with error %d\n", retval); } @@ -402,6 +403,7 @@ static int atp_status_check(struct urb *urb) { struct atp *dev = urb->context; struct input_dev *idev = dev->input; + struct usb_interface *intf = dev->intf; switch (urb->status) { case 0: @@ -409,7 +411,7 @@ static int atp_status_check(struct urb *urb) break; case -EOVERFLOW: if (!dev->overflow_warned) { - dev_warn(&idev->dev, + dev_warn(&intf->dev, "appletouch: OVERFLOW with data length %d, actual length is %d\n", dev->info->datalen, dev->urb->actual_length); dev->overflow_warned = true; @@ -418,13 +420,13 @@ static int atp_status_check(struct urb *urb) case -ENOENT: case -ESHUTDOWN: /* This urb is terminated, clean up */ - dev_dbg(&idev->dev, + dev_dbg(&intf->dev, "atp_complete: urb shutting down with status: %d\n", urb->status); return ATP_URB_STATUS_ERROR_FATAL; default: - dev_dbg(&idev->dev, + dev_dbg(&intf->dev, "atp_complete: nonzero urb status received: %d\n", urb->status); return ATP_URB_STATUS_ERROR; @@ -449,7 +451,7 @@ static void atp_detect_size(struct atp *dev) for (i = dev->info->xsensors; i < ATP_XSENSORS; i++) { if (dev->xy_cur[i]) { - dev_info(&dev->input->dev, + dev_info(&dev->intf->dev, "appletouch: 17\" model detected.\n"); input_set_abs_params(dev->input, ABS_X, 0, @@ -593,7 +595,7 @@ static void atp_complete_geyser_1_2(struct urb *urb) exit: retval = usb_submit_urb(dev->urb, GFP_ATOMIC); if (retval) - dev_err(&dev->input->dev, + dev_err(&dev->intf->dev, "atp_complete: usb_submit_urb failed with result %d\n", retval); } @@ -728,7 +730,7 @@ static void atp_complete_geyser_3_4(struct urb *urb) exit: retval = usb_submit_urb(dev->urb, GFP_ATOMIC); if (retval) - dev_err(&dev->input->dev, + dev_err(&dev->intf->dev, "atp_complete: usb_submit_urb failed with result %d\n", retval); } @@ -760,7 +762,7 @@ static int atp_handle_geyser(struct atp *dev) if (atp_geyser_init(dev)) return -EIO; - dev_info(&dev->input->dev, "Geyser mode initialized.\n"); + dev_info(&dev->intf->dev, "Geyser mode initialized.\n"); } return 0; @@ -803,6 +805,7 @@ static int atp_probe(struct usb_interface *iface, } dev->udev = udev; + dev->intf = iface; dev->input = input_dev; dev->info = info; dev->overflow_warned = false; @@ -891,7 +894,7 @@ static void atp_disconnect(struct usb_interface *iface) usb_free_urb(dev->urb); kfree(dev); } - printk(KERN_INFO "input: appletouch disconnected\n"); + dev_info(&iface->dev, "input: appletouch disconnected\n"); } static int atp_recover(struct atp *dev) -- cgit v1.2.3 From ab943ca8942c50b7c35c561103efb4622c5bfb85 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 4 May 2012 15:33:02 -0700 Subject: USB: input: bcm5974.c: fix up dev_* messages Previously I had made the struct device point to the input device, but after talking with Dmitry, he said that the USB device would make more sense for this driver to point to. So converted it to use that instead. CC: Henrik Rydberg CC: Alessandro Rubini CC: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman --- drivers/input/mouse/bcm5974.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'drivers/input/mouse') diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c index e32928ee7cc2..2cf681d98c0d 100644 --- a/drivers/input/mouse/bcm5974.c +++ b/drivers/input/mouse/bcm5974.c @@ -584,7 +584,7 @@ static int bcm5974_wellspring_mode(struct bcm5974 *dev, bool on) int retval = 0, size; if (!data) { - dev_err(&dev->input->dev, "out of memory\n"); + dev_err(&dev->intf->dev, "out of memory\n"); retval = -ENOMEM; goto out; } @@ -597,7 +597,7 @@ static int bcm5974_wellspring_mode(struct bcm5974 *dev, bool on) BCM5974_WELLSPRING_MODE_REQUEST_INDEX, data, 8, 5000); if (size != 8) { - dev_err(&dev->input->dev, "could not read from device\n"); + dev_err(&dev->intf->dev, "could not read from device\n"); retval = -EIO; goto out; } @@ -615,7 +615,7 @@ static int bcm5974_wellspring_mode(struct bcm5974 *dev, bool on) BCM5974_WELLSPRING_MODE_REQUEST_INDEX, data, 8, 5000); if (size != 8) { - dev_err(&dev->input->dev, "could not write to device\n"); + dev_err(&dev->intf->dev, "could not write to device\n"); retval = -EIO; goto out; } @@ -631,7 +631,7 @@ static int bcm5974_wellspring_mode(struct bcm5974 *dev, bool on) static void bcm5974_irq_button(struct urb *urb) { struct bcm5974 *dev = urb->context; - struct input_dev *idev = dev->input; + struct usb_interface *intf = dev->intf; int error; switch (urb->status) { @@ -641,11 +641,11 @@ static void bcm5974_irq_button(struct urb *urb) case -ECONNRESET: case -ENOENT: case -ESHUTDOWN: - dev_dbg(&idev->dev, "button urb shutting down: %d\n", + dev_dbg(&intf->dev, "button urb shutting down: %d\n", urb->status); return; default: - dev_dbg(&idev->dev, "button urb status: %d\n", urb->status); + dev_dbg(&intf->dev, "button urb status: %d\n", urb->status); goto exit; } @@ -656,13 +656,13 @@ static void bcm5974_irq_button(struct urb *urb) exit: error = usb_submit_urb(dev->bt_urb, GFP_ATOMIC); if (error) - dev_err(&idev->dev, "button urb failed: %d\n", error); + dev_err(&intf->dev, "button urb failed: %d\n", error); } static void bcm5974_irq_trackpad(struct urb *urb) { struct bcm5974 *dev = urb->context; - struct input_dev *idev = dev->input; + struct usb_interface *intf = dev->intf; int error; switch (urb->status) { @@ -672,11 +672,11 @@ static void bcm5974_irq_trackpad(struct urb *urb) case -ECONNRESET: case -ENOENT: case -ESHUTDOWN: - dev_dbg(&idev->dev, "trackpad urb shutting down: %d\n", + dev_dbg(&intf->dev, "trackpad urb shutting down: %d\n", urb->status); return; default: - dev_dbg(&idev->dev, "trackpad urb status: %d\n", urb->status); + dev_dbg(&intf->dev, "trackpad urb status: %d\n", urb->status); goto exit; } @@ -691,7 +691,7 @@ static void bcm5974_irq_trackpad(struct urb *urb) exit: error = usb_submit_urb(dev->tp_urb, GFP_ATOMIC); if (error) - dev_err(&idev->dev, "trackpad urb failed: %d\n", error); + dev_err(&intf->dev, "trackpad urb failed: %d\n", error); } /* -- cgit v1.2.3 From 3b923993daaa38f1ae297a79f734c308866dd026 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 4 May 2012 15:35:56 -0700 Subject: USB: input: appletouch: fix up compiler warning My last patch fixing up the dev_* messages caused a compiler warning accidentally for an unused variable. Fix this up, as it was my fault. Cc: Alessandro Rubini Cc: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman --- drivers/input/mouse/appletouch.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/input/mouse') diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c index 38268e8ea469..e42f1fa8cdc0 100644 --- a/drivers/input/mouse/appletouch.c +++ b/drivers/input/mouse/appletouch.c @@ -402,7 +402,6 @@ static inline void atp_report_fingers(struct input_dev *input, int fingers) static int atp_status_check(struct urb *urb) { struct atp *dev = urb->context; - struct input_dev *idev = dev->input; struct usb_interface *intf = dev->intf; switch (urb->status) { -- cgit v1.2.3 From f2bb26b9b7652287719f08f080c09c2d7ddcf6b5 Mon Sep 17 00:00:00 2001 From: Bob Ross Date: Fri, 6 Jul 2012 11:34:47 -0700 Subject: Input: synaptics_usb - Remove TrackPoint name trailing whitespace The USB TrackPoint name string contains a space at the trailing end that can cause confusion/difficulty when creating udev rules. Example: "Synaptics Inc. Composite TouchPad / TrackPoint (Stick) " This patch removes the trailing space. Signed-off-by: Bob Ross Signed-off-by: Dmitry Torokhov --- drivers/input/mouse/synaptics_usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/input/mouse') diff --git a/drivers/input/mouse/synaptics_usb.c b/drivers/input/mouse/synaptics_usb.c index 3c5eaaa5d154..64cf34ea7604 100644 --- a/drivers/input/mouse/synaptics_usb.c +++ b/drivers/input/mouse/synaptics_usb.c @@ -364,7 +364,7 @@ static int synusb_probe(struct usb_interface *intf, le16_to_cpu(udev->descriptor.idProduct)); if (synusb->flags & SYNUSB_STICK) - strlcat(synusb->name, " (Stick) ", sizeof(synusb->name)); + strlcat(synusb->name, " (Stick)", sizeof(synusb->name)); usb_make_path(udev, synusb->phys, sizeof(synusb->phys)); strlcat(synusb->phys, "/input0", sizeof(synusb->phys)); -- cgit v1.2.3 From c6bd9d465500effa710634876fa9e35581da522d Mon Sep 17 00:00:00 2001 From: Daniel Kurtz Date: Sat, 7 Jul 2012 18:08:51 -0700 Subject: Input: synaptics - print firmware ID and board number at init Read the Firmware ID and Board Number from a synaptics device at init and display them in the system log. Device behavior is very board and firmware dependent. It may prove useful for users to include this information when providing bug reports or other feedback. Signed-off-by: Daniel Kurtz Acked-by: Henrik Rydberg Signed-off-by: Dmitry Torokhov --- drivers/input/mouse/synaptics.c | 38 ++++++++++++++++++++++++++++++++++++-- drivers/input/mouse/synaptics.h | 3 +++ 2 files changed, 39 insertions(+), 2 deletions(-) (limited to 'drivers/input/mouse') diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index c703d53be3a0..d5b390f75c9a 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c @@ -138,6 +138,35 @@ static int synaptics_model_id(struct psmouse *psmouse) return 0; } +/* + * Read the board id from the touchpad + * The board id is encoded in the "QUERY MODES" response + */ +static int synaptics_board_id(struct psmouse *psmouse) +{ + struct synaptics_data *priv = psmouse->private; + unsigned char bid[3]; + + if (synaptics_send_cmd(psmouse, SYN_QUE_MODES, bid)) + return -1; + priv->board_id = ((bid[0] & 0xfc) << 6) | bid[1]; + return 0; +} + +/* + * Read the firmware id from the touchpad + */ +static int synaptics_firmware_id(struct psmouse *psmouse) +{ + struct synaptics_data *priv = psmouse->private; + unsigned char fwid[3]; + + if (synaptics_send_cmd(psmouse, SYN_QUE_FIRMWARE_ID, fwid)) + return -1; + priv->firmware_id = (fwid[0] << 16) | (fwid[1] << 8) | fwid[2]; + return 0; +} + /* * Read the capability-bits from the touchpad * see also the SYN_CAP_* macros @@ -261,6 +290,10 @@ static int synaptics_query_hardware(struct psmouse *psmouse) return -1; if (synaptics_model_id(psmouse)) return -1; + if (synaptics_firmware_id(psmouse)) + return -1; + if (synaptics_board_id(psmouse)) + return -1; if (synaptics_capability(psmouse)) return -1; if (synaptics_resolution(psmouse)) @@ -1435,11 +1468,12 @@ static int __synaptics_init(struct psmouse *psmouse, bool absolute_mode) priv->pkt_type = SYN_MODEL_NEWABS(priv->model_id) ? SYN_NEWABS : SYN_OLDABS; psmouse_info(psmouse, - "Touchpad model: %ld, fw: %ld.%ld, id: %#lx, caps: %#lx/%#lx/%#lx\n", + "Touchpad model: %ld, fw: %ld.%ld, id: %#lx, caps: %#lx/%#lx/%#lx, board id: %lu, fw id: %lu\n", SYN_ID_MODEL(priv->identity), SYN_ID_MAJOR(priv->identity), SYN_ID_MINOR(priv->identity), priv->model_id, - priv->capabilities, priv->ext_cap, priv->ext_cap_0c); + priv->capabilities, priv->ext_cap, priv->ext_cap_0c, + priv->board_id, priv->firmware_id); set_input_params(psmouse->dev, priv); diff --git a/drivers/input/mouse/synaptics.h b/drivers/input/mouse/synaptics.h index fd26ccca13d7..e594af0b264b 100644 --- a/drivers/input/mouse/synaptics.h +++ b/drivers/input/mouse/synaptics.h @@ -18,6 +18,7 @@ #define SYN_QUE_SERIAL_NUMBER_SUFFIX 0x07 #define SYN_QUE_RESOLUTION 0x08 #define SYN_QUE_EXT_CAPAB 0x09 +#define SYN_QUE_FIRMWARE_ID 0x0a #define SYN_QUE_EXT_CAPAB_0C 0x0c #define SYN_QUE_EXT_MAX_COORDS 0x0d #define SYN_QUE_EXT_MIN_COORDS 0x0f @@ -148,6 +149,8 @@ struct synaptics_hw_state { struct synaptics_data { /* Data read from the touchpad */ unsigned long int model_id; /* Model-ID */ + unsigned long int firmware_id; /* Firmware-ID */ + unsigned long int board_id; /* Board-ID */ unsigned long int capabilities; /* Capabilities */ unsigned long int ext_cap; /* Extended Capabilities */ unsigned long int ext_cap_0c; /* Ext Caps from 0x0c query */ -- cgit v1.2.3