Lines Matching +full:on +full:- +full:chip
1 // SPDX-License-Identifier: GPL-2.0
3 * Driver for the ps-mode pin configuration.
16 #include <linux/firmware/xlnx-zynqmp.h>
18 /* 4-bit boot mode pins */
22 * modepin_gpio_get_value - Get the state of the specified pin of GPIO device
23 * @chip: gpio_chip instance to be worked on
28 * Return: 0 if the pin is low, 1 if pin is high, -EINVAL wrong pin configured
31 static int modepin_gpio_get_value(struct gpio_chip *chip, unsigned int pin) in modepin_gpio_get_value() argument
50 * modepin_gpio_set_value - Modify the state of the pin with specified value
51 * @chip: gpio_chip instance to be worked on
60 static void modepin_gpio_set_value(struct gpio_chip *chip, unsigned int pin, in modepin_gpio_set_value() argument
83 * modepin_gpio_dir_in - Set the direction of the specified GPIO pin as input
84 * @chip: gpio_chip instance to be worked on
89 static int modepin_gpio_dir_in(struct gpio_chip *chip, unsigned int pin) in modepin_gpio_dir_in() argument
95 * modepin_gpio_dir_out - Set the direction of the specified GPIO pin as output
96 * @chip: gpio_chip instance to be worked on
102 static int modepin_gpio_dir_out(struct gpio_chip *chip, unsigned int pin, in modepin_gpio_dir_out() argument
109 * modepin_gpio_probe - Initialization method for modepin_gpio
112 * Return: 0 on success, negative error otherwise.
116 struct gpio_chip *chip; in modepin_gpio_probe() local
119 chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL); in modepin_gpio_probe()
120 if (!chip) in modepin_gpio_probe()
121 return -ENOMEM; in modepin_gpio_probe()
123 platform_set_drvdata(pdev, chip); in modepin_gpio_probe()
125 /* configure the gpio chip */ in modepin_gpio_probe()
126 chip->base = -1; in modepin_gpio_probe()
127 chip->ngpio = MODE_PINS; in modepin_gpio_probe()
128 chip->owner = THIS_MODULE; in modepin_gpio_probe()
129 chip->parent = &pdev->dev; in modepin_gpio_probe()
130 chip->get = modepin_gpio_get_value; in modepin_gpio_probe()
131 chip->set = modepin_gpio_set_value; in modepin_gpio_probe()
132 chip->direction_input = modepin_gpio_dir_in; in modepin_gpio_probe()
133 chip->direction_output = modepin_gpio_dir_out; in modepin_gpio_probe()
134 chip->label = dev_name(&pdev->dev); in modepin_gpio_probe()
137 status = devm_gpiochip_add_data(&pdev->dev, chip, chip); in modepin_gpio_probe()
139 return dev_err_probe(&pdev->dev, status, in modepin_gpio_probe()
140 "Failed to add GPIO chip\n"); in modepin_gpio_probe()
146 { .compatible = "xlnx,zynqmp-gpio-modepin", },
152 .name = "modepin-gpio",