Lines Matching +full:pinctrl +full:- +full:pin +full:- +full:array
1 // SPDX-License-Identifier: GPL-2.0-only
5 * GPIO and pin control functions on this SOC are handled by the "TLMM"
6 * device. The driver which controls this device is pinctrl-msm.c. Each
8 * with pinctrl-msm.c. This means that all TLMM drivers are pin control
11 * This pin control driver is intended to be used only an ACPI-enabled
12 * system. As such, UEFI will handle all pin control configuration, so
13 * this driver does not provide pin control functions. It is effectively
14 * a GPIO-only driver. The alternative is to duplicate the GPIO code of
15 * pinctrl-msm.c into another driver.
20 #include <linux/pinctrl/pinctrl.h>
23 #include "pinctrl-msm.h"
25 /* A maximum of 256 allows us to use a u8 array to hold the GPIO numbers */
33 struct msm_pinctrl_soc_data *pinctrl; in qdf2xxx_pinctrl_probe() local
40 u8 gpios[MAX_GPIOS]; /* An array of supported GPIOs */ in qdf2xxx_pinctrl_probe()
44 ret = device_property_read_u32(&pdev->dev, "num-gpios", &num_gpios); in qdf2xxx_pinctrl_probe()
46 dev_err(&pdev->dev, "missing 'num-gpios' property\n"); in qdf2xxx_pinctrl_probe()
50 dev_err(&pdev->dev, "invalid 'num-gpios' property\n"); in qdf2xxx_pinctrl_probe()
51 return -ENODEV; in qdf2xxx_pinctrl_probe()
55 ret = device_property_count_u8(&pdev->dev, "gpios"); in qdf2xxx_pinctrl_probe()
57 dev_err(&pdev->dev, "missing 'gpios' property\n"); in qdf2xxx_pinctrl_probe()
61 * The number of available GPIOs should be non-zero, and no in qdf2xxx_pinctrl_probe()
65 dev_err(&pdev->dev, "invalid 'gpios' property\n"); in qdf2xxx_pinctrl_probe()
66 return -ENODEV; in qdf2xxx_pinctrl_probe()
70 ret = device_property_read_u8_array(&pdev->dev, "gpios", gpios, in qdf2xxx_pinctrl_probe()
73 dev_err(&pdev->dev, "could not read list of GPIOs\n"); in qdf2xxx_pinctrl_probe()
77 pinctrl = devm_kzalloc(&pdev->dev, sizeof(*pinctrl), GFP_KERNEL); in qdf2xxx_pinctrl_probe()
78 pins = devm_kcalloc(&pdev->dev, num_gpios, in qdf2xxx_pinctrl_probe()
80 groups = devm_kcalloc(&pdev->dev, num_gpios, in qdf2xxx_pinctrl_probe()
82 names = devm_kcalloc(&pdev->dev, avail_gpios, NAME_SIZE, GFP_KERNEL); in qdf2xxx_pinctrl_probe()
84 if (!pinctrl || !pins || !groups || !names) in qdf2xxx_pinctrl_probe()
85 return -ENOMEM; in qdf2xxx_pinctrl_probe()
88 * Initialize the array. GPIOs not listed in the 'gpios' array in qdf2xxx_pinctrl_probe()
127 pinctrl->pins = pins; in qdf2xxx_pinctrl_probe()
128 pinctrl->groups = groups; in qdf2xxx_pinctrl_probe()
129 pinctrl->npins = num_gpios; in qdf2xxx_pinctrl_probe()
130 pinctrl->ngroups = num_gpios; in qdf2xxx_pinctrl_probe()
131 pinctrl->ngpios = num_gpios; in qdf2xxx_pinctrl_probe()
133 return msm_pinctrl_probe(pdev, pinctrl); in qdf2xxx_pinctrl_probe()
144 .name = "qdf2xxx-pinctrl",
163 MODULE_DESCRIPTION("Qualcomm Technologies QDF2xxx pin control driver");