Home
last modified time | relevance | path

Searched +full:int +full:- +full:gpios (Results 1 – 25 of 1012) sorted by relevance

12345678910>>...41

/openbmc/linux/drivers/tty/serial/
H A Dserial_mctrl_gpio.c1 // SPDX-License-Identifier: GPL-2.0+
22 int irq[UART_GPIO_MAX];
23 unsigned int mctrl_prev;
29 unsigned int mctrl;
40 static bool mctrl_gpio_flags_is_dir_out(unsigned int idx) in mctrl_gpio_flags_is_dir_out()
46 * mctrl_gpio_set - set gpios according to mctrl state
47 * @gpios: gpios to set
50 * Set the gpios according to the mctrl state.
52 void mctrl_gpio_set(struct mctrl_gpios *gpios, unsigned int mctrl) in mctrl_gpio_set() argument
57 unsigned int count = 0; in mctrl_gpio_set()
[all …]
H A Dserial_mctrl_gpio.h1 /* SPDX-License-Identifier: GPL-2.0+ */
29 * Opaque descriptor for modem lines controlled by GPIOs
36 * Set state of the modem control output lines via GPIOs.
38 void mctrl_gpio_set(struct mctrl_gpios *gpios, unsigned int mctrl);
41 * Get state of the modem control input lines from GPIOs.
44 unsigned int mctrl_gpio_get(struct mctrl_gpios *gpios, unsigned int *mctrl);
47 * Get state of the modem control output lines from GPIOs.
50 unsigned int
51 mctrl_gpio_get_outputs(struct mctrl_gpios *gpios, unsigned int *mctrl);
56 struct gpio_desc *mctrl_gpio_to_gpiod(struct mctrl_gpios *gpios,
[all …]
/openbmc/linux/sound/soc/
H A Dsoc-jack.c1 // SPDX-License-Identifier: GPL-2.0+
3 // soc-jack.c -- ALSA SoC jack handling
21 * snd_soc_jack_report - Report the current status for a jack
34 void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask) in snd_soc_jack_report()
38 unsigned int sync = 0; in snd_soc_jack_report()
40 if (!jack || !jack->jack) in snd_soc_jack_report()
44 dapm = &jack->card->dapm; in snd_soc_jack_report()
46 mutex_lock(&jack->mutex); in snd_soc_jack_report()
48 jack->status &= ~mask; in snd_soc_jack_report()
49 jack->status |= status & mask; in snd_soc_jack_report()
[all …]
/openbmc/u-boot/drivers/i2c/muxes/
H A Di2c-mux-gpio.c1 // SPDX-License-Identifier: GPL-2.0+
11 #include <asm-generic/gpio.h>
22 * struct i2c_mux_gpio_priv - private data for i2c mux gpio
26 * @gpios: the mux-gpios array
27 * @n_gpios: num of gpios in mux-gpios
28 * @idle: the value of idle-state
32 int n_values;
33 struct gpio_desc *gpios; member
34 int n_gpios;
39 static int i2c_mux_gpio_select(struct udevice *dev, struct udevice *bus, in i2c_mux_gpio_select()
[all …]
/openbmc/u-boot/drivers/gpio/
H A Dbcm2835_gpio.c1 // SPDX-License-Identifier: GPL-2.0+
20 static int bcm2835_gpio_direction_input(struct udevice *dev, unsigned gpio) in bcm2835_gpio_direction_input()
22 struct bcm2835_gpios *gpios = dev_get_priv(dev); in bcm2835_gpio_direction_input() local
25 val = readl(&gpios->reg->gpfsel[BCM2835_GPIO_FSEL_BANK(gpio)]); in bcm2835_gpio_direction_input()
28 writel(val, &gpios->reg->gpfsel[BCM2835_GPIO_FSEL_BANK(gpio)]); in bcm2835_gpio_direction_input()
33 static int bcm2835_gpio_direction_output(struct udevice *dev, unsigned int gpio, in bcm2835_gpio_direction_output()
34 int value) in bcm2835_gpio_direction_output()
36 struct bcm2835_gpios *gpios = dev_get_priv(dev); in bcm2835_gpio_direction_output() local
41 val = readl(&gpios->reg->gpfsel[BCM2835_GPIO_FSEL_BANK(gpio)]); in bcm2835_gpio_direction_output()
44 writel(val, &gpios->reg->gpfsel[BCM2835_GPIO_FSEL_BANK(gpio)]); in bcm2835_gpio_direction_output()
[all …]
H A Dvybrid_gpio.c1 // SPDX-License-Identifier: GPL-2.0+
12 #include <asm/mach-imx/iomux-v3.h>
19 unsigned int chip;
23 static int vybrid_gpio_direction_input(struct udevice *dev, unsigned gpio) in vybrid_gpio_direction_input()
25 const struct vybrid_gpios *gpios = dev_get_priv(dev); in vybrid_gpio_direction_input() local
27 gpio = gpio + (gpios->chip * VYBRID_GPIO_COUNT); in vybrid_gpio_direction_input()
33 static int vybrid_gpio_direction_output(struct udevice *dev, unsigned gpio, in vybrid_gpio_direction_output()
34 int value) in vybrid_gpio_direction_output()
36 const struct vybrid_gpios *gpios = dev_get_priv(dev); in vybrid_gpio_direction_output() local
38 gpio = gpio + (gpios->chip * VYBRID_GPIO_COUNT); in vybrid_gpio_direction_output()
[all …]
H A Dmpc8xxx_gpio.c1 // SPDX-License-Identifier: GPL-2.0+
47 return (1U << (31 - (gpio))); in gpio_mask()
52 return in_be32(&base->gpdat) & mask; in mpc8xxx_gpio_get_val()
57 return in_be32(&base->gpdir) & mask; in mpc8xxx_gpio_get_dir()
60 static inline void mpc8xxx_gpio_set_in(struct ccsr_gpio *base, u32 gpios) in mpc8xxx_gpio_set_in() argument
62 clrbits_be32(&base->gpdat, gpios); in mpc8xxx_gpio_set_in()
63 /* GPDIR register 0 -> input */ in mpc8xxx_gpio_set_in()
64 clrbits_be32(&base->gpdir, gpios); in mpc8xxx_gpio_set_in()
67 static inline void mpc8xxx_gpio_set_low(struct ccsr_gpio *base, u32 gpios) in mpc8xxx_gpio_set_low() argument
69 clrbits_be32(&base->gpdat, gpios); in mpc8xxx_gpio_set_low()
[all …]
/openbmc/linux/drivers/watchdog/
H A Dmena21_wdt.c1 // SPDX-License-Identifier: GPL-2.0+
34 struct gpio_desc *gpios[NUM_GPIOS]; member
42 static unsigned int a21_wdt_get_bootstatus(struct a21_wdt_drv *drv) in a21_wdt_get_bootstatus()
44 int reset = 0; in a21_wdt_get_bootstatus()
46 reset |= gpiod_get_value(drv->gpios[GPIO_WD_RST0]) ? (1 << 0) : 0; in a21_wdt_get_bootstatus()
47 reset |= gpiod_get_value(drv->gpios[GPIO_WD_RST1]) ? (1 << 1) : 0; in a21_wdt_get_bootstatus()
48 reset |= gpiod_get_value(drv->gpios[GPIO_WD_RST2]) ? (1 << 2) : 0; in a21_wdt_get_bootstatus()
53 static int a21_wdt_start(struct watchdog_device *wdt) in a21_wdt_start()
57 gpiod_set_value(drv->gpios[GPIO_WD_ENAB], 1); in a21_wdt_start()
62 static int a21_wdt_stop(struct watchdog_device *wdt) in a21_wdt_stop()
[all …]
/openbmc/linux/drivers/gpio/
H A Dgpiolib-of.c1 // SPDX-License-Identifier: GPL-2.0+
5 * Copyright (c) 2007-2008 MontaVista Software, Inc.
26 #include "gpiolib-of.h"
29 * This is Linux-specific flags. By default controllers' and Linux' mapping
31 * Linux-specific in their .xlate callback. Though, 1:1 mapping is recommended.
44 * of_gpio_named_count() - Count GPIOs for a device
45 * @np: device node to count GPIOs for
48 * The function returns the count of GPIOs specified for a node.
50 * Number of gpios defined in property,
51 * -EINVAL for an incorrectly formed gpios property, or
[all …]
/openbmc/u-boot/include/asm-generic/
H A Dgpio.h1 /* SPDX-License-Identifier: GPL-2.0+ */
15 * Generic GPIO API for U-Boot
17 * --
20 * - gpio_request_by_name()
21 * - dm_gpio_get_value() etc.
24 * --
26 * GPIOs are numbered from 0 to GPIO_COUNT-1 which value is defined
38 * an error value of -1.
51 * @return 0 if ok, -1 on error
53 int gpio_request(unsigned gpio, const char *label);
[all …]
/openbmc/linux/sound/soc/codecs/
H A Dwm1250-ev1.c1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Driver for the 1250-EV1 audio I/O module
15 #include <sound/soc-dapm.h>
16 #include <sound/wm1250-ev1.h>
27 struct gpio gpios[WM1250_EV1_NUM_GPIOS]; member
30 static int wm1250_ev1_set_bias_level(struct snd_soc_component *component, in wm1250_ev1_set_bias_level()
33 struct wm1250_priv *wm1250 = dev_get_drvdata(component->dev); in wm1250_ev1_set_bias_level()
34 int ena; in wm1250_ev1_set_bias_level()
37 ena = wm1250->gpios[WM1250_EV1_GPIO_CLK_ENA].gpio; in wm1250_ev1_set_bias_level()
39 ena = -1; in wm1250_ev1_set_bias_level()
[all …]
/openbmc/linux/Documentation/driver-api/gpio/
H A Dconsumer.rst6 it describes the new descriptor-based interface. For a description of the
7 deprecated integer-based GPIO interface please refer to legacy.rst.
10 Guidelines for GPIOs consumers
15 obtain and use GPIOs are available by including the following file::
23 - Simple compile coverage with e.g. COMPILE_TEST - it does not matter that
27 - Truly optional GPIOLIB support - where the driver does not really make use
28 of the GPIOs on certain compile-time configurations for certain systems, but
29 will use it under other compile-time configurations. In this case the
33 All the functions that work with the descriptor-based GPIO interface are
40 Obtaining and Disposing GPIOs
[all …]
/openbmc/linux/drivers/platform/x86/siemens/
H A Dsimatic-ipc-batt.c1 // SPDX-License-Identifier: GPL-2.0
20 #include <linux/hwmon-sysfs.h>
25 #include <linux/platform_data/x86/simatic-ipc-base.h>
28 #include "simatic-ipc-batt.h"
39 struct gpio_desc *gpios[3]; member
47 if (priv.gpios[2]) { in simatic_ipc_batt_read_gpio()
48 gpiod_set_value(priv.gpios[2], 1); in simatic_ipc_batt_read_gpio()
52 if (gpiod_get_value_cansleep(priv.gpios[0])) in simatic_ipc_batt_read_gpio()
54 else if (gpiod_get_value_cansleep(priv.gpios[1])) in simatic_ipc_batt_read_gpio()
57 if (priv.gpios[2]) in simatic_ipc_batt_read_gpio()
[all …]
/openbmc/linux/drivers/pinctrl/qcom/
H A Dpinctrl-qdf2xxx.c1 // SPDX-License-Identifier: GPL-2.0-only
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
14 * a GPIO-only driver. The alternative is to duplicate the GPIO code of
15 * pinctrl-msm.c into another driver.
23 #include "pinctrl-msm.h"
31 static int qdf2xxx_pinctrl_probe(struct platform_device *pdev) in qdf2xxx_pinctrl_probe()
37 unsigned int i; in qdf2xxx_pinctrl_probe()
39 unsigned int avail_gpios; /* The number of GPIOs we support */ in qdf2xxx_pinctrl_probe()
[all …]
/openbmc/u-boot/drivers/board/
H A Dgazerbeam.c1 // SPDX-License-Identifier: GPL-2.0+
16 static const int I2C_BUS_SEQ_NO = 1;
19 static const int MC2_EXPANDER_ADDR = 0x20;
21 static const int MC4_EXPANDER_ADDR = 0x22;
24 static const int SC_GPIO_NO;
26 static const int CON_GPIO_NO = 1;
29 * struct board_gazerbeam_priv - Private data structure for the gazerbeam board
31 * @reset_gpios: GPIOs for the board's reset GPIOs.
32 * @var_gpios: GPIOs for the board's hardware variant GPIOs
33 * @ver_gpios: GPIOs for the board's hardware version GPIOs
[all …]
/openbmc/linux/drivers/net/mdio/
H A Dmdio-mux-gpio.c1 // SPDX-License-Identifier: GPL-2.0
8 #include <linux/mdio-mux.h>
18 struct gpio_descs *gpios; member
22 static int mdio_mux_gpio_switch_fn(int current_child, int desired_child, in mdio_mux_gpio_switch_fn()
33 gpiod_set_array_value_cansleep(s->gpios->ndescs, s->gpios->desc, in mdio_mux_gpio_switch_fn()
34 s->gpios->info, values); in mdio_mux_gpio_switch_fn()
39 static int mdio_mux_gpio_probe(struct platform_device *pdev) in mdio_mux_gpio_probe()
42 struct gpio_descs *gpios; in mdio_mux_gpio_probe() local
43 int r; in mdio_mux_gpio_probe()
45 gpios = devm_gpiod_get_array(&pdev->dev, NULL, GPIOD_OUT_LOW); in mdio_mux_gpio_probe()
[all …]
/openbmc/linux/drivers/hwmon/
H A Dgpio-fan.c1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * gpio-fan.c - Hwmon driver for fans connected to GPIO lines.
26 int rpm;
27 int ctrl_val;
35 struct mutex lock; /* lock GPIOs operations. */
36 int num_gpios;
37 struct gpio_desc **gpios; member
38 int num_speed;
40 int speed_index;
41 int resume_speed;
[all …]
/openbmc/linux/drivers/gpu/drm/panel/
H A Dpanel-ronbo-rb070d30.c1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2018-2019, Bridge Systems BV
4 * Copyright (C) 2018-2019, Bootlin
7 * This file based on panel-ilitek-ili9881c.c
15 #include <linux/media-bus-format.h>
37 } gpios; member
45 static int rb070d30_panel_prepare(struct drm_panel *panel) in rb070d30_panel_prepare()
48 int ret; in rb070d30_panel_prepare()
50 ret = regulator_enable(ctx->supply); in rb070d30_panel_prepare()
52 dev_err(&ctx->dsi->dev, "Failed to enable supply: %d\n", ret); in rb070d30_panel_prepare()
[all …]
/openbmc/linux/arch/arm/boot/dts/intel/ixp/
H A Dintel-ixp42x-goramo-multilink.dts1 // SPDX-License-Identifier: ISC
5 * - MultiLink Basic (a box)
6 * - MultiLink Max (19" rack mount)
9 * This is one of the few devices supporting the IXP4xx High-Speed Serial
14 /dts-v1/;
16 #include "intel-ixp42x.dtsi"
17 #include <dt-bindings/input/input.h>
21 compatible = "goramo,multilink-router", "intel,ixp42x";
22 #address-cells = <1>;
23 #size-cells = <1>;
[all …]
H A Dintel-ixp42x-linksys-nslu2.dts1 // SPDX-License-Identifier: ISC
6 /dts-v1/;
8 #include "intel-ixp42x.dtsi"
9 #include <dt-bindings/input/input.h>
14 #address-cells = <1>;
15 #size-cells = <1>;
25 stdout-path = "uart0:115200n8";
33 compatible = "gpio-leds";
34 led-status {
36 gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
[all …]
/openbmc/linux/drivers/hsi/clients/
H A Dnokia-modem.c1 // SPDX-License-Identifier: GPL-2.0-only
3 * nokia-modem.c
18 static unsigned int pm = 1;
19 module_param(pm, int, 0400);
30 int nokia_modem_rst_ind_irq;
32 struct nokia_modem_gpio *gpios; member
33 int gpio_amount;
45 dev_info(modem->device, "CMT rst line change detected\n"); in do_nokia_modem_rst_ind_tasklet()
47 if (modem->ssi_protocol) in do_nokia_modem_rst_ind_tasklet()
48 ssip_reset_event(modem->ssi_protocol); in do_nokia_modem_rst_ind_tasklet()
[all …]
/openbmc/linux/drivers/input/misc/
H A Drotary_encoder.c1 // SPDX-License-Identifier: GPL-2.0-only
11 * See file:Documentation/input/devices/rotary-encoder.rst for more information
26 #define DRV_NAME "rotary-encoder"
44 unsigned int pos;
46 struct gpio_descs *gpios; member
48 unsigned int *irq;
51 signed char dir; /* 1 - clockwise, -1 - CCW */
53 unsigned int last_stable;
56 static unsigned int rotary_encoder_get_state(struct rotary_encoder *encoder) in rotary_encoder_get_state()
58 int i; in rotary_encoder_get_state()
[all …]
/openbmc/u-boot/arch/powerpc/include/asm/
H A Dmpc85xx_gpio.h1 /* SPDX-License-Identifier: GPL-2.0+ */
12 * The following internal functions are an MPC85XX-specific GPIO API which
13 * allows setting and querying multiple GPIOs in a single operation.
17 * memory-mapped IO operation or two.
19 static inline void mpc85xx_gpio_set(unsigned int mask, in mpc85xx_gpio_set()
20 unsigned int dir, unsigned int val) in mpc85xx_gpio_set()
29 dir |= (in_be32(&gpio->gpdir) & ~mask); in mpc85xx_gpio_set()
30 val |= (in_be32(&gpio->gpdat) & ~mask); in mpc85xx_gpio_set()
37 out_be32(&gpio->gpdat, val); in mpc85xx_gpio_set()
38 out_be32(&gpio->gpdir, dir); in mpc85xx_gpio_set()
[all …]
/openbmc/u-boot/drivers/i2c/
H A Di2c-gpio.c5 * This file is based on: drivers/i2c/soft-i2c.c,
6 * with added driver-model support and code cleanup.
29 * udelay - delay [us] between GPIO toggle operations,
32 int udelay;
34 struct gpio_desc gpios[PIN_COUNT]; member
37 static int i2c_gpio_sda_get(struct gpio_desc *sda) in i2c_gpio_sda_get()
42 static void i2c_gpio_sda_set(struct gpio_desc *sda, int bit) in i2c_gpio_sda_set()
50 static void i2c_gpio_scl_set(struct gpio_desc *scl, int bit) in i2c_gpio_scl_set()
60 int delay, uchar bit) in i2c_gpio_write_bit()
70 static int i2c_gpio_read_bit(struct gpio_desc *scl, struct gpio_desc *sda, in i2c_gpio_read_bit()
[all …]
/openbmc/u-boot/test/dm/
H A Dgpio.c1 // SPDX-License-Identifier: GPL-2.0+
15 /* Test that sandbox GPIOs work correctly */
16 static int dm_test_gpio(struct unit_test_state *uts) in dm_test_gpio()
18 unsigned int offset, gpio; in dm_test_gpio()
22 int offset_count; in dm_test_gpio()
27 * comes from platdata. The other two are named a (20 gpios) in dm_test_gpio()
28 * and b (10 gpios) and come from the device tree. See in dm_test_gpio()
32 ut_asserteq_str(dev->name, "extra-gpios"); in dm_test_gpio()
42 ut_assert(ops->get_function); in dm_test_gpio()
45 ut_asserteq(-EBUSY, gpio_get_value(gpio + 1)); in dm_test_gpio()
[all …]

12345678910>>...41