Lines Matching +full:zynqmp +full:- +full:8
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
28 * Return: 0 if the pin is low, 1 if pin is high, -EINVAL wrong pin configured
40 /* When [0:3] corresponding bit is set, then read output bit [8:11], in modepin_gpio_get_value()
44 return !!(regval & BIT(pin + 8)); in modepin_gpio_get_value()
50 * modepin_gpio_set_value - Modify the state of the pin with specified value
72 bootpin_val |= BIT(pin + 8); in modepin_gpio_set_value()
74 bootpin_val &= ~BIT(pin + 8); in modepin_gpio_set_value()
83 * modepin_gpio_dir_in - Set the direction of the specified GPIO pin as input
95 * modepin_gpio_dir_out - Set the direction of the specified GPIO pin as output
109 * modepin_gpio_probe - Initialization method for modepin_gpio
119 chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL); in modepin_gpio_probe()
121 return -ENOMEM; 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()
146 { .compatible = "xlnx,zynqmp-gpio-modepin", },
153 .name = "modepin-gpio",
162 MODULE_DESCRIPTION("ZynqMP Boot PS_MODE Configuration");