diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2016-08-31 08:49:51 +0100 |
---|---|---|
committer | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2022-05-23 15:58:18 +0100 |
commit | 03ed14e7e786349203a637b4eeffa3d87f8dba9e (patch) | |
tree | 822c490b78b0503f58d922475bdd60f3763a9010 /arch/arm/mach-sa1100/h3100.c | |
parent | 1e160d5828c5459055086115b3edb1f267686481 (diff) |
ARM: sa1100/h3xxx: switch h3xxx IrDA to use gpiod APIs
Switch the IrDA code to use the gpiod APIs rather than platform data
with function callbacks.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'arch/arm/mach-sa1100/h3100.c')
-rw-r--r-- | arch/arm/mach-sa1100/h3100.c | 44 |
1 files changed, 12 insertions, 32 deletions
diff --git a/arch/arm/mach-sa1100/h3100.c b/arch/arm/mach-sa1100/h3100.c index 51eaeeaf3f10..d32e03ed6d1d 100644 --- a/arch/arm/mach-sa1100/h3100.c +++ b/arch/arm/mach-sa1100/h3100.c @@ -9,6 +9,7 @@ #include <linux/init.h> #include <linux/kernel.h> #include <linux/gpio.h> +#include <linux/gpio/machine.h> #include <video/sa1100fb.h> @@ -82,44 +83,23 @@ static void __init h3100_map_io(void) GAFR &= ~0x000001fb; } -/* - * This turns the IRDA power on or off on the Compaq H3100 - */ -static struct gpio h3100_irda_gpio[] = { - { H3100_GPIO_IR_ON, GPIOF_OUT_INIT_LOW, "IrDA power" }, - { H3100_GPIO_IR_FSEL, GPIOF_OUT_INIT_LOW, "IrDA fsel" }, +static struct irda_platform_data h3100_irda_data = { }; -static int h3100_irda_set_power(struct device *dev, unsigned int state) -{ - gpio_set_value(H3100_GPIO_IR_ON, state); - return 0; -} - -static void h3100_irda_set_speed(struct device *dev, unsigned int speed) -{ - gpio_set_value(H3100_GPIO_IR_FSEL, !(speed < 4000000)); -} - -static int h3100_irda_startup(struct device *dev) -{ - return gpio_request_array(h3100_irda_gpio, sizeof(h3100_irda_gpio)); -} - -static void h3100_irda_shutdown(struct device *dev) -{ - return gpio_free_array(h3100_irda_gpio, sizeof(h3100_irda_gpio)); -} - -static struct irda_platform_data h3100_irda_data = { - .set_power = h3100_irda_set_power, - .set_speed = h3100_irda_set_speed, - .startup = h3100_irda_startup, - .shutdown = h3100_irda_shutdown, +/* IrDA GPIO mappings */ +static struct gpiod_lookup_table h3100_irda_gpio_table = { + .dev_id = "sa11x0-ir", + .table = { + GPIO_LOOKUP("gpio", 8, "ir-power", GPIO_ACTIVE_HIGH), + GPIO_LOOKUP("gpio", 9, "ir-fsel", GPIO_ACTIVE_HIGH), + { }, + }, }; static void __init h3100_mach_init(void) { + gpiod_add_lookup_table(&h3100_irda_gpio_table); + h3xxx_mach_init(); sa11x0_register_pcmcia(-1, NULL); |