All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/5] HID: Added further information for Roccat Kone
@ 2010-05-18 16:26 ` Stefan Achatz
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Achatz @ 2010-05-18 16:26 UTC (permalink / raw)
  To: Jiri Kosina, Stephane Chatty, wylda, Jussi Kivilinna, Tejun Heo,
	linux-input, Jerome Vidal, linux-kernel, Stefan Achatz

>From 0875b1fdc784c60d28d3c5bc02ffcf0f30ccea2c Mon Sep 17 00:00:00 2001
From: Stefan Achatz <erazor_de@users.sourceforge.net>
Date: Sat, 8 May 2010 16:53:31 +0200
Subject: [PATCH 2/5] HID: Added further information for Roccat Kone

Added new data and changed workaround for abnormal button behaviour
according to new gained knowledge about Roccat Kone device.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
---
 drivers/hid/hid-roccat-kone.c |   11 ++++++-----
 drivers/hid/hid-roccat-kone.h |   19 ++++++++++++++++---
 2 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/drivers/hid/hid-roccat-kone.c b/drivers/hid/hid-roccat-kone.c
index d23d309..9d68442 100644
--- a/drivers/hid/hid-roccat-kone.c
+++ b/drivers/hid/hid-roccat-kone.c
@@ -928,14 +928,15 @@ static int kone_raw_event(struct hid_device *hdev, struct hid_report *report,
 		return 0;
 
 	/*
-	 * Firmware 1.38 introduced new behaviour for tilt buttons.
-	 * Pressed tilt button is reported in each movement event.
+	 * Firmware 1.38 introduced new behaviour for tilt and special buttons.
+	 * Pressed button is reported in each movement event.
 	 * Workaround sends only one event per press.
 	 */
-	if (kone->last_tilt_state == event->tilt)
-		event->tilt = 0;
+	if (memcmp(&kone->last_mouse_event.tilt, &event->tilt, 5))
+		memcpy(&kone->last_mouse_event, event,
+				sizeof(struct kone_mouse_event));
 	else
-		kone->last_tilt_state = event->tilt;
+		memset(&event->tilt, 0, 5);
 
 	/*
 	 * handle special events and keep actual profile and dpi values
diff --git a/drivers/hid/hid-roccat-kone.h b/drivers/hid/hid-roccat-kone.h
index 99290ad..b413b10 100644
--- a/drivers/hid/hid-roccat-kone.h
+++ b/drivers/hid/hid-roccat-kone.h
@@ -80,6 +80,17 @@ enum kone_button_info_types {
 	kone_button_info_type_multimedia_volume_down = 0x27
 };
 
+enum kone_button_info_numbers {
+	kone_button_top = 1,
+	kone_button_wheel_tilt_left = 2,
+	kone_button_wheel_tilt_right = 3,
+	kone_button_forward = 4,
+	kone_button_backward = 5,
+	kone_button_middle = 6,
+	kone_button_plus = 7,
+	kone_button_minus = 8,
+};
+
 struct kone_light_info {
 	uint8_t number; /* number of light 1-5 */
 	uint8_t mod;   /* 1 = on, 2 = off */
@@ -117,6 +128,7 @@ struct kone_profile {
 	uint8_t light_effect_speed; /* range 0-255 */
 
 	struct kone_light_info light_infos[5];
+	/* offset is kone_button_info_numbers - 1 */
 	struct kone_button_info button_infos[8];
 
 	uint16_t checksum; /* \brief holds checksum of struct */
@@ -162,7 +174,7 @@ enum kone_mouse_events {
 	/* TODO clarify meaning and occurence of kone_mouse_event_calibration */
 	kone_mouse_event_calibration = 0xc0,
 	kone_mouse_event_call_overlong_macro = 0xe0,
-	/* switch events notify if user changed values wiht mousebutton click */
+	/* switch events notify if user changed values with mousebutton click */
 	kone_mouse_event_switch_dpi = 0xf0,
 	kone_mouse_event_switch_profile = 0xf1
 };
@@ -185,8 +197,9 @@ struct kone_device {
 	 * is no way of getting this information from the device on demand
 	 */
 	int actual_profile, actual_dpi;
-	/* Used for neutralizing abnormal tilt button behaviour */
-	int last_tilt_state;
+	/* Used for neutralizing abnormal button behaviour */
+	struct kone_mouse_event last_mouse_event;
+
 	/*
 	 * It's unlikely that multiple sysfs attributes are accessed at a time,
 	 * so only one mutex is used to secure hardware access and profiles and
-- 
1.6.6.1




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

* [PATCH 2/5] HID: Added further information for Roccat Kone
@ 2010-05-18 16:26 ` Stefan Achatz
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Achatz @ 2010-05-18 16:26 UTC (permalink / raw)
  To: Jiri Kosina, Stephane Chatty, wylda, Jussi Kivilinna, Tejun Heo,
	linux-input, Je

>From 0875b1fdc784c60d28d3c5bc02ffcf0f30ccea2c Mon Sep 17 00:00:00 2001
From: Stefan Achatz <erazor_de@users.sourceforge.net>
Date: Sat, 8 May 2010 16:53:31 +0200
Subject: [PATCH 2/5] HID: Added further information for Roccat Kone

Added new data and changed workaround for abnormal button behaviour
according to new gained knowledge about Roccat Kone device.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
---
 drivers/hid/hid-roccat-kone.c |   11 ++++++-----
 drivers/hid/hid-roccat-kone.h |   19 ++++++++++++++++---
 2 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/drivers/hid/hid-roccat-kone.c b/drivers/hid/hid-roccat-kone.c
index d23d309..9d68442 100644
--- a/drivers/hid/hid-roccat-kone.c
+++ b/drivers/hid/hid-roccat-kone.c
@@ -928,14 +928,15 @@ static int kone_raw_event(struct hid_device *hdev, struct hid_report *report,
 		return 0;
 
 	/*
-	 * Firmware 1.38 introduced new behaviour for tilt buttons.
-	 * Pressed tilt button is reported in each movement event.
+	 * Firmware 1.38 introduced new behaviour for tilt and special buttons.
+	 * Pressed button is reported in each movement event.
 	 * Workaround sends only one event per press.
 	 */
-	if (kone->last_tilt_state == event->tilt)
-		event->tilt = 0;
+	if (memcmp(&kone->last_mouse_event.tilt, &event->tilt, 5))
+		memcpy(&kone->last_mouse_event, event,
+				sizeof(struct kone_mouse_event));
 	else
-		kone->last_tilt_state = event->tilt;
+		memset(&event->tilt, 0, 5);
 
 	/*
 	 * handle special events and keep actual profile and dpi values
diff --git a/drivers/hid/hid-roccat-kone.h b/drivers/hid/hid-roccat-kone.h
index 99290ad..b413b10 100644
--- a/drivers/hid/hid-roccat-kone.h
+++ b/drivers/hid/hid-roccat-kone.h
@@ -80,6 +80,17 @@ enum kone_button_info_types {
 	kone_button_info_type_multimedia_volume_down = 0x27
 };
 
+enum kone_button_info_numbers {
+	kone_button_top = 1,
+	kone_button_wheel_tilt_left = 2,
+	kone_button_wheel_tilt_right = 3,
+	kone_button_forward = 4,
+	kone_button_backward = 5,
+	kone_button_middle = 6,
+	kone_button_plus = 7,
+	kone_button_minus = 8,
+};
+
 struct kone_light_info {
 	uint8_t number; /* number of light 1-5 */
 	uint8_t mod;   /* 1 = on, 2 = off */
@@ -117,6 +128,7 @@ struct kone_profile {
 	uint8_t light_effect_speed; /* range 0-255 */
 
 	struct kone_light_info light_infos[5];
+	/* offset is kone_button_info_numbers - 1 */
 	struct kone_button_info button_infos[8];
 
 	uint16_t checksum; /* \brief holds checksum of struct */
@@ -162,7 +174,7 @@ enum kone_mouse_events {
 	/* TODO clarify meaning and occurence of kone_mouse_event_calibration */
 	kone_mouse_event_calibration = 0xc0,
 	kone_mouse_event_call_overlong_macro = 0xe0,
-	/* switch events notify if user changed values wiht mousebutton click */
+	/* switch events notify if user changed values with mousebutton click */
 	kone_mouse_event_switch_dpi = 0xf0,
 	kone_mouse_event_switch_profile = 0xf1
 };
@@ -185,8 +197,9 @@ struct kone_device {
 	 * is no way of getting this information from the device on demand
 	 */
 	int actual_profile, actual_dpi;
-	/* Used for neutralizing abnormal tilt button behaviour */
-	int last_tilt_state;
+	/* Used for neutralizing abnormal button behaviour */
+	struct kone_mouse_event last_mouse_event;
+
 	/*
 	 * It's unlikely that multiple sysfs attributes are accessed at a time,
 	 * so only one mutex is used to secure hardware access and profiles and
-- 
1.6.6.1




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

* Re: [PATCH 2/5] HID: Added further information for Roccat Kone
  2010-05-18 16:26 ` Stefan Achatz
  (?)
@ 2010-05-19 11:53 ` Jiri Kosina
  -1 siblings, 0 replies; 6+ messages in thread
From: Jiri Kosina @ 2010-05-19 11:53 UTC (permalink / raw)
  To: Stefan Achatz
  Cc: Stephane Chatty, wylda, Jussi Kivilinna, Tejun Heo, linux-input,
	Jerome Vidal, linux-kernel

On Tue, 18 May 2010, Stefan Achatz wrote:

> >From 0875b1fdc784c60d28d3c5bc02ffcf0f30ccea2c Mon Sep 17 00:00:00 2001
> From: Stefan Achatz <erazor_de@users.sourceforge.net>
> Date: Sat, 8 May 2010 16:53:31 +0200
> Subject: [PATCH 2/5] HID: Added further information for Roccat Kone
> 
> Added new data and changed workaround for abnormal button behaviour
> according to new gained knowledge about Roccat Kone device.
> 
> Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
> ---
>  drivers/hid/hid-roccat-kone.c |   11 ++++++-----
>  drivers/hid/hid-roccat-kone.h |   19 ++++++++++++++++---
>  2 files changed, 22 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/hid/hid-roccat-kone.c b/drivers/hid/hid-roccat-kone.c
> index d23d309..9d68442 100644
> --- a/drivers/hid/hid-roccat-kone.c
> +++ b/drivers/hid/hid-roccat-kone.c
> @@ -928,14 +928,15 @@ static int kone_raw_event(struct hid_device *hdev, struct hid_report *report,
>  		return 0;
>  
>  	/*
> -	 * Firmware 1.38 introduced new behaviour for tilt buttons.
> -	 * Pressed tilt button is reported in each movement event.
> +	 * Firmware 1.38 introduced new behaviour for tilt and special buttons.
> +	 * Pressed button is reported in each movement event.
>  	 * Workaround sends only one event per press.

Applied, thank you Stefan.

-- 
Jiri Kosina
SUSE Labs, Novell Inc.

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

* Re: [PATCH 2/5] HID: Added further information for Roccat Kone
  2010-05-12 15:43 Stefan Achatz
@ 2010-05-18 12:03 ` Jiri Kosina
  0 siblings, 0 replies; 6+ messages in thread
From: Jiri Kosina @ 2010-05-18 12:03 UTC (permalink / raw)
  To: Stefan Achatz
  Cc: Stephane Chatty, Jussi Kivilinna, wylda, Jerome Vidal, Tejun Heo,
	linux-input, linux-kernel

On Wed, 12 May 2010, Stefan Achatz wrote:

> 
> >From 0875b1fdc784c60d28d3c5bc02ffcf0f30ccea2c Mon Sep 17 00:00:00 2001
> From: Stefan Achatz <erazor_de@users.sourceforge.net>
> Date: Sat, 8 May 2010 16:53:31 +0200
> Subject: [PATCH 2/5] HID: Added further information for Roccat Kone
> 
> Added new data and changed workaround for abnormal button behaviour
> according to new gained knowledge about Roccat Kone device.
> 
> Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
> ---
>  drivers/hid/hid-roccat-kone.c |   11 ++++++-----
>  drivers/hid/hid-roccat-kone.h |   19 ++++++++++++++++---
>  2 files changed, 22 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/hid/hid-roccat-kone.c
> b/drivers/hid/hid-roccat-kone.c
> index d23d309..9d68442 100644
> --- a/drivers/hid/hid-roccat-kone.c
> +++ b/drivers/hid/hid-roccat-kone.c
> @@ -928,14 +928,15 @@ static int kone_raw_event(struct hid_device *hdev,
> struct hid_report *report,
>  		return 0;
>  
>  	/*
> -	 * Firmware 1.38 introduced new behaviour for tilt buttons.
> -	 * Pressed tilt button is reported in each movement event.
> +	 * Firmware 1.38 introduced new behaviour for tilt and special
> buttons.

Your mailer line-wraps the patches. Could you please fix that up and 
resend?

-- 
Jiri Kosina
SUSE Labs, Novell Inc.

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

* [PATCH 2/5] HID: Added further information for Roccat Kone
@ 2010-05-12 15:43 Stefan Achatz
  2010-05-18 12:03 ` Jiri Kosina
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Achatz @ 2010-05-12 15:43 UTC (permalink / raw)
  To: Jiri Kosina, Stephane Chatty, Jussi Kivilinna, wylda,
	Stefan Achatz, Jerome Vidal, Tejun Heo, linux-input,
	linux-kernel


>From 0875b1fdc784c60d28d3c5bc02ffcf0f30ccea2c Mon Sep 17 00:00:00 2001
From: Stefan Achatz <erazor_de@users.sourceforge.net>
Date: Sat, 8 May 2010 16:53:31 +0200
Subject: [PATCH 2/5] HID: Added further information for Roccat Kone

Added new data and changed workaround for abnormal button behaviour
according to new gained knowledge about Roccat Kone device.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
---
 drivers/hid/hid-roccat-kone.c |   11 ++++++-----
 drivers/hid/hid-roccat-kone.h |   19 ++++++++++++++++---
 2 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/drivers/hid/hid-roccat-kone.c
b/drivers/hid/hid-roccat-kone.c
index d23d309..9d68442 100644
--- a/drivers/hid/hid-roccat-kone.c
+++ b/drivers/hid/hid-roccat-kone.c
@@ -928,14 +928,15 @@ static int kone_raw_event(struct hid_device *hdev,
struct hid_report *report,
 		return 0;
 
 	/*
-	 * Firmware 1.38 introduced new behaviour for tilt buttons.
-	 * Pressed tilt button is reported in each movement event.
+	 * Firmware 1.38 introduced new behaviour for tilt and special
buttons.
+	 * Pressed button is reported in each movement event.
 	 * Workaround sends only one event per press.
 	 */
-	if (kone->last_tilt_state == event->tilt)
-		event->tilt = 0;
+	if (memcmp(&kone->last_mouse_event.tilt, &event->tilt, 5))
+		memcpy(&kone->last_mouse_event, event,
+				sizeof(struct kone_mouse_event));
 	else
-		kone->last_tilt_state = event->tilt;
+		memset(&event->tilt, 0, 5);
 
 	/*
 	 * handle special events and keep actual profile and dpi values
diff --git a/drivers/hid/hid-roccat-kone.h
b/drivers/hid/hid-roccat-kone.h
index 99290ad..b413b10 100644
--- a/drivers/hid/hid-roccat-kone.h
+++ b/drivers/hid/hid-roccat-kone.h
@@ -80,6 +80,17 @@ enum kone_button_info_types {
 	kone_button_info_type_multimedia_volume_down = 0x27
 };
 
+enum kone_button_info_numbers {
+	kone_button_top = 1,
+	kone_button_wheel_tilt_left = 2,
+	kone_button_wheel_tilt_right = 3,
+	kone_button_forward = 4,
+	kone_button_backward = 5,
+	kone_button_middle = 6,
+	kone_button_plus = 7,
+	kone_button_minus = 8,
+};
+
 struct kone_light_info {
 	uint8_t number; /* number of light 1-5 */
 	uint8_t mod;   /* 1 = on, 2 = off */
@@ -117,6 +128,7 @@ struct kone_profile {
 	uint8_t light_effect_speed; /* range 0-255 */
 
 	struct kone_light_info light_infos[5];
+	/* offset is kone_button_info_numbers - 1 */
 	struct kone_button_info button_infos[8];
 
 	uint16_t checksum; /* \brief holds checksum of struct */
@@ -162,7 +174,7 @@ enum kone_mouse_events {
 	/* TODO clarify meaning and occurence of kone_mouse_event_calibration
*/
 	kone_mouse_event_calibration = 0xc0,
 	kone_mouse_event_call_overlong_macro = 0xe0,
-	/* switch events notify if user changed values wiht mousebutton click
*/
+	/* switch events notify if user changed values with mousebutton click
*/
 	kone_mouse_event_switch_dpi = 0xf0,
 	kone_mouse_event_switch_profile = 0xf1
 };
@@ -185,8 +197,9 @@ struct kone_device {
 	 * is no way of getting this information from the device on demand
 	 */
 	int actual_profile, actual_dpi;
-	/* Used for neutralizing abnormal tilt button behaviour */
-	int last_tilt_state;
+	/* Used for neutralizing abnormal button behaviour */
+	struct kone_mouse_event last_mouse_event;
+
 	/*
 	 * It's unlikely that multiple sysfs attributes are accessed at a
time,
 	 * so only one mutex is used to secure hardware access and profiles
and
-- 
1.6.6.1




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

* [PATCH 2/5] HID: Added further information for Roccat Kone
@ 2010-05-12 15:43 Stefan Achatz
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Achatz @ 2010-05-12 15:43 UTC (permalink / raw)
  To: Jiri Kosina, Stephane Chatty, Jussi Kivilinna, wylda,
	Stefan Achatz, Jerome


>From 0875b1fdc784c60d28d3c5bc02ffcf0f30ccea2c Mon Sep 17 00:00:00 2001
From: Stefan Achatz <erazor_de@users.sourceforge.net>
Date: Sat, 8 May 2010 16:53:31 +0200
Subject: [PATCH 2/5] HID: Added further information for Roccat Kone

Added new data and changed workaround for abnormal button behaviour
according to new gained knowledge about Roccat Kone device.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
---
 drivers/hid/hid-roccat-kone.c |   11 ++++++-----
 drivers/hid/hid-roccat-kone.h |   19 ++++++++++++++++---
 2 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/drivers/hid/hid-roccat-kone.c
b/drivers/hid/hid-roccat-kone.c
index d23d309..9d68442 100644
--- a/drivers/hid/hid-roccat-kone.c
+++ b/drivers/hid/hid-roccat-kone.c
@@ -928,14 +928,15 @@ static int kone_raw_event(struct hid_device *hdev,
struct hid_report *report,
 		return 0;
 
 	/*
-	 * Firmware 1.38 introduced new behaviour for tilt buttons.
-	 * Pressed tilt button is reported in each movement event.
+	 * Firmware 1.38 introduced new behaviour for tilt and special
buttons.
+	 * Pressed button is reported in each movement event.
 	 * Workaround sends only one event per press.
 	 */
-	if (kone->last_tilt_state == event->tilt)
-		event->tilt = 0;
+	if (memcmp(&kone->last_mouse_event.tilt, &event->tilt, 5))
+		memcpy(&kone->last_mouse_event, event,
+				sizeof(struct kone_mouse_event));
 	else
-		kone->last_tilt_state = event->tilt;
+		memset(&event->tilt, 0, 5);
 
 	/*
 	 * handle special events and keep actual profile and dpi values
diff --git a/drivers/hid/hid-roccat-kone.h
b/drivers/hid/hid-roccat-kone.h
index 99290ad..b413b10 100644
--- a/drivers/hid/hid-roccat-kone.h
+++ b/drivers/hid/hid-roccat-kone.h
@@ -80,6 +80,17 @@ enum kone_button_info_types {
 	kone_button_info_type_multimedia_volume_down = 0x27
 };
 
+enum kone_button_info_numbers {
+	kone_button_top = 1,
+	kone_button_wheel_tilt_left = 2,
+	kone_button_wheel_tilt_right = 3,
+	kone_button_forward = 4,
+	kone_button_backward = 5,
+	kone_button_middle = 6,
+	kone_button_plus = 7,
+	kone_button_minus = 8,
+};
+
 struct kone_light_info {
 	uint8_t number; /* number of light 1-5 */
 	uint8_t mod;   /* 1 = on, 2 = off */
@@ -117,6 +128,7 @@ struct kone_profile {
 	uint8_t light_effect_speed; /* range 0-255 */
 
 	struct kone_light_info light_infos[5];
+	/* offset is kone_button_info_numbers - 1 */
 	struct kone_button_info button_infos[8];
 
 	uint16_t checksum; /* \brief holds checksum of struct */
@@ -162,7 +174,7 @@ enum kone_mouse_events {
 	/* TODO clarify meaning and occurence of kone_mouse_event_calibration
*/
 	kone_mouse_event_calibration = 0xc0,
 	kone_mouse_event_call_overlong_macro = 0xe0,
-	/* switch events notify if user changed values wiht mousebutton click
*/
+	/* switch events notify if user changed values with mousebutton click
*/
 	kone_mouse_event_switch_dpi = 0xf0,
 	kone_mouse_event_switch_profile = 0xf1
 };
@@ -185,8 +197,9 @@ struct kone_device {
 	 * is no way of getting this information from the device on demand
 	 */
 	int actual_profile, actual_dpi;
-	/* Used for neutralizing abnormal tilt button behaviour */
-	int last_tilt_state;
+	/* Used for neutralizing abnormal button behaviour */
+	struct kone_mouse_event last_mouse_event;
+
 	/*
 	 * It's unlikely that multiple sysfs attributes are accessed at a
time,
 	 * so only one mutex is used to secure hardware access and profiles
and
-- 
1.6.6.1




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

end of thread, other threads:[~2010-05-19 11:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-18 16:26 [PATCH 2/5] HID: Added further information for Roccat Kone Stefan Achatz
2010-05-18 16:26 ` Stefan Achatz
2010-05-19 11:53 ` Jiri Kosina
  -- strict thread matches above, loose matches on Subject: below --
2010-05-12 15:43 Stefan Achatz
2010-05-12 15:43 Stefan Achatz
2010-05-18 12:03 ` Jiri Kosina

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.