summaryrefslogtreecommitdiff
path: root/arch/arm/mach-pxa/raumfeld.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2016-01-17 21:57:09 +0300
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2016-03-03 02:48:05 +0300
commita9e340dce3c3bceeb42f6b6d33b7858822d76cb6 (patch)
tree7a337c625bf3f29a47146d642eb24ed23fe4151a /arch/arm/mach-pxa/raumfeld.c
parent8631580f4fde9584ef39480eb0f2219708e5aeba (diff)
downloadlinux-a9e340dce3c3bceeb42f6b6d33b7858822d76cb6.tar.xz
Input: rotary_encoder - move away from platform data structure
Drop support for platform data passed via a C-structure and switch to device properties instead, which should make the driver compatible with all platforms: OF, ACPI and static boards. Static boards should use property sets to communicate device parameters to the driver. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'arch/arm/mach-pxa/raumfeld.c')
-rw-r--r--arch/arm/mach-pxa/raumfeld.c29
1 files changed, 21 insertions, 8 deletions
diff --git a/arch/arm/mach-pxa/raumfeld.c b/arch/arm/mach-pxa/raumfeld.c
index bac88e0be58a..82689ac20ccf 100644
--- a/arch/arm/mach-pxa/raumfeld.c
+++ b/arch/arm/mach-pxa/raumfeld.c
@@ -18,13 +18,13 @@
#include <linux/init.h>
#include <linux/kernel.h>
+#include <linux/property.h>
#include <linux/platform_device.h>
#include <linux/interrupt.h>
#include <linux/gpio.h>
#include <linux/gpio/machine.h>
#include <linux/smsc911x.h>
#include <linux/input.h>
-#include <linux/rotary_encoder.h>
#include <linux/gpio_keys.h>
#include <linux/input/eeti_ts.h>
#include <linux/leds.h>
@@ -378,18 +378,27 @@ static struct gpiod_lookup_table raumfeld_rotary_gpios_table = {
},
};
-static struct rotary_encoder_platform_data raumfeld_rotary_encoder_info = {
- .steps = 24,
- .axis = REL_X,
- .relative_axis = 1,
+static u32 raumfeld_rotary_encoder_steps = 24;
+static u32 raumfeld_rotary_encoder_axis = REL_X;
+static u32 raumfeld_rotary_encoder_relative_axis = 1;
+
+static struct property_entry raumfeld_rotary_properties[] = {
+ { "rotary-encoder,steps-per-period",
+ DEV_PROP_U32, 1, &raumfeld_rotary_encoder_steps, },
+ { "linux,axis",
+ DEV_PROP_U32, 1, &raumfeld_rotary_encoder_axis, },
+ { "rotary-encoder,relative_axis",
+ DEV_PROP_U32, 1, &raumfeld_rotary_encoder_relative_axis, },
+ { NULL }
+};
+
+static struct property_set raumfeld_rotary_property_set = {
+ .properties = raumfeld_rotary_properties,
};
static struct platform_device rotary_encoder_device = {
.name = "rotary-encoder",
.id = 0,
- .dev = {
- .platform_data = &raumfeld_rotary_encoder_info,
- }
};
/**
@@ -1061,6 +1070,8 @@ static void __init raumfeld_controller_init(void)
pxa3xx_mfp_config(ARRAY_AND_SIZE(raumfeld_controller_pin_config));
gpiod_add_lookup_table(&raumfeld_rotary_gpios_table);
+ device_add_property_set(&rotary_encoder_device.dev,
+ &raumfeld_rotary_property_set);
platform_device_register(&rotary_encoder_device);
spi_register_board_info(ARRAY_AND_SIZE(controller_spi_devices));
@@ -1099,6 +1110,8 @@ static void __init raumfeld_speaker_init(void)
platform_device_register(&smc91x_device);
gpiod_add_lookup_table(&raumfeld_rotary_gpios_table);
+ device_add_property_set(&rotary_encoder_device.dev,
+ &raumfeld_rotary_property_set);
platform_device_register(&rotary_encoder_device);
raumfeld_audio_init();