]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/commitdiff
gpio: of: deprecate configuring GPIOs by default
authorSuresh Mangipudi <smangipudi@nvidia.com>
Thu, 27 Oct 2016 08:39:58 +0000 (14:09 +0530)
committermobile promotions <svcmobile_promotions@nvidia.com>
Mon, 31 Oct 2016 04:44:28 +0000 (21:44 -0700)
This change removes the support for custom GPIO initialization.
Instead the gpio's will be initialized use the gpio-hog feature.

Bug 200241462

Change-Id: I1e0b26467918943ffd4a43a75fec2e4eabcfddbb
Signed-off-by: Suresh Mangipudi <smangipudi@nvidia.com>
Reviewed-on: http://git-master/r/1243645
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
drivers/gpio/gpiolib-of.c
drivers/gpio/gpiolib.c
include/linux/of_gpio.h

index b388f84ca146fa2c4906d737d2d0b6d249672493..1b30df9cdc3b2a298582fc61dbbe58c690e991ae 100644 (file)
@@ -464,82 +464,6 @@ static int of_gpiochip_add_pin_range(struct gpio_chip *chip)
 static int of_gpiochip_add_pin_range(struct gpio_chip *chip) { return 0; }
 #endif
 
-void of_gpiochip_init(struct gpio_chip *chip)
-{
-       struct device_node *np = chip->of_node;
-       struct device_node *np_config;
-       int state;
-       const char *statename;
-       int ret, count;
-       unsigned int pval;
-       bool found;
-       int i;
-
-       if (!chip->of_node)
-               return;
-
-       /* For each defined state ID */
-       state = 0;
-       for_each_child_of_node(np, np_config) {
-               if (!of_device_is_available(np_config))
-                       continue;
-
-               found = false;
-
-               count = of_property_count_u32_elems(np_config, "gpio-input");
-               for (i = 0; i < count; ++i) {
-                       found = true;
-                       ret = of_property_read_u32_index(np_config,
-                                       "gpio-input", i, &pval);
-                       if (!ret)
-                               chip->direction_input(chip, pval);
-               }
-
-               count = of_property_count_u32_elems(np_config, "gpio-output-low");
-               for (i = 0; i < count; ++i) {
-                       found = true;
-                       ret = of_property_read_u32_index(np_config,
-                                       "gpio-output-low", i, &pval);
-                       if (!ret)
-                               chip->direction_output(chip, pval, 0);
-               }
-
-               count = of_property_count_u32_elems(np_config, "gpio-output-high");
-               for (i = 0; i < count; ++i) {
-                       found = true;
-                       ret = of_property_read_u32_index(np_config,
-                                       "gpio-output-high", i, &pval);
-                       if (!ret)
-                               chip->direction_output(chip, pval, 1);
-               }
-
-               count = of_property_count_u32_elems(np_config, "gpio-to-sfio");
-               for (i = 0; i < count; ++i) {
-                       found = true;
-                       ret = of_property_read_u32_index(np_config,
-                                       "gpio-to-sfio", i, &pval);
-                       if (!ret) {
-                               if (chip->request)
-                                       chip->request(chip, pval);
-                               if (chip->free)
-                                       chip->free(chip, pval);
-                       }
-               }
-
-               if (found) {
-                       statename = NULL;
-                       /* Determine whether gpio-init-names property names the state */
-                       of_property_read_string_index(np, "gpio-init-names",
-                                                   state, &statename);
-
-                       dev_info(chip->parent, "Initialising GPIO state %d: name %s\n",
-                               state, (statename) ? statename : np_config->name);
-               }
-
-               state++;
-       }
-}
-
 int of_gpiochip_add(struct gpio_chip *chip)
 {
        int status;
index 7c34b7bc498c1458066d06f381b6c687b7470d6d..85170292e189d3763ad01e40ae4f0f178ad3f242 100644 (file)
@@ -52,6 +52,7 @@ static DEFINE_MUTEX(gpio_lookup_lock);
 static LIST_HEAD(gpio_lookup_list);
 LIST_HEAD(gpio_chips);
 
+
 static void gpiochip_free_hogs(struct gpio_chip *chip);
 static void gpiochip_irqchip_remove(struct gpio_chip *gpiochip);
 
@@ -367,8 +368,6 @@ int gpiochip_add_data(struct gpio_chip *chip, void *data)
 
        acpi_gpiochip_add(chip);
 
-        of_gpiochip_init(chip);
-
        status = gpiochip_sysfs_register(chip);
        if (status)
                goto err_remove_chip;
index e3dd60d1a85bc3b35d6fe41e168bf1b0d40d9c6c..87d6d1632dd4866064fb7319e7ed6f2bff260c49 100644 (file)
@@ -56,7 +56,6 @@ extern int of_mm_gpiochip_add(struct device_node *np,
 extern void of_mm_gpiochip_remove(struct of_mm_gpio_chip *mm_gc);
 
 extern int of_gpiochip_add(struct gpio_chip *gc);
-extern void of_gpiochip_init(struct gpio_chip *gc);
 extern void of_gpiochip_remove(struct gpio_chip *gc);
 extern int of_gpio_simple_xlate(struct gpio_chip *gc,
                                const struct of_phandle_args *gpiospec,
@@ -79,7 +78,6 @@ static inline int of_gpio_simple_xlate(struct gpio_chip *gc,
 }
 
 static inline int of_gpiochip_add(struct gpio_chip *gc) { return 0; }
-static inline void of_gpiochip_init(struct gpio_chip *gc) { }
 static inline void of_gpiochip_remove(struct gpio_chip *gc) { }
 
 #endif /* CONFIG_OF_GPIO */