gpiolib-of.c (d5176cdbf64ce7d4eebf339205f17c23118e9f72) | gpiolib-of.c (a99cc66807d6c854a7f65f962766c530c91be149) |
---|---|
1// SPDX-License-Identifier: GPL-2.0+ 2/* 3 * OF helpers for the GPIO API 4 * 5 * Copyright (c) 2007-2008 MontaVista Software, Inc. 6 * 7 * Author: Anton Vorontsov <avorontsov@ru.mvista.com> 8 */ --- 878 unchanged lines hidden (view full) --- 887 return -EINVAL; 888 889 if (flags) 890 *flags = gpiospec->args[1]; 891 892 return gpiospec->args[0]; 893} 894 | 1// SPDX-License-Identifier: GPL-2.0+ 2/* 3 * OF helpers for the GPIO API 4 * 5 * Copyright (c) 2007-2008 MontaVista Software, Inc. 6 * 7 * Author: Anton Vorontsov <avorontsov@ru.mvista.com> 8 */ --- 878 unchanged lines hidden (view full) --- 887 return -EINVAL; 888 889 if (flags) 890 *flags = gpiospec->args[1]; 891 892 return gpiospec->args[0]; 893} 894 |
895#if IS_ENABLED(CONFIG_OF_GPIO_MM_GPIOCHIP) 896#include <linux/gpio/legacy-of-mm-gpiochip.h> |
|
895/** 896 * of_mm_gpiochip_add_data - Add memory mapped GPIO chip (bank) 897 * @np: device node of the GPIO chip 898 * @mm_gc: pointer to the of_mm_gpio_chip allocated structure 899 * @data: driver data to store in the struct gpio_chip 900 * 901 * To use this function you should allocate and fill mm_gc with: 902 * --- 56 unchanged lines hidden (view full) --- 959{ 960 struct gpio_chip *gc = &mm_gc->gc; 961 962 gpiochip_remove(gc); 963 iounmap(mm_gc->regs); 964 kfree(gc->label); 965} 966EXPORT_SYMBOL_GPL(of_mm_gpiochip_remove); | 897/** 898 * of_mm_gpiochip_add_data - Add memory mapped GPIO chip (bank) 899 * @np: device node of the GPIO chip 900 * @mm_gc: pointer to the of_mm_gpio_chip allocated structure 901 * @data: driver data to store in the struct gpio_chip 902 * 903 * To use this function you should allocate and fill mm_gc with: 904 * --- 56 unchanged lines hidden (view full) --- 961{ 962 struct gpio_chip *gc = &mm_gc->gc; 963 964 gpiochip_remove(gc); 965 iounmap(mm_gc->regs); 966 kfree(gc->label); 967} 968EXPORT_SYMBOL_GPL(of_mm_gpiochip_remove); |
969#endif |
|
967 968#ifdef CONFIG_PINCTRL 969static int of_gpiochip_add_pin_range(struct gpio_chip *chip) 970{ 971 struct of_phandle_args pinspec; 972 struct pinctrl_dev *pctldev; 973 struct device_node *np; 974 int index = 0, ret; --- 114 unchanged lines hidden --- | 970 971#ifdef CONFIG_PINCTRL 972static int of_gpiochip_add_pin_range(struct gpio_chip *chip) 973{ 974 struct of_phandle_args pinspec; 975 struct pinctrl_dev *pctldev; 976 struct device_node *np; 977 int index = 0, ret; --- 114 unchanged lines hidden --- |