linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: cap1106 - allow changing key mapping from userspace
@ 2014-07-21  1:20 Dmitry Torokhov
  2014-08-07  6:20 ` Dmitry Torokhov
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Torokhov @ 2014-07-21  1:20 UTC (permalink / raw)
  To: Daniel Mack; +Cc: linux-input, linux-kernel

Wire up support for EVIOC{G|S}KEYCODE to allow users change key mappings
from userspace.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---

Just compiled, not tested.

 drivers/input/keyboard/cap1106.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/input/keyboard/cap1106.c b/drivers/input/keyboard/cap1106.c
index f7d7a0d..180b184 100644
--- a/drivers/input/keyboard/cap1106.c
+++ b/drivers/input/keyboard/cap1106.c
@@ -64,7 +64,7 @@ struct cap1106_priv {
 	struct input_dev *idev;
 
 	/* config */
-	unsigned int keycodes[CAP1106_NUM_CHN];
+	unsigned short keycodes[CAP1106_NUM_CHN];
 };
 
 static const struct reg_default cap1106_reg_defaults[] = {
@@ -272,6 +272,12 @@ static int cap1106_i2c_probe(struct i2c_client *i2c_client,
 	for (i = 0; i < CAP1106_NUM_CHN; i++)
 		__set_bit(priv->keycodes[i], priv->idev->keybit);
 
+	__clear_bit(KEY_RESERVED, priv->idev->keybit);
+
+	priv->idev->keycode = priv->keycodes;
+	priv->idev->keycodesize = sizeof(priv->keycodes[0]);
+	priv->idev->keycodemax = ARRAY_SIZE(priv->keycodes);
+
 	priv->idev->id.vendor = CAP1106_MANUFACTURER_ID;
 	priv->idev->id.product = CAP1106_PRODUCT_ID;
 	priv->idev->id.version = rev;
-- 
2.0.0.526.g5318336


-- 
Dmitry

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] Input: cap1106 - allow changing key mapping from userspace
  2014-07-21  1:20 [PATCH] Input: cap1106 - allow changing key mapping from userspace Dmitry Torokhov
@ 2014-08-07  6:20 ` Dmitry Torokhov
  2014-08-07  6:50   ` Daniel Mack
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Torokhov @ 2014-08-07  6:20 UTC (permalink / raw)
  To: Daniel Mack; +Cc: linux-input, linux-kernel

On Sun, Jul 20, 2014 at 06:20:49PM -0700, Dmitry Torokhov wrote:
> Wire up support for EVIOC{G|S}KEYCODE to allow users change key mappings
> from userspace.
> 
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---
> 
> Just compiled, not tested.

*ping* Any chance you could give it a try? Thanks!

> 
>  drivers/input/keyboard/cap1106.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/input/keyboard/cap1106.c b/drivers/input/keyboard/cap1106.c
> index f7d7a0d..180b184 100644
> --- a/drivers/input/keyboard/cap1106.c
> +++ b/drivers/input/keyboard/cap1106.c
> @@ -64,7 +64,7 @@ struct cap1106_priv {
>  	struct input_dev *idev;
>  
>  	/* config */
> -	unsigned int keycodes[CAP1106_NUM_CHN];
> +	unsigned short keycodes[CAP1106_NUM_CHN];
>  };
>  
>  static const struct reg_default cap1106_reg_defaults[] = {
> @@ -272,6 +272,12 @@ static int cap1106_i2c_probe(struct i2c_client *i2c_client,
>  	for (i = 0; i < CAP1106_NUM_CHN; i++)
>  		__set_bit(priv->keycodes[i], priv->idev->keybit);
>  
> +	__clear_bit(KEY_RESERVED, priv->idev->keybit);
> +
> +	priv->idev->keycode = priv->keycodes;
> +	priv->idev->keycodesize = sizeof(priv->keycodes[0]);
> +	priv->idev->keycodemax = ARRAY_SIZE(priv->keycodes);
> +
>  	priv->idev->id.vendor = CAP1106_MANUFACTURER_ID;
>  	priv->idev->id.product = CAP1106_PRODUCT_ID;
>  	priv->idev->id.version = rev;
> -- 
> 2.0.0.526.g5318336
> 
> 
> -- 
> Dmitry

-- 
Dmitry

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Input: cap1106 - allow changing key mapping from userspace
  2014-08-07  6:20 ` Dmitry Torokhov
@ 2014-08-07  6:50   ` Daniel Mack
  2014-08-08  6:50     ` Dmitry Torokhov
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Mack @ 2014-08-07  6:50 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-kernel

Hi Dmitry,

On 08/07/2014 08:20 AM, Dmitry Torokhov wrote:
> On Sun, Jul 20, 2014 at 06:20:49PM -0700, Dmitry Torokhov wrote:
>> Wire up support for EVIOC{G|S}KEYCODE to allow users change key mappings
>> from userspace.
>>
>> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
>> ---
>>
>> Just compiled, not tested.
> 
> *ping* Any chance you could give it a try? Thanks!

Oh, sorry, I didn't realize you're waiting for me on this.

Unfortunately, I can't test it myself anymore, as I had to return the
board I found this chip on. But as the change looks very straight
forward, I'd suggest you just apply that patch and I ask the vendor to
give it a quick try. In case of any problems, I'll let you know. Does
that sound feasible?


Thanks,
Daniel


> 
>>
>>  drivers/input/keyboard/cap1106.c | 8 +++++++-
>>  1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/input/keyboard/cap1106.c b/drivers/input/keyboard/cap1106.c
>> index f7d7a0d..180b184 100644
>> --- a/drivers/input/keyboard/cap1106.c
>> +++ b/drivers/input/keyboard/cap1106.c
>> @@ -64,7 +64,7 @@ struct cap1106_priv {
>>  	struct input_dev *idev;
>>  
>>  	/* config */
>> -	unsigned int keycodes[CAP1106_NUM_CHN];
>> +	unsigned short keycodes[CAP1106_NUM_CHN];
>>  };
>>  
>>  static const struct reg_default cap1106_reg_defaults[] = {
>> @@ -272,6 +272,12 @@ static int cap1106_i2c_probe(struct i2c_client *i2c_client,
>>  	for (i = 0; i < CAP1106_NUM_CHN; i++)
>>  		__set_bit(priv->keycodes[i], priv->idev->keybit);
>>  
>> +	__clear_bit(KEY_RESERVED, priv->idev->keybit);
>> +
>> +	priv->idev->keycode = priv->keycodes;
>> +	priv->idev->keycodesize = sizeof(priv->keycodes[0]);
>> +	priv->idev->keycodemax = ARRAY_SIZE(priv->keycodes);
>> +
>>  	priv->idev->id.vendor = CAP1106_MANUFACTURER_ID;
>>  	priv->idev->id.product = CAP1106_PRODUCT_ID;
>>  	priv->idev->id.version = rev;
>> -- 
>> 2.0.0.526.g5318336
>>
>>
>> -- 
>> Dmitry
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Input: cap1106 - allow changing key mapping from userspace
  2014-08-07  6:50   ` Daniel Mack
@ 2014-08-08  6:50     ` Dmitry Torokhov
  2014-08-08 10:27       ` Daniel Mack
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Torokhov @ 2014-08-08  6:50 UTC (permalink / raw)
  To: Daniel Mack; +Cc: linux-input, linux-kernel

On Thu, Aug 07, 2014 at 08:50:24AM +0200, Daniel Mack wrote:
> Hi Dmitry,
> 
> On 08/07/2014 08:20 AM, Dmitry Torokhov wrote:
> > On Sun, Jul 20, 2014 at 06:20:49PM -0700, Dmitry Torokhov wrote:
> >> Wire up support for EVIOC{G|S}KEYCODE to allow users change key mappings
> >> from userspace.
> >>
> >> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> >> ---
> >>
> >> Just compiled, not tested.
> > 
> > *ping* Any chance you could give it a try? Thanks!
> 
> Oh, sorry, I didn't realize you're waiting for me on this.
> 
> Unfortunately, I can't test it myself anymore, as I had to return the
> board I found this chip on. But as the change looks very straight
> forward, I'd suggest you just apply that patch and I ask the vendor to
> give it a quick try. In case of any problems, I'll let you know. Does
> that sound feasible?

OK, I'll put you down as reviewed-by then so we can share the glory (and the
blame ;))

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Input: cap1106 - allow changing key mapping from userspace
  2014-08-08  6:50     ` Dmitry Torokhov
@ 2014-08-08 10:27       ` Daniel Mack
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Mack @ 2014-08-08 10:27 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-kernel

On 08/08/2014 08:50 AM, Dmitry Torokhov wrote:
> On Thu, Aug 07, 2014 at 08:50:24AM +0200, Daniel Mack wrote:
>> Hi Dmitry,
>>
>> On 08/07/2014 08:20 AM, Dmitry Torokhov wrote:
>>> On Sun, Jul 20, 2014 at 06:20:49PM -0700, Dmitry Torokhov wrote:
>>>> Wire up support for EVIOC{G|S}KEYCODE to allow users change key mappings
>>>> from userspace.
>>>>
>>>> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
>>>> ---
>>>>
>>>> Just compiled, not tested.
>>>
>>> *ping* Any chance you could give it a try? Thanks!
>>
>> Oh, sorry, I didn't realize you're waiting for me on this.
>>
>> Unfortunately, I can't test it myself anymore, as I had to return the
>> board I found this chip on. But as the change looks very straight
>> forward, I'd suggest you just apply that patch and I ask the vendor to
>> give it a quick try. In case of any problems, I'll let you know. Does
>> that sound feasible?
> 
> OK, I'll put you down as reviewed-by then so we can share the glory (and the
> blame ;))

Alright, thanks :)


Thanks,
Daniel


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-08-08 10:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-21  1:20 [PATCH] Input: cap1106 - allow changing key mapping from userspace Dmitry Torokhov
2014-08-07  6:20 ` Dmitry Torokhov
2014-08-07  6:50   ` Daniel Mack
2014-08-08  6:50     ` Dmitry Torokhov
2014-08-08 10:27       ` Daniel Mack

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).