diff mbox series

[2/2] unicore32: Get rid of <linux/gpio.h> dependency

Message ID 20200727083319.304658-2-linus.walleij@linaro.org
State New
Headers show
Series [1/2] unicore32: Convert GPIO LEDs to use machine descriptor table | expand

Commit Message

Linus Walleij July 27, 2020, 8:33 a.m. UTC
Instead of writing to the GPIO lines through the gpiolib
API, call the appropriate function directly in the driver.

Cc: Guan Xuetao <gxt@pku.edu.cn>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

---
 arch/unicore32/kernel/gpio.c | 30 ++++++++++++++----------------
 1 file changed, 14 insertions(+), 16 deletions(-)

-- 
2.26.2
diff mbox series

Patch

diff --git a/arch/unicore32/kernel/gpio.c b/arch/unicore32/kernel/gpio.c
index 887ea29c380a..3f6b5747b094 100644
--- a/arch/unicore32/kernel/gpio.c
+++ b/arch/unicore32/kernel/gpio.c
@@ -13,8 +13,6 @@ 
 #include <linux/module.h>
 #include <linux/gpio/driver.h>
 #include <linux/gpio/machine.h>
-/* FIXME: needed for gpio_set_value() - convert to use descriptors or hogs */
-#include <linux/gpio.h>
 #include <mach/hardware.h>
 
 #ifdef CONFIG_LEDS
@@ -110,22 +108,22 @@  void __init puv3_init_gpio(void)
 	writel(GPIO_DIR, GPIO_GPDR);
 #if	defined(CONFIG_PUV3_NB0916) || defined(CONFIG_PUV3_SMW0919)	\
 	|| defined(CONFIG_PUV3_DB0913)
-	gpio_set_value(GPO_WIFI_EN, 1);
-	gpio_set_value(GPO_HDD_LED, 1);
-	gpio_set_value(GPO_VGA_EN, 1);
-	gpio_set_value(GPO_LCD_EN, 1);
-	gpio_set_value(GPO_CAM_PWR_EN, 0);
-	gpio_set_value(GPO_LCD_VCC_EN, 1);
-	gpio_set_value(GPO_SOFT_OFF, 1);
-	gpio_set_value(GPO_BT_EN, 1);
-	gpio_set_value(GPO_FAN_ON, 0);
-	gpio_set_value(GPO_SPKR, 0);
-	gpio_set_value(GPO_CPU_HEALTH, 1);
-	gpio_set_value(GPO_LAN_SEL, 1);
+	puv3_direction_output(&puv3_gpio_chip, GPO_WIFI_EN, 1);
+	puv3_direction_output(&puv3_gpio_chip, GPO_HDD_LED, 1);
+	puv3_direction_output(&puv3_gpio_chip, GPO_VGA_EN, 1);
+	puv3_direction_output(&puv3_gpio_chip, GPO_LCD_EN, 1);
+	puv3_direction_output(&puv3_gpio_chip, GPO_CAM_PWR_EN, 0);
+	puv3_direction_output(&puv3_gpio_chip, GPO_LCD_VCC_EN, 1);
+	puv3_direction_output(&puv3_gpio_chip, GPO_SOFT_OFF, 1);
+	puv3_direction_output(&puv3_gpio_chip, GPO_BT_EN, 1);
+	puv3_direction_output(&puv3_gpio_chip, GPO_FAN_ON, 0);
+	puv3_direction_output(&puv3_gpio_chip, GPO_SPKR, 0);
+	puv3_direction_output(&puv3_gpio_chip, GPO_CPU_HEALTH, 1);
+	puv3_direction_output(&puv3_gpio_chip, GPO_LAN_SEL, 1);
 /*
  * DO NOT modify the GPO_SET_V1 and GPO_SET_V2 in kernel
- *	gpio_set_value(GPO_SET_V1, 1);
- *	gpio_set_value(GPO_SET_V2, 1);
+ *	puv3_direction_output(&puv3_gpio_chip, GPO_SET_V1, 1);
+ *	puv3_direction_output(&puv3_gpio_chip, GPO_SET_V2, 1);
  */
 #endif
 	gpiochip_add_data(&puv3_gpio_chip, NULL);