summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2016-08-31 08:49:51 +0100
committerRussell King <rmk+kernel@armlinux.org.uk>2020-10-12 21:53:09 +0100
commit709ceb53b3c8814f729f1ee79c210e36c83eb80b (patch)
tree97116ac28150e96b7775de66a1477cd2101bd1e1
parent35a2e0b3a0b0b10e061aadae3aec78acd5676d9f (diff)
ARM: sa1100/assabet: switch assabet 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>
-rw-r--r--arch/arm/mach-sa1100/assabet.c42
1 files changed, 13 insertions, 29 deletions
diff --git a/arch/arm/mach-sa1100/assabet.c b/arch/arm/mach-sa1100/assabet.c
index 0edb1ecc0b11..118b23d524b2 100644
--- a/arch/arm/mach-sa1100/assabet.c
+++ b/arch/arm/mach-sa1100/assabet.c
@@ -325,36 +325,18 @@ static struct resource assabet_flash_resources[] = {
};
-/*
- * Assabet IrDA support code.
- */
-
-static int assabet_irda_set_power(struct device *dev, unsigned int state)
-{
- static unsigned int bcr_state[4] = {
- ASSABET_BCR_IRDA_MD0,
- ASSABET_BCR_IRDA_MD1|ASSABET_BCR_IRDA_MD0,
- ASSABET_BCR_IRDA_MD1,
- 0
- };
-
- if (state < 4)
- ASSABET_BCR_frob(ASSABET_BCR_IRDA_MD1 | ASSABET_BCR_IRDA_MD0,
- bcr_state[state]);
- return 0;
-}
-
-static void assabet_irda_set_speed(struct device *dev, unsigned int speed)
-{
- if (speed < 4000000)
- ASSABET_BCR_clear(ASSABET_BCR_IRDA_FSEL);
- else
- ASSABET_BCR_set(ASSABET_BCR_IRDA_FSEL);
-}
-
static struct irda_platform_data assabet_irda_data = {
- .set_power = assabet_irda_set_power,
- .set_speed = assabet_irda_set_speed,
+};
+
+/* IrDA GPIO mappings */
+static struct gpiod_lookup_table assabet_irda_gpio_table = {
+ .dev_id = "sa11x0-ir",
+ .table = {
+ GPIO_LOOKUP("assabet", 3, "ir-fsel", GPIO_ACTIVE_HIGH),
+ GPIO_LOOKUP("assabet", 4, "ir-md0", GPIO_ACTIVE_HIGH),
+ GPIO_LOOKUP("assabet", 5, "ir-md1", GPIO_ACTIVE_HIGH),
+ { },
+ },
};
static struct ucb1x00_plat_data assabet_ucb1x00_data = {
@@ -569,6 +551,8 @@ static struct gpiod_lookup_table assabet_uart3_gpio_table = {
static void __init assabet_init(void)
{
+ gpiod_add_lookup_table(&assabet_irda_gpio_table);
+
/*
* Ensure that the power supply is in "high power" mode.
*/