aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/tablet
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2014-07-24 15:59:45 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2014-07-25 21:53:52 -0400
commitc31a408f7a44cd5fd134a7f0c0d29744261de2d9 (patch)
treeff545029fabb46ae7a57a956ba8cbf45d09efc8f /drivers/input/tablet
parent01c846f9539c194c7a6e34af036b1115b8ed822a (diff)
Input: wacom - install LED/OLED sysfs files in the HID device instead of USB
Removes one more dependency over USB, but requires some changes in the user space to find the sysfs files correctly. This patch breaks the user space. However, the number of program accessing the LEDs is quite limited and we can easily patch them to handle the new HID behavior. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Reviewed-by: Jason Gerecke <killertofu@gmail.com> Tested-by: Jason Gerecke <killertofu@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/tablet')
-rw-r--r--drivers/input/tablet/wacom_sys.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index ce76e1ef2dbc..6e21064de661 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -675,7 +675,7 @@ out:
675static ssize_t wacom_led_select_store(struct device *dev, int set_id, 675static ssize_t wacom_led_select_store(struct device *dev, int set_id,
676 const char *buf, size_t count) 676 const char *buf, size_t count)
677{ 677{
678 struct hid_device *hdev = dev_get_drvdata(dev); 678 struct hid_device *hdev = container_of(dev, struct hid_device, dev);
679 struct wacom *wacom = hid_get_drvdata(hdev); 679 struct wacom *wacom = hid_get_drvdata(hdev);
680 unsigned int id; 680 unsigned int id;
681 int err; 681 int err;
@@ -703,7 +703,7 @@ static ssize_t wacom_led##SET_ID##_select_store(struct device *dev, \
703static ssize_t wacom_led##SET_ID##_select_show(struct device *dev, \ 703static ssize_t wacom_led##SET_ID##_select_show(struct device *dev, \
704 struct device_attribute *attr, char *buf) \ 704 struct device_attribute *attr, char *buf) \
705{ \ 705{ \
706 struct hid_device *hdev = dev_get_drvdata(dev); \ 706 struct hid_device *hdev = container_of(dev, struct hid_device, dev);\
707 struct wacom *wacom = hid_get_drvdata(hdev); \ 707 struct wacom *wacom = hid_get_drvdata(hdev); \
708 return snprintf(buf, 2, "%d\n", wacom->led.select[SET_ID]); \ 708 return snprintf(buf, 2, "%d\n", wacom->led.select[SET_ID]); \
709} \ 709} \
@@ -738,7 +738,7 @@ static ssize_t wacom_luminance_store(struct wacom *wacom, u8 *dest,
738static ssize_t wacom_##name##_luminance_store(struct device *dev, \ 738static ssize_t wacom_##name##_luminance_store(struct device *dev, \
739 struct device_attribute *attr, const char *buf, size_t count) \ 739 struct device_attribute *attr, const char *buf, size_t count) \
740{ \ 740{ \
741 struct hid_device *hdev = dev_get_drvdata(dev); \ 741 struct hid_device *hdev = container_of(dev, struct hid_device, dev);\
742 struct wacom *wacom = hid_get_drvdata(hdev); \ 742 struct wacom *wacom = hid_get_drvdata(hdev); \
743 \ 743 \
744 return wacom_luminance_store(wacom, &wacom->led.field, \ 744 return wacom_luminance_store(wacom, &wacom->led.field, \
@@ -754,7 +754,7 @@ DEVICE_LUMINANCE_ATTR(buttons, img_lum);
754static ssize_t wacom_button_image_store(struct device *dev, int button_id, 754static ssize_t wacom_button_image_store(struct device *dev, int button_id,
755 const char *buf, size_t count) 755 const char *buf, size_t count)
756{ 756{
757 struct hid_device *hdev = dev_get_drvdata(dev); 757 struct hid_device *hdev = container_of(dev, struct hid_device, dev);
758 struct wacom *wacom = hid_get_drvdata(hdev); 758 struct wacom *wacom = hid_get_drvdata(hdev);
759 int err; 759 int err;
760 760
@@ -845,7 +845,7 @@ static int wacom_initialize_leds(struct wacom *wacom)
845 wacom->led.llv = 10; 845 wacom->led.llv = 10;
846 wacom->led.hlv = 20; 846 wacom->led.hlv = 20;
847 wacom->led.img_lum = 10; 847 wacom->led.img_lum = 10;
848 error = sysfs_create_group(&wacom->intf->dev.kobj, 848 error = sysfs_create_group(&wacom->hdev->dev.kobj,
849 &intuos4_led_attr_group); 849 &intuos4_led_attr_group);
850 break; 850 break;
851 851
@@ -857,7 +857,7 @@ static int wacom_initialize_leds(struct wacom *wacom)
857 wacom->led.hlv = 0; 857 wacom->led.hlv = 0;
858 wacom->led.img_lum = 0; 858 wacom->led.img_lum = 0;
859 859
860 error = sysfs_create_group(&wacom->intf->dev.kobj, 860 error = sysfs_create_group(&wacom->hdev->dev.kobj,
861 &cintiq_led_attr_group); 861 &cintiq_led_attr_group);
862 break; 862 break;
863 863
@@ -874,7 +874,7 @@ static int wacom_initialize_leds(struct wacom *wacom)
874 wacom->led.hlv = 0; 874 wacom->led.hlv = 0;
875 wacom->led.img_lum = 0; 875 wacom->led.img_lum = 0;
876 876
877 error = sysfs_create_group(&wacom->intf->dev.kobj, 877 error = sysfs_create_group(&wacom->hdev->dev.kobj,
878 &intuos5_led_attr_group); 878 &intuos5_led_attr_group);
879 } else 879 } else
880 return 0; 880 return 0;
@@ -885,7 +885,7 @@ static int wacom_initialize_leds(struct wacom *wacom)
885 } 885 }
886 886
887 if (error) { 887 if (error) {
888 dev_err(&wacom->intf->dev, 888 hid_err(wacom->hdev,
889 "cannot create sysfs group err: %d\n", error); 889 "cannot create sysfs group err: %d\n", error);
890 return error; 890 return error;
891 } 891 }
@@ -900,13 +900,13 @@ static void wacom_destroy_leds(struct wacom *wacom)
900 case INTUOS4S: 900 case INTUOS4S:
901 case INTUOS4: 901 case INTUOS4:
902 case INTUOS4L: 902 case INTUOS4L:
903 sysfs_remove_group(&wacom->intf->dev.kobj, 903 sysfs_remove_group(&wacom->hdev->dev.kobj,
904 &intuos4_led_attr_group); 904 &intuos4_led_attr_group);
905 break; 905 break;
906 906
907 case WACOM_24HD: 907 case WACOM_24HD:
908 case WACOM_21UX2: 908 case WACOM_21UX2:
909 sysfs_remove_group(&wacom->intf->dev.kobj, 909 sysfs_remove_group(&wacom->hdev->dev.kobj,
910 &cintiq_led_attr_group); 910 &cintiq_led_attr_group);
911 break; 911 break;
912 912
@@ -917,7 +917,7 @@ static void wacom_destroy_leds(struct wacom *wacom)
917 case INTUOSPM: 917 case INTUOSPM:
918 case INTUOSPL: 918 case INTUOSPL:
919 if (wacom->wacom_wac.features.device_type == BTN_TOOL_PEN) 919 if (wacom->wacom_wac.features.device_type == BTN_TOOL_PEN)
920 sysfs_remove_group(&wacom->intf->dev.kobj, 920 sysfs_remove_group(&wacom->hdev->dev.kobj,
921 &intuos5_led_attr_group); 921 &intuos5_led_attr_group);
922 break; 922 break;
923 } 923 }