Commit ed8f9e2f authored by Richard Purdie's avatar Richard Purdie Committed by Dmitry Torokhov

Input: change from numbered to named switches

Remove the numbered SW_* entries from the input system and assign names
to the existing users.
Signed-off-by: default avatarRichard Purdie <rpurdie@rpsys.net>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent d2f4012f
...@@ -245,9 +245,9 @@ static void corgikbd_hinge_timer(unsigned long data) ...@@ -245,9 +245,9 @@ static void corgikbd_hinge_timer(unsigned long data)
if (hinge_count >= HINGE_STABLE_COUNT) { if (hinge_count >= HINGE_STABLE_COUNT) {
spin_lock_irqsave(&corgikbd_data->lock, flags); spin_lock_irqsave(&corgikbd_data->lock, flags);
input_report_switch(corgikbd_data->input, SW_0, ((sharpsl_hinge_state & CORGI_SCP_SWA) != 0)); input_report_switch(corgikbd_data->input, SW_LID, ((sharpsl_hinge_state & CORGI_SCP_SWA) != 0));
input_report_switch(corgikbd_data->input, SW_1, ((sharpsl_hinge_state & CORGI_SCP_SWB) != 0)); input_report_switch(corgikbd_data->input, SW_TABLET_MODE, ((sharpsl_hinge_state & CORGI_SCP_SWB) != 0));
input_report_switch(corgikbd_data->input, SW_2, (READ_GPIO_BIT(CORGI_GPIO_AK_INT) != 0)); input_report_switch(corgikbd_data->input, SW_HEADPHONE_INSERT, (READ_GPIO_BIT(CORGI_GPIO_AK_INT) != 0));
input_sync(corgikbd_data->input); input_sync(corgikbd_data->input);
spin_unlock_irqrestore(&corgikbd_data->lock, flags); spin_unlock_irqrestore(&corgikbd_data->lock, flags);
...@@ -340,9 +340,9 @@ static int __init corgikbd_probe(struct platform_device *pdev) ...@@ -340,9 +340,9 @@ static int __init corgikbd_probe(struct platform_device *pdev)
for (i = 0; i < ARRAY_SIZE(corgikbd_keycode); i++) for (i = 0; i < ARRAY_SIZE(corgikbd_keycode); i++)
set_bit(corgikbd->keycode[i], input_dev->keybit); set_bit(corgikbd->keycode[i], input_dev->keybit);
clear_bit(0, input_dev->keybit); clear_bit(0, input_dev->keybit);
set_bit(SW_0, input_dev->swbit); set_bit(SW_LID, input_dev->swbit);
set_bit(SW_1, input_dev->swbit); set_bit(SW_TABLET_MODE, input_dev->swbit);
set_bit(SW_2, input_dev->swbit); set_bit(SW_HEADPHONE_INSERT, input_dev->swbit);
input_register_device(corgikbd->input); input_register_device(corgikbd->input);
......
...@@ -299,9 +299,9 @@ static void spitzkbd_hinge_timer(unsigned long data) ...@@ -299,9 +299,9 @@ static void spitzkbd_hinge_timer(unsigned long data)
if (hinge_count >= HINGE_STABLE_COUNT) { if (hinge_count >= HINGE_STABLE_COUNT) {
spin_lock_irqsave(&spitzkbd_data->lock, flags); spin_lock_irqsave(&spitzkbd_data->lock, flags);
input_report_switch(spitzkbd_data->input, SW_0, ((GPLR(SPITZ_GPIO_SWA) & GPIO_bit(SPITZ_GPIO_SWA)) != 0)); input_report_switch(spitzkbd_data->input, SW_LID, ((GPLR(SPITZ_GPIO_SWA) & GPIO_bit(SPITZ_GPIO_SWA)) != 0));
input_report_switch(spitzkbd_data->input, SW_1, ((GPLR(SPITZ_GPIO_SWB) & GPIO_bit(SPITZ_GPIO_SWB)) != 0)); input_report_switch(spitzkbd_data->input, SW_TABLET_MODE, ((GPLR(SPITZ_GPIO_SWB) & GPIO_bit(SPITZ_GPIO_SWB)) != 0));
input_report_switch(spitzkbd_data->input, SW_2, ((GPLR(SPITZ_GPIO_AK_INT) & GPIO_bit(SPITZ_GPIO_AK_INT)) != 0)); input_report_switch(spitzkbd_data->input, SW_HEADPHONE_INSERT, ((GPLR(SPITZ_GPIO_AK_INT) & GPIO_bit(SPITZ_GPIO_AK_INT)) != 0));
input_sync(spitzkbd_data->input); input_sync(spitzkbd_data->input);
spin_unlock_irqrestore(&spitzkbd_data->lock, flags); spin_unlock_irqrestore(&spitzkbd_data->lock, flags);
...@@ -398,9 +398,9 @@ static int __init spitzkbd_probe(struct platform_device *dev) ...@@ -398,9 +398,9 @@ static int __init spitzkbd_probe(struct platform_device *dev)
for (i = 0; i < ARRAY_SIZE(spitzkbd_keycode); i++) for (i = 0; i < ARRAY_SIZE(spitzkbd_keycode); i++)
set_bit(spitzkbd->keycode[i], input_dev->keybit); set_bit(spitzkbd->keycode[i], input_dev->keybit);
clear_bit(0, input_dev->keybit); clear_bit(0, input_dev->keybit);
set_bit(SW_0, input_dev->swbit); set_bit(SW_LID, input_dev->swbit);
set_bit(SW_1, input_dev->swbit); set_bit(SW_TABLET_MODE, input_dev->swbit);
set_bit(SW_2, input_dev->swbit); set_bit(SW_HEADPHONE_INSERT, input_dev->swbit);
input_register_device(input_dev); input_register_device(input_dev);
......
...@@ -579,14 +579,9 @@ struct input_absinfo { ...@@ -579,14 +579,9 @@ struct input_absinfo {
* Switch events * Switch events
*/ */
#define SW_0 0x00 #define SW_LID 0x00 /* set = lid shut */
#define SW_1 0x01 #define SW_TABLET_MODE 0x01 /* set = tablet mode */
#define SW_2 0x02 #define SW_HEADPHONE_INSERT 0x02 /* set = inserted */
#define SW_3 0x03
#define SW_4 0x04
#define SW_5 0x05
#define SW_6 0x06
#define SW_7 0x07
#define SW_MAX 0x0f #define SW_MAX 0x0f
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment