sunxi: gpio: Remove name_to_gpio macro
authorSamuel Holland <samuel@sholland.org>
Sat, 11 Sep 2021 21:50:48 +0000 (16:50 -0500)
committerAndre Przywara <andre.przywara@arm.com>
Mon, 11 Oct 2021 09:46:44 +0000 (10:46 +0100)
This clarifies which callers must be updated to complete the DM_GPIO
conversion.

The only remaining caller of name_to_gpio in generic code is inside the
!DM_GPIO block in cmd/gpio.c. DM_GPIO is always selected on sunxi, so
that code cannot be reached. And after this commit, there are only two
remaining implementations of name_to_gpio.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Acked-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
arch/arm/include/asm/arch-sunxi/gpio.h
drivers/spi/spi-sunxi.c
drivers/video/Kconfig
drivers/video/hitachi_tx18d42vm_lcd.c
drivers/video/sunxi/sunxi_display.c

index c595dcc..59e3915 100644 (file)
@@ -239,7 +239,6 @@ int sunxi_gpio_get_cfgpin(u32 pin);
 int sunxi_gpio_set_drv(u32 pin, u32 val);
 int sunxi_gpio_set_pull(u32 pin, u32 val);
 int sunxi_name_to_gpio(const char *name);
-#define name_to_gpio(name) sunxi_name_to_gpio(name)
 
 #if !defined CONFIG_SPL_BUILD && defined CONFIG_AXP_GPIO
 int axp_gpio_init(void);
index 4ca5d3a..bc2f544 100644 (file)
@@ -245,7 +245,7 @@ static int sun4i_spi_parse_pins(struct udevice *dev)
                                        break;
                        }
 
-                       pin = name_to_gpio(pin_name);
+                       pin = sunxi_name_to_gpio(pin_name);
                        if (pin < 0)
                                break;
 
index 9f789a6..2f4650f 100644 (file)
@@ -452,7 +452,7 @@ config VIDEO_LCD_SSD2828_RESET
        default ""
        ---help---
        The reset pin of SSD2828 chip. This takes a string in the format
-       understood by 'name_to_gpio' function, e.g. PH1 for pin 1 of port H.
+       understood by 'sunxi_name_to_gpio' function, e.g. PH1 for pin 1 of port H.
 
 config VIDEO_LCD_TDO_TL070WSH30
        bool "TDO TL070WSH30 DSI LCD panel support"
@@ -477,7 +477,7 @@ config VIDEO_LCD_SPI_CS
        This is one of the SPI communication pins, involved in setting up a
        working LCD configuration. The exact role of SPI may differ for
        different hardware setups. The option takes a string in the format
-       understood by 'name_to_gpio' function, e.g. PH1 for pin 1 of port H.
+       understood by 'sunxi_name_to_gpio' function, e.g. PH1 for pin 1 of port H.
 
 config VIDEO_LCD_SPI_SCLK
        string "SPI SCLK pin for LCD related config job"
@@ -487,7 +487,7 @@ config VIDEO_LCD_SPI_SCLK
        This is one of the SPI communication pins, involved in setting up a
        working LCD configuration. The exact role of SPI may differ for
        different hardware setups. The option takes a string in the format
-       understood by 'name_to_gpio' function, e.g. PH1 for pin 1 of port H.
+       understood by 'sunxi_name_to_gpio' function, e.g. PH1 for pin 1 of port H.
 
 config VIDEO_LCD_SPI_MOSI
        string "SPI MOSI pin for LCD related config job"
@@ -497,7 +497,7 @@ config VIDEO_LCD_SPI_MOSI
        This is one of the SPI communication pins, involved in setting up a
        working LCD configuration. The exact role of SPI may differ for
        different hardware setups. The option takes a string in the format
-       understood by 'name_to_gpio' function, e.g. PH1 for pin 1 of port H.
+       understood by 'sunxi_name_to_gpio' function, e.g. PH1 for pin 1 of port H.
 
 config VIDEO_LCD_SPI_MISO
        string "SPI MISO pin for LCD related config job (optional)"
@@ -509,7 +509,7 @@ config VIDEO_LCD_SPI_MISO
        different hardware setups. If wired up, this pin may provide additional
        useful functionality. Such as bi-directional communication with the
        hardware and LCD panel id retrieval (if the panel can report it). The
-       option takes a string in the format understood by 'name_to_gpio'
+       option takes a string in the format understood by 'sunxi_name_to_gpio'
        function, e.g. PH1 for pin 1 of port H.
 
 source "drivers/video/meson/Kconfig"
index c6c8df6..87c4d27 100644 (file)
@@ -49,9 +49,9 @@ int hitachi_tx18d42vm_init(void)
        };
        int i, cs, clk, mosi, ret = 0;
 
-       cs = name_to_gpio(CONFIG_VIDEO_LCD_SPI_CS);
-       clk = name_to_gpio(CONFIG_VIDEO_LCD_SPI_SCLK);
-       mosi = name_to_gpio(CONFIG_VIDEO_LCD_SPI_MOSI);
+       cs = sunxi_name_to_gpio(CONFIG_VIDEO_LCD_SPI_CS);
+       clk = sunxi_name_to_gpio(CONFIG_VIDEO_LCD_SPI_SCLK);
+       mosi = sunxi_name_to_gpio(CONFIG_VIDEO_LCD_SPI_MOSI);
 
        if (cs == -1 || clk == -1 || mosi == 1) {
                printf("Error tx18d42vm spi gpio config is invalid\n");
index 128888f..da3e898 100644 (file)
@@ -871,11 +871,11 @@ static void sunxi_vga_external_dac_enable(void)
 static int sunxi_ssd2828_init(const struct ctfb_res_modes *mode)
 {
        struct ssd2828_config cfg = {
-               .csx_pin = name_to_gpio(CONFIG_VIDEO_LCD_SPI_CS),
-               .sck_pin = name_to_gpio(CONFIG_VIDEO_LCD_SPI_SCLK),
-               .sdi_pin = name_to_gpio(CONFIG_VIDEO_LCD_SPI_MOSI),
-               .sdo_pin = name_to_gpio(CONFIG_VIDEO_LCD_SPI_MISO),
-               .reset_pin = name_to_gpio(CONFIG_VIDEO_LCD_SSD2828_RESET),
+               .csx_pin = sunxi_name_to_gpio(CONFIG_VIDEO_LCD_SPI_CS),
+               .sck_pin = sunxi_name_to_gpio(CONFIG_VIDEO_LCD_SPI_SCLK),
+               .sdi_pin = sunxi_name_to_gpio(CONFIG_VIDEO_LCD_SPI_MOSI),
+               .sdo_pin = sunxi_name_to_gpio(CONFIG_VIDEO_LCD_SPI_MISO),
+               .reset_pin = sunxi_name_to_gpio(CONFIG_VIDEO_LCD_SSD2828_RESET),
                .ssd2828_tx_clk_khz  = CONFIG_VIDEO_LCD_SSD2828_TX_CLK * 1000,
                .ssd2828_color_depth = 24,
 #ifdef CONFIG_VIDEO_LCD_PANEL_MIPI_4_LANE_513_MBPS_VIA_SSD2828