* RE: [PATCH v3 0/3] Input: omap-keypad: Convert to threaded IRQ and cleanup
From: Smyrnov, Illia @ 2013-08-22 11:34 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Balbi, Felipe, linux-input@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org
In-Reply-To: <1374681293-5320-1-git-send-email-illia.smyrnov@ti.com>
Dmitry,
should I take any additional action regarding these patches?
Best regards,
Illia Smyrnov
________________________________________
From: linux-kernel-owner@vger.kernel.org [linux-kernel-owner@vger.kernel.org] on behalf of Smyrnov, Illia
Sent: Wednesday, July 24, 2013 6:54 PM
To: Dmitry Torokhov
Cc: Balbi, Felipe; linux-input@vger.kernel.org; linux-kernel@vger.kernel.org; linux-omap@vger.kernel.org
Subject: [PATCH v3 0/3] Input: omap-keypad: Convert to threaded IRQ and cleanup
Replace unclear hardcoded values with bit field, convert to threaded IRQ and
clear interrupts when open the keypad.
Based on top of v3.11-rc2.
Tested on OMAP4 SDP.
Illia Smyrnov (3):
Input: omap-keypad: Cleanup - use bitfiled instead of hardcoded
values
Input: omap-keypad: Convert to threaded IRQ
Input: omap-keypad: Clear interrupts on open
drivers/input/keyboard/omap4-keypad.c | 57 +++++++++++++++++++--------------
1 files changed, 33 insertions(+), 24 deletions(-)
^ permalink raw reply
* Re: [PATCH v2 0/3] HID: Win 8 multitouch panels detection in core
From: Benjamin Tissoires @ 2013-08-22 8:37 UTC (permalink / raw)
To: Srinivas Pandruvada
Cc: Benjamin Tissoires, Henrik Rydberg, Jiri Kosina, Stephane Chatty,
Alexander Holler, linux-input, linux-kernel@vger.kernel.org
In-Reply-To: <52153015.6060409@linux.intel.com>
On Wed, Aug 21, 2013 at 11:24 PM, Srinivas Pandruvada
<srinivas.pandruvada@linux.intel.com> wrote:
> On 08/21/2013 08:40 AM, Benjamin Tissoires wrote:
>>
>> Hi guys,
>>
>> this is the v2 of the rework of the pre-scanning of the hid report
>> descriptors.
>> This allows us to be able to detect Win 8 multitouch panels.
>> I tried to take into account all of the previous reviews, and I think the
>> patch
>> series is in a better shape now.
>>
>> Alexander, Srinivas, could you please review/test patches 1/3 and 2/3 as
>> they
>> will both impact hid_sensor_hub detection now. From the report descriptors
>> Alexander sent, I would say that it will work now, but it's always better
>> to
>> have different testers :)
>
> Tested sensor hub. It works.
Thanks for the test Srinivas :)
Cheers,
Benjamin
^ permalink raw reply
* Re: [PATCH v2 1/3] HID: Use hid_parser for pre-scanning the report descriptors
From: Benjamin Tissoires @ 2013-08-22 8:31 UTC (permalink / raw)
To: Henrik Rydberg
Cc: Benjamin Tissoires, Jiri Kosina, Stephane Chatty,
Alexander Holler, Srinivas Pandruvada, linux-input,
linux-kernel@vger.kernel.org
In-Reply-To: <20130821181555.GA3851@polaris.bitmath.org>
Hi Henrik,
On Wed, Aug 21, 2013 at 8:15 PM, Henrik Rydberg <rydberg@euromail.se> wrote:
> Hi Benjamin,
>
> this looks pretty good to me, just a few nitpicks below.
>
>> hid_scan_report() implements its own HID report descriptor parsing. It is
>> going to be really bad with the detection of Win 8 certified touchscreen,
>> as this detection relies on a special feature and on the report_size and
>> report_count fields.
>
> How about 'The Win 8 detection is sufficiently complex to warrant use
> of the full parser code, in spite of the inferred memory
> usage. Therefore...'
>
Sure. Will change in v3.
>>
>> We can use the existing HID parser in hid-core for hid_scan_report()
>> by re-using the code from hid_open_report(). hid_parser_global,
>> hid_parser_local and hid_parser_reserved does not have any side effects.
>> We just need to reimplement the MAIN_ITEM callback to have a proper
>> parsing without side effects.
>>
>> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
>> ---
>>
>> changes in v2:
>> - moved "flags" processing in patch 2/3 (so use hid->group in this patch)
>> - hid_scan_report() is less verbose when errors are found in the descriptor
>> - hid_scan_report() is tolerant to parsing errors
>> - fixed usage_page handling in hid_scan_collection(), which fixes sensors detection
>> - amended commit message
>>
>> drivers/hid/hid-core.c | 106 +++++++++++++++++++++++++++++++------------------
>> 1 file changed, 67 insertions(+), 39 deletions(-)
>>
>> diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
>> index 3efe19f..e072b15 100644
>> --- a/drivers/hid/hid-core.c
>> +++ b/drivers/hid/hid-core.c
>> @@ -677,12 +677,55 @@ static u8 *fetch_item(__u8 *start, __u8 *end, struct hid_item *item)
>> return NULL;
>> }
>>
>> -static void hid_scan_usage(struct hid_device *hid, u32 usage)
>> +static void hid_scan_input_usage(struct hid_parser *parser, u32 usage)
>> {
>> + struct hid_device *hid = parser->device;
>> +
>> if (usage == HID_DG_CONTACTID)
>> hid->group = HID_GROUP_MULTITOUCH;
>> }
>>
>> +static void hid_scan_collection(struct hid_parser *parser, unsigned type)
>> +{
>> + struct hid_device *hid = parser->device;
>> +
>> + if (((parser->global.usage_page << 16) == HID_UP_SENSOR) &&
>> + type == HID_COLLECTION_PHYSICAL)
>> + hid->group = HID_GROUP_SENSOR_HUB;
>> +}
>> +
>> +static int hid_scan_main(struct hid_parser *parser, struct hid_item *item)
>> +{
>> + __u32 data;
>> + int i;
>> +
>> + data = item_udata(item);
>> +
>> + switch (item->tag) {
>> + case HID_MAIN_ITEM_TAG_BEGIN_COLLECTION:
>> + hid_scan_collection(parser, data & 0xff);
>> + break;
>> + case HID_MAIN_ITEM_TAG_END_COLLECTION:
>> + break;
>> + case HID_MAIN_ITEM_TAG_INPUT:
>> + for (i = 0; i < parser->local.usage_index; i++)
>> + hid_scan_input_usage(parser, parser->local.usage[i]);
>> + break;
>> + case HID_MAIN_ITEM_TAG_OUTPUT:
>> + break;
>> + case HID_MAIN_ITEM_TAG_FEATURE:
>> + break;
>> + default:
>> + hid_err(parser->device, "unknown main item tag 0x%x\n",
>> + item->tag);
>
> Looks this this message is a duplicate as well.
oops, forgot to remove it :)
Cheers,
Benjamin
>
>> + }
>> +
>> + /* Reset the local parser environment */
>> + memset(&parser->local, 0, sizeof(parser->local));
>> +
>> + return 0;
>> +}
>> +
>> /*
>> * Scan a report descriptor before the device is added to the bus.
>> * Sets device groups and other properties that determine what driver
>> @@ -690,48 +733,33 @@ static void hid_scan_usage(struct hid_device *hid, u32 usage)
>> */
>> static int hid_scan_report(struct hid_device *hid)
>> {
>> - unsigned int page = 0, delim = 0;
>> + struct hid_parser *parser;
>> + struct hid_item item;
>> __u8 *start = hid->dev_rdesc;
>> __u8 *end = start + hid->dev_rsize;
>> - unsigned int u, u_min = 0, u_max = 0;
>> - struct hid_item item;
>> + static int (*dispatch_type[])(struct hid_parser *parser,
>> + struct hid_item *item) = {
>> + hid_scan_main,
>> + hid_parser_global,
>> + hid_parser_local,
>> + hid_parser_reserved
>> + };
>>
>> - hid->group = HID_GROUP_GENERIC;
>> - while ((start = fetch_item(start, end, &item)) != NULL) {
>> - if (item.format != HID_ITEM_FORMAT_SHORT)
>> - return -EINVAL;
>> - if (item.type == HID_ITEM_TYPE_GLOBAL) {
>> - if (item.tag == HID_GLOBAL_ITEM_TAG_USAGE_PAGE)
>> - page = item_udata(&item) << 16;
>> - } else if (item.type == HID_ITEM_TYPE_LOCAL) {
>> - if (delim > 1)
>> - break;
>> - u = item_udata(&item);
>> - if (item.size <= 2)
>> - u += page;
>> - switch (item.tag) {
>> - case HID_LOCAL_ITEM_TAG_DELIMITER:
>> - delim += !!u;
>> - break;
>> - case HID_LOCAL_ITEM_TAG_USAGE:
>> - hid_scan_usage(hid, u);
>> - break;
>> - case HID_LOCAL_ITEM_TAG_USAGE_MINIMUM:
>> - u_min = u;
>> - break;
>> - case HID_LOCAL_ITEM_TAG_USAGE_MAXIMUM:
>> - u_max = u;
>> - for (u = u_min; u <= u_max; u++)
>> - hid_scan_usage(hid, u);
>> - break;
>> - }
>> - } else if (page == HID_UP_SENSOR &&
>> - item.type == HID_ITEM_TYPE_MAIN &&
>> - item.tag == HID_MAIN_ITEM_TAG_BEGIN_COLLECTION &&
>> - (item_udata(&item) & 0xff) == HID_COLLECTION_PHYSICAL)
>> - hid->group = HID_GROUP_SENSOR_HUB;
>> - }
>> + parser = vzalloc(sizeof(struct hid_parser));
>> + if (!parser)
>> + return -ENOMEM;
>> +
>> + parser->device = hid;
>> +
>> + /*
>> + * The parsing is simpler than the one in hid_open_report() as we should
>> + * be robust against hid errors. Those errors will be raised by
>> + * hid_open_report() anyway.
>> + */
>> + while ((start = fetch_item(start, end, &item)) != NULL)
>> + dispatch_type[item.type](parser, &item);
>>
>> + vfree(parser);
>> return 0;
>> }
>>
>> --
>> 1.8.3.1
>>
>
> Thanks,
> Henrik
^ permalink raw reply
* Re: [PATCH 2/2] input: misc: New USB eBeam input driver
From: Yann Cantin @ 2013-08-22 1:09 UTC (permalink / raw)
To: Oliver Neukum
Cc: linux-input, linux-usb, linux-kernel, linux-doc, dmitry.torokhov,
jkosina, rob, gregkh
In-Reply-To: <1377062750.1797.9.camel@linux-fkkt.site>
Hi,
All issues addressed. Just a point :
>> +
>> + /* input final setup */
>> + ebeam_setup_input(ebeam, input_dev);
>> +
>> + err = input_register_device(ebeam->input);
>> + if (err) {
>> + dev_dbg(&intf->dev,
>> + "%s - input_register_device failed, err: %d\n",
>> + __func__, err);
>> + goto out_free_urb;
>> + }
>> +
>> + /* usb final setup */
>> + usb_set_intfdata(intf, ebeam);
>> +
>> + /* sysfs setup */
>> + err = sysfs_create_group(&intf->dev.kobj, &ebeam_attr_group);
>> + if (err) {
>> + dev_dbg(&intf->dev,
>> + "%s - cannot create sysfs group, err: %d\n",
>> + __func__, err);
>> + goto out_unregister_input;
>> + }
>
> This is not nice. User space may react to a new input device of this
> type by setting up the calibration. But the sysfs files may be created
> after that. You should invert the order.
Switch done. Could you please double check the goto out-* cleanup, i've spotted
a missing usb_set_intfdata(intf, NULL), perhaps there's others missing steps :
static int ebeam_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
struct ebeam_device *ebeam;
struct input_dev *input_dev;
struct usb_endpoint_descriptor *endpoint;
struct usb_device *udev = interface_to_usbdev(intf);
int err = -ENOMEM;
endpoint = ebeam_get_input_endpoint(intf->cur_altsetting);
if (!endpoint)
return -ENXIO;
ebeam = kzalloc(sizeof(struct ebeam_device), GFP_KERNEL);
input_dev = input_allocate_device();
if (!ebeam || !input_dev)
goto out_free;
ebeam_init_settings(ebeam);
ebeam->data = usb_alloc_coherent(udev, REPT_SIZE,
GFP_KERNEL, &ebeam->data_dma);
if (!ebeam->data)
goto out_free;
ebeam->irq = usb_alloc_urb(0, GFP_KERNEL);
if (!ebeam->irq) {
dev_dbg(&intf->dev,
"%s - usb_alloc_urb failed: ebeam->irq\n", __func__);
goto out_free_buffers;
}
ebeam->interface = intf;
ebeam->input = input_dev;
/* setup name */
snprintf(ebeam->name, sizeof(ebeam->name),
"USB eBeam %04x:%04x",
le16_to_cpu(udev->descriptor.idVendor),
le16_to_cpu(udev->descriptor.idProduct));
if (udev->manufacturer || udev->product) {
strlcat(ebeam->name,
" (",
sizeof(ebeam->name));
if (udev->manufacturer)
strlcat(ebeam->name,
udev->manufacturer,
sizeof(ebeam->name));
if (udev->product) {
if (udev->manufacturer)
strlcat(ebeam->name,
" ",
sizeof(ebeam->name));
strlcat(ebeam->name,
udev->product,
sizeof(ebeam->name));
}
if (strlcat(ebeam->name, ")", sizeof(ebeam->name))
>= sizeof(ebeam->name)) {
/* overflowed, closing ) anyway */
ebeam->name[sizeof(ebeam->name)-2] = ')';
}
}
/* usb tree */
usb_make_path(udev, ebeam->phys, sizeof(ebeam->phys));
strlcat(ebeam->phys, "/input0", sizeof(ebeam->phys));
/* input setup */
input_dev->name = ebeam->name;
input_dev->phys = ebeam->phys;
usb_to_input_id(udev, &input_dev->id);
input_dev->dev.parent = &intf->dev;
input_set_drvdata(input_dev, ebeam);
input_dev->open = ebeam_open;
input_dev->close = ebeam_close;
/* usb urb setup */
if (usb_endpoint_type(endpoint) == USB_ENDPOINT_XFER_INT)
usb_fill_int_urb(ebeam->irq, udev,
usb_rcvintpipe(udev, endpoint->bEndpointAddress),
ebeam->data, REPT_SIZE,
ebeam_irq, ebeam, endpoint->bInterval);
else
usb_fill_bulk_urb(ebeam->irq, udev,
usb_rcvbulkpipe(udev, endpoint->bEndpointAddress),
ebeam->data, REPT_SIZE,
ebeam_irq, ebeam);
ebeam->irq->dev = udev;
ebeam->irq->transfer_dma = ebeam->data_dma;
ebeam->irq->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
/* usb final setup */
usb_set_intfdata(intf, ebeam);
/* sysfs setup */
err = sysfs_create_group(&intf->dev.kobj, &ebeam_attr_group);
if (err) {
dev_dbg(&intf->dev,
"%s - cannot create sysfs group, err: %d\n",
__func__, err);
goto out_free_usb;
}
/* input final setup */
ebeam_setup_input(ebeam, input_dev);
err = input_register_device(ebeam->input);
if (err) {
dev_dbg(&intf->dev,
"%s - input_register_device failed, err: %d\n",
__func__, err);
goto out_remove_sysfs;
}
return 0;
out_remove_sysfs:
sysfs_remove_group(&intf->dev.kobj, &ebeam_attr_group);
out_free_usb:
usb_set_intfdata(intf, NULL);
usb_free_urb(ebeam->irq);
out_free_buffers:
ebeam_free_buffers(udev, ebeam);
out_free:
input_free_device(input_dev);
kfree(ebeam);
return err;
}
Thanks,
--
Yann Cantin
A4FEB47F
--
^ permalink raw reply
* Re: [PATCH v2 0/3] HID: Win 8 multitouch panels detection in core
From: Srinivas Pandruvada @ 2013-08-21 21:24 UTC (permalink / raw)
To: Benjamin Tissoires
Cc: Benjamin Tissoires, Henrik Rydberg, Jiri Kosina, Stephane Chatty,
Alexander Holler, linux-input, linux-kernel
In-Reply-To: <1377099620-23947-1-git-send-email-benjamin.tissoires@redhat.com>
On 08/21/2013 08:40 AM, Benjamin Tissoires wrote:
> Hi guys,
>
> this is the v2 of the rework of the pre-scanning of the hid report descriptors.
> This allows us to be able to detect Win 8 multitouch panels.
> I tried to take into account all of the previous reviews, and I think the patch
> series is in a better shape now.
>
> Alexander, Srinivas, could you please review/test patches 1/3 and 2/3 as they
> will both impact hid_sensor_hub detection now. From the report descriptors
> Alexander sent, I would say that it will work now, but it's always better to
> have different testers :)
Tested sensor hub. It works.
>
> Cheers,
> Benjamin
>
> Changes in v2:
> - moved "flags" processing in patch 2/3
> - do not introduce parser->flags, but use hid->group as a temporary flag placeholder
> - hid_scan_report() is less verbose when errors are found in the descriptor
> - hid_scan_report() is tolerant to parsing errors
> - fixed usage_page handling in hid_scan_collection(), which fixes sensors detection
> - amended commit messages
> - #define and #undef HID_FLAG_* in hid-core.c instead of hid.h
>
> Benjamin Tissoires (3):
> HID: Use hid_parser for pre-scanning the report descriptors
> HID: detect Win 8 multitouch devices in core
> HID: do not init input reports for Win 8 multitouch devices
>
> drivers/hid/hid-core.c | 143 ++++++++++++++++++++++++++++++------------
> drivers/hid/hid-multitouch.c | 36 +++++++----
> drivers/hid/usbhid/hid-core.c | 11 +++-
> include/linux/hid.h | 2 +
> 4 files changed, 137 insertions(+), 55 deletions(-)
>
^ permalink raw reply
* Rotary encoder platform device driver code examples
From: GRENON Loïc @ 2013-08-21 20:50 UTC (permalink / raw)
To: linux-input
Hi guys,
I want to interface a magnetic scale position sensor with a BeagleBone
Black (an ARM development platform).
While I was reading this following article :
http://bwgz57.wordpress.com/2012/04/11/beaglebone-with-a-rotary-encoder/
I discovered that linux has built-in support for rotary encoders
connected via GPIO.
The magnetic scale position sensor can be considered like a rotary
encoder so I would use the rotary_encoder platform device driver.
I've read the code example at the end of this document :
https://www.kernel.org/doc/Documentation/input/rotary-encoder.txt
But I don't know how to access to the "pos" value of the rotary encoder.
Do you have some code example of use of this driver ? Or anything that
can be helpful for me.
Thanks,
Regards,
Loïc
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH v2 2/3] HID: detect Win 8 multitouch devices in core
From: Henrik Rydberg @ 2013-08-21 18:26 UTC (permalink / raw)
To: Benjamin Tissoires
Cc: Benjamin Tissoires, Jiri Kosina, Stephane Chatty,
Alexander Holler, Srinivas Pandruvada, linux-input, linux-kernel
In-Reply-To: <1377099620-23947-3-git-send-email-benjamin.tissoires@redhat.com>
Hi Benjamin,
> Detecting Win 8 multitouch devices in core allows us to set quirks
> before the device is parsed through hid_hw_start().
> It also simplifies the detection of those devices in hid-multitouch and
> makes the handling of those devices cleaner.
>
> As Win 8 multitouch panels are in the group multitouch and rely on a
> special feature to be detected, this patch also temporary convert
> hid->group into a bitfield, before reverting it to the actual
> group information. If we ever have more than 16 groups to detect,
> we can then add a .flags field in hid_parser for instance, and then
> use this to get the actual group.
>
> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> ---
>
> changes in v2:
> - moved "flags" processing here
> - do not introduce parser->flags, but use hid->group as a temporary flag placeholder
> - #define and #undef HID_FLAG_* in hid-core.c instead of hid.h
> - amended commit message
>
> drivers/hid/hid-core.c | 41 +++++++++++++++++++++++++++++++++++++++--
> drivers/hid/hid-multitouch.c | 24 +++++++++++-------------
> include/linux/hid.h | 1 +
> 3 files changed, 51 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
> index e072b15..c749966 100644
> --- a/drivers/hid/hid-core.c
> +++ b/drivers/hid/hid-core.c
> @@ -677,12 +677,25 @@ static u8 *fetch_item(__u8 *start, __u8 *end, struct hid_item *item)
> return NULL;
> }
>
> +#define HID_FLAG_MULTITOUCH (1 << HID_GROUP_MULTITOUCH)
> +#define HID_FLAG_WIN_8_CERTIFIED (1 << HID_GROUP_MULTITOUCH_WIN_8)
> +#define HID_FLAG_SENSOR_HUB (1 << HID_GROUP_SENSOR_HUB)
> +
Why not use the existing defines directly? If you worry about being
able to combine bit positions in a simple mask rather than using the
existing bitmask (which could be good), how about a priority list for
the groups instead? My own preference would be to leave structure for
the future to the future, and use a single state in the parser for the
case you are adding.
> static void hid_scan_input_usage(struct hid_parser *parser, u32 usage)
> {
> struct hid_device *hid = parser->device;
>
> if (usage == HID_DG_CONTACTID)
> - hid->group = HID_GROUP_MULTITOUCH;
> + hid->group |= HID_FLAG_MULTITOUCH;
> +}
Dynamic semantics, please no :-) My suggestion: leave this line be...
> +
> +static void hid_scan_feature_usage(struct hid_parser *parser, u32 usage)
> +{
> + struct hid_device *hid = parser->device;
> +
> + if (usage == 0xff0000c5 && parser->global.report_count == 256 &&
> + parser->global.report_size == 8)
> + hid->group |= HID_FLAG_WIN_8_CERTIFIED;
And set 'parser->is_win8 = true' here.
> }
>
> static void hid_scan_collection(struct hid_parser *parser, unsigned type)
> @@ -691,7 +704,7 @@ static void hid_scan_collection(struct hid_parser *parser, unsigned type)
>
> if (((parser->global.usage_page << 16) == HID_UP_SENSOR) &&
> type == HID_COLLECTION_PHYSICAL)
> - hid->group = HID_GROUP_SENSOR_HUB;
> + hid->group |= HID_FLAG_SENSOR_HUB;
Leave this...
> }
>
> static int hid_scan_main(struct hid_parser *parser, struct hid_item *item)
> @@ -714,6 +727,8 @@ static int hid_scan_main(struct hid_parser *parser, struct hid_item *item)
> case HID_MAIN_ITEM_TAG_OUTPUT:
> break;
> case HID_MAIN_ITEM_TAG_FEATURE:
> + for (i = 0; i < parser->local.usage_index; i++)
> + hid_scan_feature_usage(parser, parser->local.usage[i]);
> break;
> default:
> hid_err(parser->device, "unknown main item tag 0x%x\n",
> @@ -759,10 +774,32 @@ static int hid_scan_report(struct hid_device *hid)
> while ((start = fetch_item(start, end, &item)) != NULL)
> dispatch_type[item.type](parser, &item);
>
> + /*
> + * Re-interprete the group field to keep the same group definitions than
> + * we had in previous kernels.
> + */
> + switch (hid->group) {
> + case HID_FLAG_MULTITOUCH:
> + hid->group = HID_GROUP_MULTITOUCH;
> + break;
> + case HID_FLAG_MULTITOUCH | HID_FLAG_WIN_8_CERTIFIED:
> + hid->group = HID_GROUP_MULTITOUCH_WIN_8;
> + break;
> + case HID_FLAG_SENSOR_HUB:
> + hid->group = HID_GROUP_SENSOR_HUB;
> + break;
> + default:
> + hid->group = HID_GROUP_GENERIC;
> + }
> +
... and replace this with 'if (parser->is_win8) hid->group = HID_GROUP_MULTITOUCH_WIN_8'.
> vfree(parser);
> return 0;
> }
>
> +#undef HID_FLAG_MULTITOUCH
> +#undef HID_FLAG_WIN_8_CERTIFIED
> +#undef HID_FLAG_SENSOR_HUB
> +
No comment ;-)
> /**
> * hid_parse_report - parse device report
> *
> diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
> index 0fe00e2..c28ef86 100644
> --- a/drivers/hid/hid-multitouch.c
> +++ b/drivers/hid/hid-multitouch.c
> @@ -133,6 +133,7 @@ static void mt_post_parse(struct mt_device *td);
> #define MT_CLS_NSMU 0x000a
> #define MT_CLS_DUAL_CONTACT_NUMBER 0x0010
> #define MT_CLS_DUAL_CONTACT_ID 0x0011
> +#define MT_CLS_WIN_8 0x0012
>
> /* vendor specific classes */
> #define MT_CLS_3M 0x0101
> @@ -205,6 +206,11 @@ static struct mt_class mt_classes[] = {
> MT_QUIRK_CONTACT_CNT_ACCURATE |
> MT_QUIRK_SLOT_IS_CONTACTID,
> .maxcontacts = 2 },
> + { .name = MT_CLS_WIN_8,
> + .quirks = MT_QUIRK_ALWAYS_VALID |
> + MT_QUIRK_IGNORE_DUPLICATES |
> + MT_QUIRK_HOVERING |
> + MT_QUIRK_CONTACT_CNT_ACCURATE },
>
> /*
> * vendor specific classes
> @@ -332,19 +338,6 @@ static void mt_feature_mapping(struct hid_device *hdev,
> td->maxcontacts = td->mtclass.maxcontacts;
>
> break;
> - case 0xff0000c5:
> - if (field->report_count == 256 && field->report_size == 8) {
> - /* Win 8 devices need special quirks */
> - __s32 *quirks = &td->mtclass.quirks;
> - *quirks |= MT_QUIRK_ALWAYS_VALID;
> - *quirks |= MT_QUIRK_IGNORE_DUPLICATES;
> - *quirks |= MT_QUIRK_HOVERING;
> - *quirks |= MT_QUIRK_CONTACT_CNT_ACCURATE;
> - *quirks &= ~MT_QUIRK_NOT_SEEN_MEANS_UP;
> - *quirks &= ~MT_QUIRK_VALID_IS_INRANGE;
> - *quirks &= ~MT_QUIRK_VALID_IS_CONFIDENCE;
> - }
> - break;
> }
> }
>
> @@ -1346,6 +1339,11 @@ static const struct hid_device_id mt_devices[] = {
>
> /* Generic MT device */
> { HID_DEVICE(HID_BUS_ANY, HID_GROUP_MULTITOUCH, HID_ANY_ID, HID_ANY_ID) },
> +
> + /* Generic Win 8 certified MT device */
> + { .driver_data = MT_CLS_WIN_8,
> + HID_DEVICE(HID_BUS_ANY, HID_GROUP_MULTITOUCH_WIN_8,
> + HID_ANY_ID, HID_ANY_ID) },
> { }
> };
> MODULE_DEVICE_TABLE(hid, mt_devices);
> diff --git a/include/linux/hid.h b/include/linux/hid.h
> index 5a4e789..45b7f3f 100644
> --- a/include/linux/hid.h
> +++ b/include/linux/hid.h
> @@ -295,6 +295,7 @@ struct hid_item {
> #define HID_GROUP_GENERIC 0x0001
> #define HID_GROUP_MULTITOUCH 0x0002
> #define HID_GROUP_SENSOR_HUB 0x0003
> +#define HID_GROUP_MULTITOUCH_WIN_8 0x0004
>
> /*
> * This is the global environment of the parser. This information is
> --
> 1.8.3.1
>
Thanks,
Henrik
^ permalink raw reply
* Re: [PATCH v2 1/3] HID: Use hid_parser for pre-scanning the report descriptors
From: Henrik Rydberg @ 2013-08-21 18:15 UTC (permalink / raw)
To: Benjamin Tissoires
Cc: Benjamin Tissoires, Jiri Kosina, Stephane Chatty,
Alexander Holler, Srinivas Pandruvada, linux-input, linux-kernel
In-Reply-To: <1377099620-23947-2-git-send-email-benjamin.tissoires@redhat.com>
Hi Benjamin,
this looks pretty good to me, just a few nitpicks below.
> hid_scan_report() implements its own HID report descriptor parsing. It is
> going to be really bad with the detection of Win 8 certified touchscreen,
> as this detection relies on a special feature and on the report_size and
> report_count fields.
How about 'The Win 8 detection is sufficiently complex to warrant use
of the full parser code, in spite of the inferred memory
usage. Therefore...'
>
> We can use the existing HID parser in hid-core for hid_scan_report()
> by re-using the code from hid_open_report(). hid_parser_global,
> hid_parser_local and hid_parser_reserved does not have any side effects.
> We just need to reimplement the MAIN_ITEM callback to have a proper
> parsing without side effects.
>
> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> ---
>
> changes in v2:
> - moved "flags" processing in patch 2/3 (so use hid->group in this patch)
> - hid_scan_report() is less verbose when errors are found in the descriptor
> - hid_scan_report() is tolerant to parsing errors
> - fixed usage_page handling in hid_scan_collection(), which fixes sensors detection
> - amended commit message
>
> drivers/hid/hid-core.c | 106 +++++++++++++++++++++++++++++++------------------
> 1 file changed, 67 insertions(+), 39 deletions(-)
>
> diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
> index 3efe19f..e072b15 100644
> --- a/drivers/hid/hid-core.c
> +++ b/drivers/hid/hid-core.c
> @@ -677,12 +677,55 @@ static u8 *fetch_item(__u8 *start, __u8 *end, struct hid_item *item)
> return NULL;
> }
>
> -static void hid_scan_usage(struct hid_device *hid, u32 usage)
> +static void hid_scan_input_usage(struct hid_parser *parser, u32 usage)
> {
> + struct hid_device *hid = parser->device;
> +
> if (usage == HID_DG_CONTACTID)
> hid->group = HID_GROUP_MULTITOUCH;
> }
>
> +static void hid_scan_collection(struct hid_parser *parser, unsigned type)
> +{
> + struct hid_device *hid = parser->device;
> +
> + if (((parser->global.usage_page << 16) == HID_UP_SENSOR) &&
> + type == HID_COLLECTION_PHYSICAL)
> + hid->group = HID_GROUP_SENSOR_HUB;
> +}
> +
> +static int hid_scan_main(struct hid_parser *parser, struct hid_item *item)
> +{
> + __u32 data;
> + int i;
> +
> + data = item_udata(item);
> +
> + switch (item->tag) {
> + case HID_MAIN_ITEM_TAG_BEGIN_COLLECTION:
> + hid_scan_collection(parser, data & 0xff);
> + break;
> + case HID_MAIN_ITEM_TAG_END_COLLECTION:
> + break;
> + case HID_MAIN_ITEM_TAG_INPUT:
> + for (i = 0; i < parser->local.usage_index; i++)
> + hid_scan_input_usage(parser, parser->local.usage[i]);
> + break;
> + case HID_MAIN_ITEM_TAG_OUTPUT:
> + break;
> + case HID_MAIN_ITEM_TAG_FEATURE:
> + break;
> + default:
> + hid_err(parser->device, "unknown main item tag 0x%x\n",
> + item->tag);
Looks this this message is a duplicate as well.
> + }
> +
> + /* Reset the local parser environment */
> + memset(&parser->local, 0, sizeof(parser->local));
> +
> + return 0;
> +}
> +
> /*
> * Scan a report descriptor before the device is added to the bus.
> * Sets device groups and other properties that determine what driver
> @@ -690,48 +733,33 @@ static void hid_scan_usage(struct hid_device *hid, u32 usage)
> */
> static int hid_scan_report(struct hid_device *hid)
> {
> - unsigned int page = 0, delim = 0;
> + struct hid_parser *parser;
> + struct hid_item item;
> __u8 *start = hid->dev_rdesc;
> __u8 *end = start + hid->dev_rsize;
> - unsigned int u, u_min = 0, u_max = 0;
> - struct hid_item item;
> + static int (*dispatch_type[])(struct hid_parser *parser,
> + struct hid_item *item) = {
> + hid_scan_main,
> + hid_parser_global,
> + hid_parser_local,
> + hid_parser_reserved
> + };
>
> - hid->group = HID_GROUP_GENERIC;
> - while ((start = fetch_item(start, end, &item)) != NULL) {
> - if (item.format != HID_ITEM_FORMAT_SHORT)
> - return -EINVAL;
> - if (item.type == HID_ITEM_TYPE_GLOBAL) {
> - if (item.tag == HID_GLOBAL_ITEM_TAG_USAGE_PAGE)
> - page = item_udata(&item) << 16;
> - } else if (item.type == HID_ITEM_TYPE_LOCAL) {
> - if (delim > 1)
> - break;
> - u = item_udata(&item);
> - if (item.size <= 2)
> - u += page;
> - switch (item.tag) {
> - case HID_LOCAL_ITEM_TAG_DELIMITER:
> - delim += !!u;
> - break;
> - case HID_LOCAL_ITEM_TAG_USAGE:
> - hid_scan_usage(hid, u);
> - break;
> - case HID_LOCAL_ITEM_TAG_USAGE_MINIMUM:
> - u_min = u;
> - break;
> - case HID_LOCAL_ITEM_TAG_USAGE_MAXIMUM:
> - u_max = u;
> - for (u = u_min; u <= u_max; u++)
> - hid_scan_usage(hid, u);
> - break;
> - }
> - } else if (page == HID_UP_SENSOR &&
> - item.type == HID_ITEM_TYPE_MAIN &&
> - item.tag == HID_MAIN_ITEM_TAG_BEGIN_COLLECTION &&
> - (item_udata(&item) & 0xff) == HID_COLLECTION_PHYSICAL)
> - hid->group = HID_GROUP_SENSOR_HUB;
> - }
> + parser = vzalloc(sizeof(struct hid_parser));
> + if (!parser)
> + return -ENOMEM;
> +
> + parser->device = hid;
> +
> + /*
> + * The parsing is simpler than the one in hid_open_report() as we should
> + * be robust against hid errors. Those errors will be raised by
> + * hid_open_report() anyway.
> + */
> + while ((start = fetch_item(start, end, &item)) != NULL)
> + dispatch_type[item.type](parser, &item);
>
> + vfree(parser);
> return 0;
> }
>
> --
> 1.8.3.1
>
Thanks,
Henrik
^ permalink raw reply
* Re: [PATCH V3 1/2] tps6507x-ts: Add DT support
From: Dmitry Torokhov @ 2013-08-21 16:20 UTC (permalink / raw)
To: Manish Badarkhe
Cc: Prabhakar Lad, Vishwanathrao Badarkhe, Manish, dlos, LDOC,
device-tree, LKML, Rob Herring, Grant Likely, Rob Landley,
linux-input@vger.kernel.org
In-Reply-To: <CAKDJKT45=BUcx5q8bHL=xzHQ0aAhE=cwGy4EK8MWRfpiKVzt0g@mail.gmail.com>
Hi Manish,
On Tue, Aug 20, 2013 at 12:25:32PM +0530, Manish Badarkhe wrote:
> Hi Prabhakar,
>
> On Tue, Aug 20, 2013 at 11:44 AM, Prabhakar Lad
> >
> > All the three above properties as per the documentation above
> > are optional, but the code here makes them required property.
> > May be what you can do is if property is not defined make it as
> > zero as per documentation.
>
> I already taken care of this as per Dmitry's comment but not yet
> posted patch series as
> there is discussion going on populating child node's properties.
Please post the series using find node properties (as they were). We can
discuss if MFD devices should be automatically attaching parents OF data
to child devices they are creating later.
Thanks.
--
Dmitry
^ permalink raw reply
* [PATCH v2 1/3] HID: Use hid_parser for pre-scanning the report descriptors
From: Benjamin Tissoires @ 2013-08-21 15:40 UTC (permalink / raw)
To: Benjamin Tissoires, Henrik Rydberg, Jiri Kosina, Stephane Chatty,
Alexander Holler, Srinivas Pandruvada, linux-input, linux-kernel
In-Reply-To: <1377099620-23947-1-git-send-email-benjamin.tissoires@redhat.com>
hid_scan_report() implements its own HID report descriptor parsing. It is
going to be really bad with the detection of Win 8 certified touchscreen,
as this detection relies on a special feature and on the report_size and
report_count fields.
We can use the existing HID parser in hid-core for hid_scan_report()
by re-using the code from hid_open_report(). hid_parser_global,
hid_parser_local and hid_parser_reserved does not have any side effects.
We just need to reimplement the MAIN_ITEM callback to have a proper
parsing without side effects.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
---
changes in v2:
- moved "flags" processing in patch 2/3 (so use hid->group in this patch)
- hid_scan_report() is less verbose when errors are found in the descriptor
- hid_scan_report() is tolerant to parsing errors
- fixed usage_page handling in hid_scan_collection(), which fixes sensors detection
- amended commit message
drivers/hid/hid-core.c | 106 +++++++++++++++++++++++++++++++------------------
1 file changed, 67 insertions(+), 39 deletions(-)
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 3efe19f..e072b15 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -677,12 +677,55 @@ static u8 *fetch_item(__u8 *start, __u8 *end, struct hid_item *item)
return NULL;
}
-static void hid_scan_usage(struct hid_device *hid, u32 usage)
+static void hid_scan_input_usage(struct hid_parser *parser, u32 usage)
{
+ struct hid_device *hid = parser->device;
+
if (usage == HID_DG_CONTACTID)
hid->group = HID_GROUP_MULTITOUCH;
}
+static void hid_scan_collection(struct hid_parser *parser, unsigned type)
+{
+ struct hid_device *hid = parser->device;
+
+ if (((parser->global.usage_page << 16) == HID_UP_SENSOR) &&
+ type == HID_COLLECTION_PHYSICAL)
+ hid->group = HID_GROUP_SENSOR_HUB;
+}
+
+static int hid_scan_main(struct hid_parser *parser, struct hid_item *item)
+{
+ __u32 data;
+ int i;
+
+ data = item_udata(item);
+
+ switch (item->tag) {
+ case HID_MAIN_ITEM_TAG_BEGIN_COLLECTION:
+ hid_scan_collection(parser, data & 0xff);
+ break;
+ case HID_MAIN_ITEM_TAG_END_COLLECTION:
+ break;
+ case HID_MAIN_ITEM_TAG_INPUT:
+ for (i = 0; i < parser->local.usage_index; i++)
+ hid_scan_input_usage(parser, parser->local.usage[i]);
+ break;
+ case HID_MAIN_ITEM_TAG_OUTPUT:
+ break;
+ case HID_MAIN_ITEM_TAG_FEATURE:
+ break;
+ default:
+ hid_err(parser->device, "unknown main item tag 0x%x\n",
+ item->tag);
+ }
+
+ /* Reset the local parser environment */
+ memset(&parser->local, 0, sizeof(parser->local));
+
+ return 0;
+}
+
/*
* Scan a report descriptor before the device is added to the bus.
* Sets device groups and other properties that determine what driver
@@ -690,48 +733,33 @@ static void hid_scan_usage(struct hid_device *hid, u32 usage)
*/
static int hid_scan_report(struct hid_device *hid)
{
- unsigned int page = 0, delim = 0;
+ struct hid_parser *parser;
+ struct hid_item item;
__u8 *start = hid->dev_rdesc;
__u8 *end = start + hid->dev_rsize;
- unsigned int u, u_min = 0, u_max = 0;
- struct hid_item item;
+ static int (*dispatch_type[])(struct hid_parser *parser,
+ struct hid_item *item) = {
+ hid_scan_main,
+ hid_parser_global,
+ hid_parser_local,
+ hid_parser_reserved
+ };
- hid->group = HID_GROUP_GENERIC;
- while ((start = fetch_item(start, end, &item)) != NULL) {
- if (item.format != HID_ITEM_FORMAT_SHORT)
- return -EINVAL;
- if (item.type == HID_ITEM_TYPE_GLOBAL) {
- if (item.tag == HID_GLOBAL_ITEM_TAG_USAGE_PAGE)
- page = item_udata(&item) << 16;
- } else if (item.type == HID_ITEM_TYPE_LOCAL) {
- if (delim > 1)
- break;
- u = item_udata(&item);
- if (item.size <= 2)
- u += page;
- switch (item.tag) {
- case HID_LOCAL_ITEM_TAG_DELIMITER:
- delim += !!u;
- break;
- case HID_LOCAL_ITEM_TAG_USAGE:
- hid_scan_usage(hid, u);
- break;
- case HID_LOCAL_ITEM_TAG_USAGE_MINIMUM:
- u_min = u;
- break;
- case HID_LOCAL_ITEM_TAG_USAGE_MAXIMUM:
- u_max = u;
- for (u = u_min; u <= u_max; u++)
- hid_scan_usage(hid, u);
- break;
- }
- } else if (page == HID_UP_SENSOR &&
- item.type == HID_ITEM_TYPE_MAIN &&
- item.tag == HID_MAIN_ITEM_TAG_BEGIN_COLLECTION &&
- (item_udata(&item) & 0xff) == HID_COLLECTION_PHYSICAL)
- hid->group = HID_GROUP_SENSOR_HUB;
- }
+ parser = vzalloc(sizeof(struct hid_parser));
+ if (!parser)
+ return -ENOMEM;
+
+ parser->device = hid;
+
+ /*
+ * The parsing is simpler than the one in hid_open_report() as we should
+ * be robust against hid errors. Those errors will be raised by
+ * hid_open_report() anyway.
+ */
+ while ((start = fetch_item(start, end, &item)) != NULL)
+ dispatch_type[item.type](parser, &item);
+ vfree(parser);
return 0;
}
--
1.8.3.1
^ permalink raw reply related
* [PATCH v2 3/3] HID: do not init input reports for Win 8 multitouch devices
From: Benjamin Tissoires @ 2013-08-21 15:40 UTC (permalink / raw)
To: Benjamin Tissoires, Henrik Rydberg, Jiri Kosina, Stephane Chatty,
Alexander Holler, Srinivas Pandruvada, linux-input, linux-kernel
In-Reply-To: <1377099620-23947-1-git-send-email-benjamin.tissoires@redhat.com>
Some multitouch screens do not like to be polled for input reports.
However, the Win8 spec says that all touches should be sent during
each report, making the initialization of reports unnecessary.
The Win7 spec is less precise, so do not use this for those devices.
Add the quirk HID_QUIRK_NO_INIT_INPUT_REPORTS so that we do not have to
introduce a quirk for each problematic device. This quirk makes the driver
behave the same way the Win 8 does. It actually retrieves the features,
but not the inputs.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
---
no changes in v2
drivers/hid/hid-multitouch.c | 12 ++++++++++++
drivers/hid/usbhid/hid-core.c | 11 ++++++++---
include/linux/hid.h | 1 +
3 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index c28ef86..ac28f08 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -951,6 +951,18 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id)
hdev->quirks |= HID_QUIRK_MULTI_INPUT;
hdev->quirks |= HID_QUIRK_NO_EMPTY_INPUT;
+ /*
+ * Handle special quirks for Windows 8 certified devices.
+ */
+ if (id->group == HID_GROUP_MULTITOUCH_WIN_8)
+ /*
+ * Some multitouch screens do not like to be polled for input
+ * reports. Fortunately, the Win8 spec says that all touches
+ * should be sent during each report, making the initialization
+ * of input reports unnecessary.
+ */
+ hdev->quirks |= HID_QUIRK_NO_INIT_INPUT_REPORTS;
+
td = devm_kzalloc(&hdev->dev, sizeof(struct mt_device), GFP_KERNEL);
if (!td) {
dev_err(&hdev->dev, "cannot allocate multitouch data\n");
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index bd38cdf..44df131 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -750,12 +750,17 @@ void usbhid_init_reports(struct hid_device *hid)
{
struct hid_report *report;
struct usbhid_device *usbhid = hid->driver_data;
+ struct hid_report_enum *report_enum;
int err, ret;
- list_for_each_entry(report, &hid->report_enum[HID_INPUT_REPORT].report_list, list)
- usbhid_submit_report(hid, report, USB_DIR_IN);
+ if (!(hid->quirks & HID_QUIRK_NO_INIT_INPUT_REPORTS)) {
+ report_enum = &hid->report_enum[HID_INPUT_REPORT];
+ list_for_each_entry(report, &report_enum->report_list, list)
+ usbhid_submit_report(hid, report, USB_DIR_IN);
+ }
- list_for_each_entry(report, &hid->report_enum[HID_FEATURE_REPORT].report_list, list)
+ report_enum = &hid->report_enum[HID_FEATURE_REPORT];
+ list_for_each_entry(report, &report_enum->report_list, list)
usbhid_submit_report(hid, report, USB_DIR_IN);
err = 0;
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 45b7f3f..654627d 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -283,6 +283,7 @@ struct hid_item {
#define HID_QUIRK_MULTI_INPUT 0x00000040
#define HID_QUIRK_HIDINPUT_FORCE 0x00000080
#define HID_QUIRK_NO_EMPTY_INPUT 0x00000100
+#define HID_QUIRK_NO_INIT_INPUT_REPORTS 0x00000200
#define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000
#define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000
#define HID_QUIRK_NO_INIT_REPORTS 0x20000000
--
1.8.3.1
^ permalink raw reply related
* [PATCH v2 2/3] HID: detect Win 8 multitouch devices in core
From: Benjamin Tissoires @ 2013-08-21 15:40 UTC (permalink / raw)
To: Benjamin Tissoires, Henrik Rydberg, Jiri Kosina, Stephane Chatty,
Alexander Holler, Srinivas Pandruvada, linux-input, linux-kernel
In-Reply-To: <1377099620-23947-1-git-send-email-benjamin.tissoires@redhat.com>
Detecting Win 8 multitouch devices in core allows us to set quirks
before the device is parsed through hid_hw_start().
It also simplifies the detection of those devices in hid-multitouch and
makes the handling of those devices cleaner.
As Win 8 multitouch panels are in the group multitouch and rely on a
special feature to be detected, this patch also temporary convert
hid->group into a bitfield, before reverting it to the actual
group information. If we ever have more than 16 groups to detect,
we can then add a .flags field in hid_parser for instance, and then
use this to get the actual group.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
---
changes in v2:
- moved "flags" processing here
- do not introduce parser->flags, but use hid->group as a temporary flag placeholder
- #define and #undef HID_FLAG_* in hid-core.c instead of hid.h
- amended commit message
drivers/hid/hid-core.c | 41 +++++++++++++++++++++++++++++++++++++++--
drivers/hid/hid-multitouch.c | 24 +++++++++++-------------
include/linux/hid.h | 1 +
3 files changed, 51 insertions(+), 15 deletions(-)
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index e072b15..c749966 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -677,12 +677,25 @@ static u8 *fetch_item(__u8 *start, __u8 *end, struct hid_item *item)
return NULL;
}
+#define HID_FLAG_MULTITOUCH (1 << HID_GROUP_MULTITOUCH)
+#define HID_FLAG_WIN_8_CERTIFIED (1 << HID_GROUP_MULTITOUCH_WIN_8)
+#define HID_FLAG_SENSOR_HUB (1 << HID_GROUP_SENSOR_HUB)
+
static void hid_scan_input_usage(struct hid_parser *parser, u32 usage)
{
struct hid_device *hid = parser->device;
if (usage == HID_DG_CONTACTID)
- hid->group = HID_GROUP_MULTITOUCH;
+ hid->group |= HID_FLAG_MULTITOUCH;
+}
+
+static void hid_scan_feature_usage(struct hid_parser *parser, u32 usage)
+{
+ struct hid_device *hid = parser->device;
+
+ if (usage == 0xff0000c5 && parser->global.report_count == 256 &&
+ parser->global.report_size == 8)
+ hid->group |= HID_FLAG_WIN_8_CERTIFIED;
}
static void hid_scan_collection(struct hid_parser *parser, unsigned type)
@@ -691,7 +704,7 @@ static void hid_scan_collection(struct hid_parser *parser, unsigned type)
if (((parser->global.usage_page << 16) == HID_UP_SENSOR) &&
type == HID_COLLECTION_PHYSICAL)
- hid->group = HID_GROUP_SENSOR_HUB;
+ hid->group |= HID_FLAG_SENSOR_HUB;
}
static int hid_scan_main(struct hid_parser *parser, struct hid_item *item)
@@ -714,6 +727,8 @@ static int hid_scan_main(struct hid_parser *parser, struct hid_item *item)
case HID_MAIN_ITEM_TAG_OUTPUT:
break;
case HID_MAIN_ITEM_TAG_FEATURE:
+ for (i = 0; i < parser->local.usage_index; i++)
+ hid_scan_feature_usage(parser, parser->local.usage[i]);
break;
default:
hid_err(parser->device, "unknown main item tag 0x%x\n",
@@ -759,10 +774,32 @@ static int hid_scan_report(struct hid_device *hid)
while ((start = fetch_item(start, end, &item)) != NULL)
dispatch_type[item.type](parser, &item);
+ /*
+ * Re-interprete the group field to keep the same group definitions than
+ * we had in previous kernels.
+ */
+ switch (hid->group) {
+ case HID_FLAG_MULTITOUCH:
+ hid->group = HID_GROUP_MULTITOUCH;
+ break;
+ case HID_FLAG_MULTITOUCH | HID_FLAG_WIN_8_CERTIFIED:
+ hid->group = HID_GROUP_MULTITOUCH_WIN_8;
+ break;
+ case HID_FLAG_SENSOR_HUB:
+ hid->group = HID_GROUP_SENSOR_HUB;
+ break;
+ default:
+ hid->group = HID_GROUP_GENERIC;
+ }
+
vfree(parser);
return 0;
}
+#undef HID_FLAG_MULTITOUCH
+#undef HID_FLAG_WIN_8_CERTIFIED
+#undef HID_FLAG_SENSOR_HUB
+
/**
* hid_parse_report - parse device report
*
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 0fe00e2..c28ef86 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -133,6 +133,7 @@ static void mt_post_parse(struct mt_device *td);
#define MT_CLS_NSMU 0x000a
#define MT_CLS_DUAL_CONTACT_NUMBER 0x0010
#define MT_CLS_DUAL_CONTACT_ID 0x0011
+#define MT_CLS_WIN_8 0x0012
/* vendor specific classes */
#define MT_CLS_3M 0x0101
@@ -205,6 +206,11 @@ static struct mt_class mt_classes[] = {
MT_QUIRK_CONTACT_CNT_ACCURATE |
MT_QUIRK_SLOT_IS_CONTACTID,
.maxcontacts = 2 },
+ { .name = MT_CLS_WIN_8,
+ .quirks = MT_QUIRK_ALWAYS_VALID |
+ MT_QUIRK_IGNORE_DUPLICATES |
+ MT_QUIRK_HOVERING |
+ MT_QUIRK_CONTACT_CNT_ACCURATE },
/*
* vendor specific classes
@@ -332,19 +338,6 @@ static void mt_feature_mapping(struct hid_device *hdev,
td->maxcontacts = td->mtclass.maxcontacts;
break;
- case 0xff0000c5:
- if (field->report_count == 256 && field->report_size == 8) {
- /* Win 8 devices need special quirks */
- __s32 *quirks = &td->mtclass.quirks;
- *quirks |= MT_QUIRK_ALWAYS_VALID;
- *quirks |= MT_QUIRK_IGNORE_DUPLICATES;
- *quirks |= MT_QUIRK_HOVERING;
- *quirks |= MT_QUIRK_CONTACT_CNT_ACCURATE;
- *quirks &= ~MT_QUIRK_NOT_SEEN_MEANS_UP;
- *quirks &= ~MT_QUIRK_VALID_IS_INRANGE;
- *quirks &= ~MT_QUIRK_VALID_IS_CONFIDENCE;
- }
- break;
}
}
@@ -1346,6 +1339,11 @@ static const struct hid_device_id mt_devices[] = {
/* Generic MT device */
{ HID_DEVICE(HID_BUS_ANY, HID_GROUP_MULTITOUCH, HID_ANY_ID, HID_ANY_ID) },
+
+ /* Generic Win 8 certified MT device */
+ { .driver_data = MT_CLS_WIN_8,
+ HID_DEVICE(HID_BUS_ANY, HID_GROUP_MULTITOUCH_WIN_8,
+ HID_ANY_ID, HID_ANY_ID) },
{ }
};
MODULE_DEVICE_TABLE(hid, mt_devices);
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 5a4e789..45b7f3f 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -295,6 +295,7 @@ struct hid_item {
#define HID_GROUP_GENERIC 0x0001
#define HID_GROUP_MULTITOUCH 0x0002
#define HID_GROUP_SENSOR_HUB 0x0003
+#define HID_GROUP_MULTITOUCH_WIN_8 0x0004
/*
* This is the global environment of the parser. This information is
--
1.8.3.1
^ permalink raw reply related
* [PATCH v2 0/3] HID: Win 8 multitouch panels detection in core
From: Benjamin Tissoires @ 2013-08-21 15:40 UTC (permalink / raw)
To: Benjamin Tissoires, Henrik Rydberg, Jiri Kosina, Stephane Chatty,
Alexander Holler, Srinivas Pandruvada, linux-input, linux-kernel
Hi guys,
this is the v2 of the rework of the pre-scanning of the hid report descriptors.
This allows us to be able to detect Win 8 multitouch panels.
I tried to take into account all of the previous reviews, and I think the patch
series is in a better shape now.
Alexander, Srinivas, could you please review/test patches 1/3 and 2/3 as they
will both impact hid_sensor_hub detection now. From the report descriptors
Alexander sent, I would say that it will work now, but it's always better to
have different testers :)
Cheers,
Benjamin
Changes in v2:
- moved "flags" processing in patch 2/3
- do not introduce parser->flags, but use hid->group as a temporary flag placeholder
- hid_scan_report() is less verbose when errors are found in the descriptor
- hid_scan_report() is tolerant to parsing errors
- fixed usage_page handling in hid_scan_collection(), which fixes sensors detection
- amended commit messages
- #define and #undef HID_FLAG_* in hid-core.c instead of hid.h
Benjamin Tissoires (3):
HID: Use hid_parser for pre-scanning the report descriptors
HID: detect Win 8 multitouch devices in core
HID: do not init input reports for Win 8 multitouch devices
drivers/hid/hid-core.c | 143 ++++++++++++++++++++++++++++++------------
drivers/hid/hid-multitouch.c | 36 +++++++----
drivers/hid/usbhid/hid-core.c | 11 +++-
include/linux/hid.h | 2 +
4 files changed, 137 insertions(+), 55 deletions(-)
--
1.8.3.1
^ permalink raw reply
* Re: [PATCH] typo fixes (coordiante -> coordinate) in am335x
From: Tony Lindgren @ 2013-08-21 7:58 UTC (permalink / raw)
To: Zubair Lutfullah
Cc: sameo, linux-doc, linux-kernel, linux-omap, linux-arm-kernel,
linux-input
In-Reply-To: <1373901928-19605-1-git-send-email-zubair.lutfullah@gmail.com>
* Zubair Lutfullah <zubair.lutfullah@gmail.com> [130715 08:33]:
> Did a grep for coordiante and replaced them all
> with coordinate.
>
> This applies to the mfd-next tree.
This should be safe to apply via the MFD tree as a non-critical
fix assuming the bootloaders are not yet using this:
Acked-by: Tony Lindgren <tony@atomide.com>
> Signed-off-by: Zubair Lutfullah <zubair.lutfullah@gmail.com>
> ---
> .../bindings/input/touchscreen/ti-tsc-adc.txt | 4 ++--
> arch/arm/boot/dts/am335x-evm.dts | 2 +-
> drivers/input/touchscreen/ti_am335x_tsc.c | 2 +-
> drivers/mfd/ti_am335x_tscadc.c | 2 +-
> 4 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/input/touchscreen/ti-tsc-adc.txt b/Documentation/devicetree/bindings/input/touchscreen/ti-tsc-adc.txt
> index 491c97b..3e22aec 100644
> --- a/Documentation/devicetree/bindings/input/touchscreen/ti-tsc-adc.txt
> +++ b/Documentation/devicetree/bindings/input/touchscreen/ti-tsc-adc.txt
> @@ -6,7 +6,7 @@ Required properties:
> ti,wires: Wires refer to application modes i.e. 4/5/8 wire touchscreen
> support on the platform.
> ti,x-plate-resistance: X plate resistance
> - ti,coordiante-readouts: The sequencer supports a total of 16
> + ti,coordinate-readouts: The sequencer supports a total of 16
> programmable steps each step is used to
> read a single coordinate. A single
> readout is enough but multiple reads can
> @@ -34,7 +34,7 @@ Example:
> tsc {
> ti,wires = <4>;
> ti,x-plate-resistance = <200>;
> - ti,coordiante-readouts = <5>;
> + ti,coordinate-readouts = <5>;
> ti,wire-config = <0x00 0x11 0x22 0x33>;
> };
>
> diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
> index 0fa4c7f..e50b781 100644
> --- a/arch/arm/boot/dts/am335x-evm.dts
> +++ b/arch/arm/boot/dts/am335x-evm.dts
> @@ -250,7 +250,7 @@
> tsc {
> ti,wires = <4>;
> ti,x-plate-resistance = <200>;
> - ti,coordiante-readouts = <5>;
> + ti,coordinate-readouts = <5>;
> ti,wire-config = <0x00 0x11 0x22 0x33>;
> };
>
> diff --git a/drivers/input/touchscreen/ti_am335x_tsc.c b/drivers/input/touchscreen/ti_am335x_tsc.c
> index 0e9f02a..6422f65 100644
> --- a/drivers/input/touchscreen/ti_am335x_tsc.c
> +++ b/drivers/input/touchscreen/ti_am335x_tsc.c
> @@ -348,7 +348,7 @@ static int titsc_parse_dt(struct platform_device *pdev,
> if (err < 0)
> return err;
>
> - err = of_property_read_u32(node, "ti,coordiante-readouts",
> + err = of_property_read_u32(node, "ti,coordinate-readouts",
> &ts_dev->coordinate_readouts);
> if (err < 0)
> return err;
> diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c
> index b003a16..dd31e23 100644
> --- a/drivers/mfd/ti_am335x_tscadc.c
> +++ b/drivers/mfd/ti_am335x_tscadc.c
> @@ -106,7 +106,7 @@ static int ti_tscadc_probe(struct platform_device *pdev)
>
> node = of_get_child_by_name(pdev->dev.of_node, "tsc");
> of_property_read_u32(node, "ti,wires", &tsc_wires);
> - of_property_read_u32(node, "ti,coordiante-readouts", &readouts);
> + of_property_read_u32(node, "ti,coordinate-readouts", &readouts);
>
> node = of_get_child_by_name(pdev->dev.of_node, "adc");
> of_property_for_each_u32(node, "ti,adc-channels", prop, cur, val) {
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH 2/2] input: misc: New USB eBeam input driver
From: Oliver Neukum @ 2013-08-21 5:25 UTC (permalink / raw)
To: Yann Cantin
Cc: linux-input, linux-usb, linux-kernel, linux-doc, dmitry.torokhov,
jkosina, rob, gregkh
In-Reply-To: <1376684743-25047-3-git-send-email-yann.cantin@laposte.net>
On Fri, 2013-08-16 at 22:25 +0200, Yann Cantin wrote:
> +/* IRQ */
> +static int ebeam_read_data(struct ebeam_device *ebeam, unsigned char *pkt)
> +{
> +
> +/*
> + * Packet description : 8 bytes
> + *
> + * nop packet : FF FF FF FF FF FF FF FF
> + *
> + * pkt[0] : Sensors
> + * bit 1 : ultrasound signal (guessed)
> + * bit 2 : IR signal (tested with a remote...) ;
> + * readings OK : 0x03 (anything else is a show-stopper)
> + *
> + * pkt[1] : raw_x low
> + * pkt[2] : raw_x high
> + *
> + * pkt[3] : raw_y low
> + * pkt[4] : raw_y high
> + *
> + * pkt[5] : fiability ?
> + * often 0xC0
> + * > 0x80 : OK
> + *
> + * pkt[6] :
> + * buttons state (low 4 bits)
> + * 0x1 = no buttons
> + * bit 0 : tip (WARNING inversed : 0=pressed)
> + * bit 1 : ? (always 0 during tests)
> + * bit 2 : little (1=pressed)
> + * bit 3 : big (1=pressed)
> + *
> + * pointer ID : (high 4 bits)
> + * Tested : 0x6=wand ;
> + * Guessed : 0x1=red ; 0x2=blue ; 0x3=green ; 0x4=black ;
> + * 0x5=eraser
> + * bit 4 : pointer ID
> + * bit 5 : pointer ID
> + * bit 6 : pointer ID
> + * bit 7 : pointer ID
> + *
> + *
> + * pkt[7] : fiability ?
> + * often 0xFF
> + *
> + */
> +
> + /* Filtering bad/nop packet */
> + if (pkt[0] != 0x03)
> + return 0;
> +
> + ebeam->raw_x = (pkt[2] << 8) | pkt[1];
> + ebeam->raw_y = (pkt[4] << 8) | pkt[3];
We have macros. In this case get_unaligned_le16.
> + ebeam->btn_map = (!(pkt[6] & 0x1)) |
> + ((pkt[6] & 0x4) >> 1) |
> + ((pkt[6] & 0x8) >> 1);
> +
> + return 1;
> +}
> +static void ebeam_close(struct input_dev *input)
> +{
> + struct ebeam_device *ebeam = input_get_drvdata(input);
> + int r;
> +
> + usb_kill_urb(ebeam->irq);
> +
> + r = usb_autopm_get_interface(ebeam->interface);
Nope. That's an uncool race. If the interface is suspended when
you call this, you will resume it and restart the URB. Therefore
you ought to kill the URB after resuming.
> + ebeam->interface->needs_remote_wakeup = 0;
> +
> + if (!r)
> + usb_autopm_put_interface(ebeam->interface);
> +}
> +
> +static int ebeam_suspend(struct usb_interface *intf, pm_message_t message)
> +{
> + struct ebeam_device *ebeam = usb_get_intfdata(intf);
> +
> + usb_kill_urb(ebeam->irq);
> +
> + return 0;
> +}
> +
> +static int ebeam_resume(struct usb_interface *intf)
> +{
> + struct ebeam_device *ebeam = usb_get_intfdata(intf);
> + struct input_dev *input = ebeam->input;
> + int result = 0;
> +
> + mutex_lock(&input->mutex);
> + if (input->users)
> + result = usb_submit_urb(ebeam->irq, GFP_NOIO);
> + mutex_unlock(&input->mutex);
> +
> + return result;
> +}
> +
> +static int ebeam_reset_resume(struct usb_interface *intf)
> +{
> + return ebeam_resume(intf);
> +}
No need to define a function. You can use the function as
value for resume and reset_resume.
> +
> +static int ebeam_probe(struct usb_interface *intf,
> + const struct usb_device_id *id)
> +{
> + struct ebeam_device *ebeam;
> + struct input_dev *input_dev;
> + struct usb_endpoint_descriptor *endpoint;
> + struct usb_device *udev = interface_to_usbdev(intf);
> + int err = -ENOMEM;
> +
> + endpoint = ebeam_get_input_endpoint(intf->cur_altsetting);
> + if (!endpoint)
> + return -ENXIO;
> +
> + ebeam = kzalloc(sizeof(struct ebeam_device), GFP_KERNEL);
> + input_dev = input_allocate_device();
> + if (!ebeam || !input_dev)
> + goto out_free;
> +
> + ebeam_init_settings(ebeam);
> +
> + ebeam->data = usb_alloc_coherent(udev, REPT_SIZE,
> + GFP_KERNEL, &ebeam->data_dma);
> + if (!ebeam->data)
> + goto out_free;
> +
> + ebeam->irq = usb_alloc_urb(0, GFP_KERNEL);
> + if (!ebeam->irq) {
> + dev_dbg(&intf->dev,
> + "%s - usb_alloc_urb failed: ebeam->irq\n", __func__);
> + goto out_free_buffers;
> + }
> +
> + ebeam->interface = intf;
> + ebeam->input = input_dev;
> +
> + /* setup name */
> + snprintf(ebeam->name, sizeof(ebeam->name),
> + "USB eBeam %04x:%04x",
> + le16_to_cpu(udev->descriptor.idVendor),
> + le16_to_cpu(udev->descriptor.idProduct));
> +
> + if (udev->manufacturer || udev->product) {
> + strlcat(ebeam->name,
> + " (",
> + sizeof(ebeam->name));
> +
> + if (udev->manufacturer)
> + strlcat(ebeam->name,
> + udev->manufacturer,
> + sizeof(ebeam->name));
> +
> + if (udev->product) {
> + if (udev->manufacturer)
> + strlcat(ebeam->name,
> + " ",
> + sizeof(ebeam->name));
> + strlcat(ebeam->name,
> + udev->product,
> + sizeof(ebeam->name));
> + }
> +
> + if (strlcat(ebeam->name, ")", sizeof(ebeam->name))
> + >= sizeof(ebeam->name)) {
> + /* overflowed, closing ) anyway */
> + ebeam->name[sizeof(ebeam->name)-2] = ')';
> + }
> + }
> +
> + /* usb tree */
> + usb_make_path(udev, ebeam->phys, sizeof(ebeam->phys));
> + strlcat(ebeam->phys, "/input0", sizeof(ebeam->phys));
> +
> + /* input setup */
> + input_dev->name = ebeam->name;
> + input_dev->phys = ebeam->phys;
> + usb_to_input_id(udev, &input_dev->id);
> + input_dev->dev.parent = &intf->dev;
> +
> + input_set_drvdata(input_dev, ebeam);
> +
> + input_dev->open = ebeam_open;
> + input_dev->close = ebeam_close;
> +
> + /* usb urb setup */
> + if (usb_endpoint_type(endpoint) == USB_ENDPOINT_XFER_INT)
> + usb_fill_int_urb(ebeam->irq, udev,
> + usb_rcvintpipe(udev, endpoint->bEndpointAddress),
> + ebeam->data, REPT_SIZE,
> + ebeam_irq, ebeam, endpoint->bInterval);
> + else
> + usb_fill_bulk_urb(ebeam->irq, udev,
> + usb_rcvbulkpipe(udev, endpoint->bEndpointAddress),
> + ebeam->data, REPT_SIZE,
> + ebeam_irq, ebeam);
> +
> + ebeam->irq->dev = udev;
> + ebeam->irq->transfer_dma = ebeam->data_dma;
> + ebeam->irq->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
> +
> + /* input final setup */
> + ebeam_setup_input(ebeam, input_dev);
> +
> + err = input_register_device(ebeam->input);
> + if (err) {
> + dev_dbg(&intf->dev,
> + "%s - input_register_device failed, err: %d\n",
> + __func__, err);
> + goto out_free_urb;
> + }
> +
> + /* usb final setup */
> + usb_set_intfdata(intf, ebeam);
> +
> + /* sysfs setup */
> + err = sysfs_create_group(&intf->dev.kobj, &ebeam_attr_group);
> + if (err) {
> + dev_dbg(&intf->dev,
> + "%s - cannot create sysfs group, err: %d\n",
> + __func__, err);
> + goto out_unregister_input;
> + }
This is not nice. User space may react to a new input device of this
type by setting up the calibration. But the sysfs files may be created
after that. You should invert the order.
HTH
Oliver
^ permalink raw reply
* [PATCH v8 1/1] input: ideapad_slidebar: new input driver
From: Andrey Moiseev @ 2013-08-21 5:11 UTC (permalink / raw)
To: linux-input
Cc: dmitry.torokhov, arnoques, russianneuromancer, ike.pan,
linux-kernel
v8: added `extended = false;` line
ideapad_slidebar is a new driver which enables slidebars on some
Lenovo IdeaPad laptops (the slidebars work with SlideNav/Desktop
Navigator under Windows)
Fixes this: https://bugzilla.kernel.org/show_bug.cgi?id=16004
Registers 'IdeaPad Slidebar' input device and
/sys/devices/platform/ideapad_slidebar/slidebar_mode
for switching slidebar's modes.
Now works on:
IdeaPad Y550, Y550P.
May work on (testing and adding new models is needed):
Ideapad Y560, Y460, Y450, Y650,
and, probably, some others.
Driver source: https://github.com/o2genum/ideapad-slidebar.git
Patch is generated against current mainline kernel.
Signed-off-by: Andrey Moiseev <o2g.org.ru@gmail.com>
---
MAINTAINERS | 7 +
drivers/input/misc/Kconfig | 9 +
drivers/input/misc/Makefile | 1 +
drivers/input/misc/ideapad_slidebar.c | 332 ++++++++++++++++++++++++++++++++++
4 files changed, 349 insertions(+)
create mode 100644 drivers/input/misc/ideapad_slidebar.c
diff --git a/MAINTAINERS b/MAINTAINERS
index defc053..2ff3dd8 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4096,6 +4096,13 @@ W: http://launchpad.net/ideapad-laptop
S: Maintained
F: drivers/platform/x86/ideapad-laptop.c
+IDEAPAD LAPTOP SLIDEBAR DRIVER
+M: Andrey Moiseev <o2g.org.ru@gmail.com>
+L: linux-input@vger.kernel.org
+W: https://github.com/o2genum/ideapad-slidebar
+S: Maintained
+F: drivers/input/misc/ideapad_slidebar.c
+
IDE/ATAPI DRIVERS
M: Borislav Petkov <bp@alien8.de>
L: linux-ide@vger.kernel.org
diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
index 0b541cd..45729a9 100644
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
@@ -647,4 +647,13 @@ config INPUT_SIRFSOC_ONKEY
If unsure, say N.
+config INPUT_IDEAPAD_SLIDEBAR
+ tristate "IdeaPad Laptop Slidebar"
+ depends on INPUT
+ help
+ Input driver for slidebars on some Lenovo IdeaPad laptops.
+
+ If you have an IdeaPad laptop with a slidebar, say Y or M here.
+ Module name is ideapad_slidebar.
+
endif
diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile
index 829de43..0ebfb6d 100644
--- a/drivers/input/misc/Makefile
+++ b/drivers/input/misc/Makefile
@@ -61,3 +61,4 @@ obj-$(CONFIG_INPUT_WISTRON_BTNS) += wistron_btns.o
obj-$(CONFIG_INPUT_WM831X_ON) += wm831x-on.o
obj-$(CONFIG_INPUT_XEN_KBDDEV_FRONTEND) += xen-kbdfront.o
obj-$(CONFIG_INPUT_YEALINK) += yealink.o
+obj-$(CONFIG_INPUT_IDEAPAD_SLIDEBAR) += ideapad_slidebar.o
diff --git a/drivers/input/misc/ideapad_slidebar.c b/drivers/input/misc/ideapad_slidebar.c
new file mode 100644
index 0000000..1dc090d
--- /dev/null
+++ b/drivers/input/misc/ideapad_slidebar.c
@@ -0,0 +1,332 @@
+/*
+ * Input driver for slidebars on some Lenovo IdeaPad laptops
+ *
+ * Copyright (C) 2013 Andrey Moiseev <o2g.org.ru@gmail.com>
+ *
+ * Reverse-engineered from Lenovo SlideNav software (SBarHook.dll).
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * Trademarks are the property of their respective owners.
+ */
+
+/*
+ * Currently tested and works on:
+ * Lenovo IdeaPad Y550
+ * Lenovo IdeaPad Y550P
+ *
+ * Other models can be added easily. To test,
+ * load with 'force' parameter set 'true'.
+ *
+ * LEDs blinking and input mode are managed via sysfs,
+ * (hex, unsigned byte value):
+ * /sys/devices/platform/ideapad_slidebar/slidebar_mode
+ *
+ * The value is in byte range, however, I only figured out
+ * how bits 0b10011001 work. Some other bits, probably,
+ * are meaningfull too.
+ *
+ * Possible states:
+ *
+ * STD_INT, ONMOV_INT, OFF_INT, LAST_POLL, OFF_POLL
+ *
+ * Meaning:
+ * released touched
+ * STD 'heartbeat' lights follow the finger
+ * ONMOV no lights lights follow the finger
+ * LAST at last pos lights follow the finger
+ * OFF no lights no lights
+ *
+ * INT all input events are generated, interrupts are used
+ * POLL no input events by default, to get them,
+ * send 0b10000000 (read below)
+ *
+ * Commands: write
+ *
+ * All | 0b01001 -> STD_INT
+ * possible | 0b10001 -> ONMOV_INT
+ * states | 0b01000 -> OFF_INT
+ *
+ * | 0b0 -> LAST_POLL
+ * STD_INT or ONMOV_INT |
+ * | 0b1 -> STD_INT
+ *
+ * | 0b0 -> OFF_POLL
+ * OFF_INT or OFF_POLL |
+ * | 0b1 -> OFF_INT
+ *
+ * Any state | 0b10000000 -> if the slidebar has updated data,
+ * produce one input event (last position),
+ * switch to respective POLL mode
+ * (like 0x0), if not in POLL mode yet.
+ *
+ * Get current state: read
+ *
+ * masked by 0x11 read value means:
+ *
+ * 0x00 LAST
+ * 0x01 STD
+ * 0x10 OFF
+ * 0x11 ONMOV
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/dmi.h>
+#include <linux/spinlock.h>
+#include <linux/platform_device.h>
+#include <linux/input.h>
+#include <linux/io.h>
+#include <linux/ioport.h>
+#include <linux/i8042.h>
+
+static bool force;
+module_param(force, bool, 0);
+MODULE_PARM_DESC(force, "Force driver load, ignore DMI data");
+
+static DEFINE_SPINLOCK(io_lock);
+
+static struct input_dev *slidebar_input_dev;
+static struct platform_device *slidebar_platform_dev;
+
+static unsigned char slidebar_pos_get(void)
+{
+ int res;
+ unsigned long flags;
+
+ spin_lock_irqsave(&io_lock, flags);
+ outb(0xf4, 0xff29);
+ outb(0xbf, 0xff2a);
+ res = inb(0xff2b);
+ spin_unlock_irqrestore(&io_lock, flags);
+ return res;
+}
+
+static unsigned char slidebar_mode_get(void)
+{
+ int res;
+ unsigned long flags;
+
+ spin_lock_irqsave(&io_lock, flags);
+ outb(0xf7, 0xff29);
+ outb(0x8b, 0xff2a);
+ res = inb(0xff2b);
+ spin_unlock_irqrestore(&io_lock, flags);
+ return res;
+}
+
+static void slidebar_mode_set(unsigned char mode)
+{
+ unsigned long flags;
+
+ spin_lock_irqsave(&io_lock, flags);
+ outb(0xf7, 0xff29);
+ outb(0x8b, 0xff2a);
+ outb(mode, 0xff2b);
+ spin_unlock_irqrestore(&io_lock, flags);
+}
+
+static bool slidebar_i8042_filter(unsigned char data, unsigned char str,
+ struct serio *port)
+{
+ static bool extended = false;
+
+ /* Scancodes: e03b on move, e0bb on release */
+ if (unlikely(data == 0xe0)) {
+ extended = true;
+ return false;
+ } else if (unlikely(extended && (data == 0x3b))) {
+ extended = false;
+ input_report_key(slidebar_input_dev, BTN_TOUCH, 1);
+ input_report_abs(slidebar_input_dev, ABS_X, slidebar_pos_get());
+ input_sync(slidebar_input_dev);
+ return false;
+ } else if (unlikely(extended && (data == 0xbb))) {
+ extended = false;
+ input_report_key(slidebar_input_dev, BTN_TOUCH, 0);
+ input_sync(slidebar_input_dev);
+ return false;
+ }
+ return false;
+}
+
+static ssize_t show_slidebar_mode(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ return sprintf(buf, "%x\n", slidebar_mode_get());
+}
+
+static ssize_t store_slidebar_mode(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ int mode;
+
+ if (!count)
+ return 0;
+ if (sscanf(buf, "%x", &mode) != 1)
+ return -EINVAL;
+ slidebar_mode_set(mode);
+ return count;
+}
+
+static DEVICE_ATTR(slidebar_mode, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH,
+ show_slidebar_mode, store_slidebar_mode);
+
+static struct attribute *ideapad_attrs[] = {
+ &dev_attr_slidebar_mode.attr,
+ NULL
+};
+
+static struct attribute_group ideapad_attr_group = {
+ .attrs = ideapad_attrs
+};
+
+static const struct attribute_group *ideapad_attr_groups[] = {
+ &ideapad_attr_group,
+ NULL
+};
+
+static int probe(struct platform_device* dev)
+{
+ int err;
+
+ if (!request_region(0xff29, 3, "ideapad_slidebar")) {
+ pr_err("ideapad_slidebar: IO ports are busy\n");
+ return -EBUSY;
+ }
+
+ slidebar_input_dev = input_allocate_device();
+ if (!slidebar_input_dev) {
+ pr_err("ideapad_slidebar: Not enough memory\n");
+ err = -ENOMEM;
+ goto err_release_ports;
+ }
+
+ slidebar_input_dev->name = "IdeaPad Slidebar";
+ slidebar_input_dev->id.bustype = BUS_HOST;
+ slidebar_input_dev->dev.parent = &slidebar_platform_dev->dev;
+ input_set_capability(slidebar_input_dev, EV_KEY, BTN_TOUCH);
+ input_set_capability(slidebar_input_dev, EV_ABS, ABS_X);
+ input_set_abs_params(slidebar_input_dev, ABS_X, 0, 0xff, 0, 0);
+
+ err = i8042_install_filter(slidebar_i8042_filter);
+ if (err) {
+ pr_err("ideapad_slidebar: Can't install i8042 filter \n");
+ goto err_free_dev;
+ }
+
+ err = input_register_device(slidebar_input_dev);
+ if (err) {
+ pr_err("ideapad_slidebar: Failed to register input device\n");
+ goto err_remove_filter;
+ }
+ return 0;
+
+err_remove_filter:
+ i8042_remove_filter(slidebar_i8042_filter);
+err_free_dev:
+ input_free_device(slidebar_input_dev);
+err_release_ports:
+ release_region(0xff29, 3);
+ return err;
+}
+
+static int remove(struct platform_device *dev)
+{
+ i8042_remove_filter(slidebar_i8042_filter);
+ input_unregister_device(slidebar_input_dev);
+ release_region(0xff29, 3);
+ return 0;
+}
+
+static struct platform_driver slidebar_drv = {
+ .driver = {
+ .name = "ideapad_slidebar",
+ .owner = THIS_MODULE,
+ },
+ .probe = probe,
+ .remove = remove
+};
+
+static int __init ideapad_dmi_check(const struct dmi_system_id *id)
+{
+ pr_info("ideapad_slidebar: Laptop model '%s'\n", id->ident);
+ return 1;
+}
+
+static const struct dmi_system_id ideapad_dmi[] __initconst = {
+ {
+ .ident = "Lenovo IdeaPad Y550",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "20017"),
+ DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo IdeaPad Y550")
+ },
+ .callback = ideapad_dmi_check
+ },
+ {
+ .ident = "Lenovo IdeaPad Y550P",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "20035"),
+ DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo IdeaPad Y550P")
+ },
+ .callback = ideapad_dmi_check
+ },
+ { NULL, }
+};
+MODULE_DEVICE_TABLE(dmi, ideapad_dmi);
+
+static int __init slidebar_init(void)
+{
+ int err;
+
+ if (!force && !dmi_check_system(ideapad_dmi)) {
+ pr_err("ideapad_slidebar: DMI didn't match\n");
+ return -ENODEV;
+ }
+
+ err = platform_driver_register(&slidebar_drv);
+ if (err) {
+ pr_err("ideapad_slidebar: Failed to register platform driver\n");
+ return err;
+ }
+
+ slidebar_platform_dev = platform_device_alloc("ideapad_slidebar", -1);
+ slidebar_platform_dev->dev.groups = ideapad_attr_groups;
+ if (!slidebar_platform_dev) {
+ pr_err("ideapad_slidebar: Not enough memory\n");
+ goto err_unregister_drv;
+ }
+
+ err = platform_device_add(slidebar_platform_dev);
+ if (err) {
+ pr_err("ideapad_slidebar: Failed to register plarform device\n");
+ goto err_free_dev;
+ }
+ return 0;
+
+err_free_dev:
+ platform_device_put(slidebar_platform_dev);
+err_unregister_drv:
+ platform_driver_unregister(&slidebar_drv);
+ return err;
+}
+
+static void __exit slidebar_exit(void)
+{
+ platform_device_unregister(slidebar_platform_dev);
+ platform_driver_unregister(&slidebar_drv);
+}
+
+module_init(slidebar_init);
+module_exit(slidebar_exit);
+
+MODULE_AUTHOR("Andrey Moiseev <o2g.org.ru@gmail.com>");
+MODULE_DESCRIPTION("Slidebar input support for some Lenovo IdeaPad laptops");
+MODULE_LICENSE("GPL");
--
1.8.3.4
^ permalink raw reply related
* [PATCH] Input: wacom - add support for 0x300 and 0x301
From: Ping Cheng @ 2013-08-21 0:53 UTC (permalink / raw)
To: linux-input; +Cc: dmitry.torokhov, Ping Cheng
Tested-by: Arjuna Rao Chavala <arjunaraoc@gmail.com>
Signed-off-by: Ping Cheng <pingc@wacom.com>
---
drivers/input/tablet/wacom_wac.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 541197b..5e67cbf 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -2099,7 +2099,7 @@ static const struct wacom_features wacom_features_0xDA =
{ "Wacom Bamboo 2FG 4x5 SE", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
.touch_max = 2 };
-static struct wacom_features wacom_features_0xDB =
+static const struct wacom_features wacom_features_0xDB =
{ "Wacom Bamboo 2FG 6x8 SE", WACOM_PKGLEN_BBFUN, 21648, 13700, 1023,
31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
.touch_max = 2 };
@@ -2114,6 +2114,12 @@ static const struct wacom_features wacom_features_0xDF =
{ "Wacom Bamboo 16FG 6x8", WACOM_PKGLEN_BBPEN, 21648, 13700, 1023,
31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
.touch_max = 16 };
+static const struct wacom_features wacom_features_0x300 =
+ { "Wacom Bamboo One S", WACOM_PKGLEN_BBPEN, 14720, 9225, 1023,
+ 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
+static const struct wacom_features wacom_features_0x301 =
+ { "Wacom Bamboo One M", WACOM_PKGLEN_BBPEN, 21648, 13530, 1023,
+ 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
static const struct wacom_features wacom_features_0x6004 =
{ "ISD-V4", WACOM_PKGLEN_GRAPHIRE, 12800, 8000, 255,
0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
@@ -2240,6 +2246,8 @@ const struct usb_device_id wacom_ids[] = {
{ USB_DEVICE_WACOM(0x100) },
{ USB_DEVICE_WACOM(0x101) },
{ USB_DEVICE_WACOM(0x10D) },
+ { USB_DEVICE_WACOM(0x300) },
+ { USB_DEVICE_WACOM(0x301) },
{ USB_DEVICE_WACOM(0x304) },
{ USB_DEVICE_WACOM(0x4001) },
{ USB_DEVICE_WACOM(0x47) },
--
1.8.1.2
^ permalink raw reply related
* Re: Re: [PATCH 35/36] hid: roccat: convert class code to use bin_attrs in groups
From: Greg KH @ 2013-08-20 23:58 UTC (permalink / raw)
To: screamingfist; +Cc: erazor_de, jkosina, linux-input, linux-kernel
In-Reply-To: <855534750.937448.1376976526543.JavaMail.ngmail@webmail11.arcor-online.net>
On Tue, Aug 20, 2013 at 07:28:46AM +0200, screamingfist@arcor.de wrote:
> ----- Original Nachricht ----
> Von: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> An: Stefan Achatz <erazor_de@users.sourceforge.net>
> Datum: 15.08.2013 18:40
> Betreff: Re: [PATCH 35/36] hid: roccat: convert class code to use bin_attrs
> in groups
>
> > On Thu, Aug 15, 2013 at 06:03:46PM +0200, Stefan Achatz wrote:
> > > Hello Greg,
> > > looking through the patch I found the following:
> > >
> > >
> > >
> > > In hid-roccat-kone.c, PROFILE_ATTR macro:
> > > The line
> > > .private = &profile_numbers[number],
> > > should read
> > > .private = &profile_numbers[number-1],
> >
> > Ah, ok, thanks, will fix up.
> >
> > > Regarding the compiler warning about unused pyra_sysfs_write_settings:
> > > The attribute is indeed readwrite, but the code to write is not standard
> > > code. The read function was created with the PYRA_SYSFS_R macro and the
> > > write function was written manually. Used were both by
> > > PYRA_BIN_ATTRIBUTE_RW.
> > > In this case I would keep the PYRA_SYSFS_* macros standalone so that the
> > > calling code looks like this:
> > >
> > > PYRA_SYSFS_W(control, CONTROL);
> > > PYRA_SYSFS_RW(info, INFO);
> > > PYRA_SYSFS_RW(profile_settings, PROFILE_SETTINGS);
> > > PYRA_SYSFS_RW(profile_buttons, PROFILE_BUTTONS);
> > > PYRA_SYSFS_R(settings, SETTINGS);
> > >
> > > PYRA_BIN_ATTRIBUTE_W(control, CONTROL);
> > > PYRA_BIN_ATTRIBUTE_RW(info, INFO);
> > > PYRA_BIN_ATTRIBUTE_RW(profile_settings, PROFILE_SETTINGS);
> > > PYRA_BIN_ATTRIBUTE_RW(profile_buttons, PROFILE_BUTTONS);
> > > PYRA_BIN_ATTRIBUTE_RW(settings, SETTINGS);
> >
> > Hm, I'll look this over again and see if I can make it better.
> >
> > But why are you using a "non standard" write function? What is special
> > here about this?
>
> The module stores the written value, so that events from the device can be
> written to chardev with this extra information.
> I made the mistake to put too many functionality in the early kernel modules
> and I'm not getting fully rid of it now.
Ok, I've fixed this up now, so it all good, thanks for reviewing this.
greg k-h
^ permalink raw reply
* Re: [PATCH] mc13xxx-ts: use zero as default value if no pdata was defined
From: Dmitry Torokhov @ 2013-08-20 20:06 UTC (permalink / raw)
To: Michael Grzeschik
Cc: Samuel Ortiz, Michael Grzeschik, linux-input, linux-kernel,
kernel
In-Reply-To: <20130820093432.GC26693@pengutronix.de>
On Tue, Aug 20, 2013 at 11:34:32AM +0200, Michael Grzeschik wrote:
> On Tue, Aug 20, 2013 at 03:34:33AM +0200, Samuel Ortiz wrote:
> > Hi Michael,
> >
> > On Tue, Aug 13, 2013 at 02:14:30PM +0200, Michael Grzeschik wrote:
> > > In case of devicetree, we currently don't have a way to append pdata for
> > > the touchscreen. The current approach is to bail out in that case.
> > > This patch makes it possible to probe the touchscreen without pdata
> > > and use zero as default values for the atox and ato adc conversion.
> > Would that still make the touchscreen somehow functional ?
>
> Yes, it still works. It just defaults to zero values in no pdata case.
>
> > If that's the case, and if Dmitry is fine with the ts part of this
> > patch, could you please separate the mfd part of this patch into a
> > separate one ?
>
> Why?
>
> The purpose of this patch is to have both cases working, pdata and no
> pdata.
My concern with allowing defaults with missing pdata or device tree data
is that it makes it easy for the integrator to miss the necessity of the
parameters and then start piling on driver workarounds. I have seen a
few examples of this happening, so I'd rather prefer an explicit values
if possible.
Thanks.
--
Dmitry
^ permalink raw reply
* Re: [PATCH v7 1/1] input: ideapad_slidebar: new input driver
From: Dmitry Torokhov @ 2013-08-20 19:45 UTC (permalink / raw)
To: Andrey Moiseev
Cc: linux-input, arnoques, russianneuromancer, ike.pan, linux-kernel
In-Reply-To: <520DCDA5.8090001@gmail.com>
Hi Andrey,
On Fri, Aug 16, 2013 at 10:58:45AM +0400, Andrey Moiseev wrote:
> v7: fixed things addressed by Dmitry Torokhov to v7 (quoted message goes below the patch)
>
This looks almost perfect, I have just one question:
> +static bool slidebar_i8042_filter(unsigned char data, unsigned char str,
> + struct serio *port)
> +{
> + static bool extended = false;
> +
> + /* Scancodes: e03b on move, e0bb on release */
> + if (unlikely(data == 0xe0)) {
> + extended = true;
> + return false;
> + } else if (unlikely(extended && (data == 0x3b))) {
> + extended = false;
> + input_report_key(slidebar_input_dev, BTN_TOUCH, 1);
> + input_report_abs(slidebar_input_dev, ABS_X, slidebar_pos_get());
> + input_sync(slidebar_input_dev);
> + return false;
> + } else if (unlikely(extended && (data == 0xbb))) {
> + input_report_key(slidebar_input_dev, BTN_TOUCH, 0);
> + input_sync(slidebar_input_dev);
Don't you need to reset 'extended" here as well?
--
Dmitry
^ permalink raw reply
* Re: [PATCH 4/4] iio: ti_am335x_adc: Add continuous sampling and trigger support
From: Zubair Lutfullah : @ 2013-08-20 16:26 UTC (permalink / raw)
To: Sebastian Andrzej Siewior
Cc: Zubair Lutfullah, jic23-KWPb1pKIrIJaa/9Udqfwiw,
dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w,
linux-iio-u79uwXL29TY76Z2rM5mHXA,
linux-input-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r, Russ.Dill-l0cyMroinI0
In-Reply-To: <20130819171238.GA31610-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
On Mon, Aug 19, 2013 at 07:12:38PM +0200, Sebastian Andrzej Siewior wrote:
> * Zubair Lutfullah | 2013-08-13 21:05:03 [+0100]:
>
> >diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c
> >index 3ceac3e..0d7e313 100644
> >--- a/drivers/iio/adc/ti_am335x_adc.c
> >+++ b/drivers/iio/adc/ti_am335x_adc.c
> …
> >+static irqreturn_t tiadc_irq(int irq, void *private)
> >+{
> …
> >+ wake_up_interruptible(&adc_dev->wq_data_avail);
> …
> >+}
> …
> >+static irqreturn_t tiadc_trigger_h(int irq, void *p)
> >+{
> …
> >+ schedule_work(&adc_dev->poll_work);
> …
> >+}
> …
> >+static void tiadc_adc_work(struct work_struct *work_s)
> >+{
> …
> >+ wait_event_interruptible(adc_dev->wq_data_avail,
> >+ (adc_dev->data_avail == 1));
> …
> >+}
>
> This is not very nice. The problem is that you might sleep in a
> workqueue and so the other jobs will wait until you are done. I'm think
This will change to a different style.
> I'm looking into DMA support for this so once your code is working it
> should be possible to switch to DMA instead reading byte wise from the
> fifo.
Great.
> How did you test the whole thing? Do you have a test program which
> selects a few sources and reads them in continuous mode?
>
generic_buffer.c runs for this for sysfs trigger..
However. If you follow the other thread.
This is obsolete and trigger style is changing to a driver trigger.
I'll update when I'm done.
Thanks
ZubairLK
^ permalink raw reply
* Re: [PATCH v2 1/2] input: document gamepad API and add extra keycodes
From: David Herrmann @ 2013-08-20 10:37 UTC (permalink / raw)
To: Jiri Kosina; +Cc: Dmitry Torokhov, open list:HID CORE LAYER, linux-kernel
In-Reply-To: <alpine.LNX.2.00.1308201232170.21654@pobox.suse.cz>
Hi
On Tue, Aug 20, 2013 at 12:32 PM, Jiri Kosina <jkosina@suse.cz> wrote:
> On Fri, 16 Aug 2013, David Herrmann wrote:
>
>> Hm, I just noticed that this got merged without the
>> Documentation/input/gamepad.txt description. Was this intentional?
>> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=d09bbfd2a8408a995419dff0d2ba906013cf4cc9
>
> My git-fu horribly failed in this case, sorry for that. Now queued, thanks
> a lot for noticing.
Took me 2 month noticing ;) Thanks for picking it up.
Regards
David
^ permalink raw reply
* Re: [PATCH v2 1/2] input: document gamepad API and add extra keycodes
From: Jiri Kosina @ 2013-08-20 10:32 UTC (permalink / raw)
To: David Herrmann; +Cc: Dmitry Torokhov, open list:HID CORE LAYER, linux-kernel
In-Reply-To: <CANq1E4SxGTKoL+OXDaYN5S1x-GXbg7ym+e8ivCywe2FMqQgCvg@mail.gmail.com>
On Fri, 16 Aug 2013, David Herrmann wrote:
> Hm, I just noticed that this got merged without the
> Documentation/input/gamepad.txt description. Was this intentional?
> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=d09bbfd2a8408a995419dff0d2ba906013cf4cc9
My git-fu horribly failed in this case, sorry for that. Now queued, thanks
a lot for noticing.
--
Jiri Kosina
SUSE Labs
^ permalink raw reply
* Re: [PATCH] mc13xxx-ts: use zero as default value if no pdata was defined
From: Michael Grzeschik @ 2013-08-20 9:53 UTC (permalink / raw)
To: Samuel Ortiz
Cc: Michael Grzeschik, linux-input, linux-kernel, kernel,
Dmitry Torokhov, Lee Jones
In-Reply-To: <20130820095048.GC17521@zurbaran>
On Tue, Aug 20, 2013 at 11:50:48AM +0200, Samuel Ortiz wrote:
> Hi Michael,
>
> On Tue, Aug 20, 2013 at 11:34:32AM +0200, Michael Grzeschik wrote:
> > On Tue, Aug 20, 2013 at 03:34:33AM +0200, Samuel Ortiz wrote:
> > > On Tue, Aug 13, 2013 at 02:14:30PM +0200, Michael Grzeschik wrote:
> > > > In case of devicetree, we currently don't have a way to append pdata for
> > > > the touchscreen. The current approach is to bail out in that case.
> > > > This patch makes it possible to probe the touchscreen without pdata
> > > > and use zero as default values for the atox and ato adc conversion.
> > > Would that still make the touchscreen somehow functional ?
> >
> > Yes, it still works. It just defaults to zero values in no pdata case.
> >
> > > If that's the case, and if Dmitry is fine with the ts part of this
> > > patch, could you please separate the mfd part of this patch into a
> > > separate one ?
> >
> > Why?
> To avoid cross tree commits as much as possible.
>
>
> > The purpose of this patch is to have both cases working, pdata and no
> > pdata.
> I understood that part. But you can still split the patch in 2 as the ts
> driver will not be probed without pdata until the mfd patch is merged
> upstream.
>
> > This patch is actually fixing the patch of Michael Thalmeier.
> > There we changed the mfd and touch in one patch as well.
> There was a build time dependency between the ts driver and the MFD
> changes, so the patch had to be merged atomically.
> That is not the case with your patch.
All right then. I will resend them and the codec mfd patch together with
the oftree patches I am currently working on.
Thanks,
Michael
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply
* Re: [PATCH] mc13xxx-ts: use zero as default value if no pdata was defined
From: Samuel Ortiz @ 2013-08-20 9:50 UTC (permalink / raw)
To: Michael Grzeschik
Cc: Michael Grzeschik, linux-input, linux-kernel, kernel,
Dmitry Torokhov, Lee Jones
In-Reply-To: <20130820093432.GC26693@pengutronix.de>
Hi Michael,
On Tue, Aug 20, 2013 at 11:34:32AM +0200, Michael Grzeschik wrote:
> On Tue, Aug 20, 2013 at 03:34:33AM +0200, Samuel Ortiz wrote:
> > On Tue, Aug 13, 2013 at 02:14:30PM +0200, Michael Grzeschik wrote:
> > > In case of devicetree, we currently don't have a way to append pdata for
> > > the touchscreen. The current approach is to bail out in that case.
> > > This patch makes it possible to probe the touchscreen without pdata
> > > and use zero as default values for the atox and ato adc conversion.
> > Would that still make the touchscreen somehow functional ?
>
> Yes, it still works. It just defaults to zero values in no pdata case.
>
> > If that's the case, and if Dmitry is fine with the ts part of this
> > patch, could you please separate the mfd part of this patch into a
> > separate one ?
>
> Why?
To avoid cross tree commits as much as possible.
> The purpose of this patch is to have both cases working, pdata and no
> pdata.
I understood that part. But you can still split the patch in 2 as the ts
driver will not be probed without pdata until the mfd patch is merged
upstream.
> This patch is actually fixing the patch of Michael Thalmeier.
> There we changed the mfd and touch in one patch as well.
There was a build time dependency between the ts driver and the MFD
changes, so the patch had to be merged atomically.
That is not the case with your patch.
Cheers,
Samuel.
--
Intel Open Source Technology Centre
http://oss.intel.com/
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox