/linux/drivers/pinctrl/qcom/ |
H A D | pinctrl-ssbi-gpio.c | 1 // SPDX-License-Identifier: GPL-2.0-only 17 #include <linux/pinctrl/pinconf-generic.h> 22 #include <dt-bindings/pinctrl/qcom,pmic-gpio.h> 25 #include "../pinctrl-utils.h" 59 * struct pm8xxx_pin_data - dynamic configuration for a pin 63 * @mode: operating mode for the pin (input/output) 64 * @open_drain: output buffer configured as open-drain (vs push-pull) 69 * @output_strength: selector of output-strength 70 * @disable: pin disabled / configured as tristate 72 * @inverted: pin logic is inverted [all …]
|
H A D | pinctrl-spmi-mpp.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. 16 #include <linux/pinctrl/pinconf-generic.h> 20 #include <dt-bindings/pinctrl/qcom,pmic-mpp.h> 23 #include "../pinctrl-utils.h" 28 * Pull Up Values - it indicates whether a pull-up should be 99 /* Qualcomm specific pin configurations */ 106 * struct pmic_mpp_pad - keep current MPP settings 109 * @out_value: Cached pin output value. 112 * @paired: Pin operates in paired mode [all …]
|
H A D | pinctrl-lpass-lpi.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved. 15 #include <linux/pinctrl/pinconf-generic.h> 19 #include "../pinctrl-utils.h" 21 #include "pinctrl-lpass-lpi.h" 41 static int lpi_gpio_read(struct lpi_pinctrl *state, unsigned int pin, in lpi_gpio_read() argument 44 return ioread32(state->tlmm_base + LPI_TLMM_REG_OFFSET * pin + addr); in lpi_gpio_read() 47 static int lpi_gpio_write(struct lpi_pinctrl *state, unsigned int pin, in lpi_gpio_write() argument 48 unsigned int addr, unsigned int val) in lpi_gpio_write() argument 50 iowrite32(val, state->tlmm_base + LPI_TLMM_REG_OFFSET * pin + addr); in lpi_gpio_write() [all …]
|
/linux/drivers/net/dsa/mv88e6xxx/ |
H A D | global2_scratch.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 45 * mv88e6xxx_g2_scratch_get_bit - get a bit 57 u8 val; in mv88e6xxx_g2_scratch_get_bit() local 60 err = mv88e6xxx_g2_scratch_read(chip, reg, &val); in mv88e6xxx_g2_scratch_get_bit() 64 *set = !!(mask & val); in mv88e6xxx_g2_scratch_get_bit() 70 * mv88e6xxx_g2_scratch_set_bit - set (or clear) a bit 84 u8 val; in mv88e6xxx_g2_scratch_set_bit() local 87 err = mv88e6xxx_g2_scratch_read(chip, reg, &val); in mv88e6xxx_g2_scratch_set_bit() 92 val |= mask; in mv88e6xxx_g2_scratch_set_bit() 94 val &= ~mask; in mv88e6xxx_g2_scratch_set_bit() [all …]
|
/linux/drivers/pinctrl/sprd/ |
H A D | pinctrl-sprd.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Spreadtrum pin controller driver 4 * Copyright (C) 2017 Spreadtrum - http://www.spreadtrum.com 20 #include <linux/pinctrl/pinconf-generic.h> 28 #include "../pinctrl-utils.h" 29 #include "pinctrl-sprd.h" 99 * struct sprd_pin: represent one pin's description 100 * @name: pin name 101 * @number: pin number 102 * @type: pin type, can be GLOBAL_CTRL_PIN/COMMON_PIN/MISC_PIN [all …]
|
/linux/drivers/usb/misc/ |
H A D | brcmstb-usb-pinmap.c | 1 // SPDX-License-Identifier: GPL-2.0 44 u32 val; in pinmap_set() local 46 val = readl(reg); in pinmap_set() 47 val |= mask; in pinmap_set() 48 writel(val, reg); in pinmap_set() 53 u32 val; in pinmap_unset() local 55 val = readl(reg); in pinmap_unset() 56 val &= ~mask; in pinmap_unset() 57 writel(val, reg); in pinmap_unset() 60 static void sync_in_pin(struct in_pin *pin) in sync_in_pin() argument [all …]
|
/linux/drivers/gpu/drm/loongson/ |
H A D | lsdc_i2c.c | 1 // SPDX-License-Identifier: GPL-2.0+ 12 * __lsdc_gpio_i2c_set - set the state of a gpio pin indicated by mask 13 * @mask: gpio pin mask 18 struct lsdc_device *ldev = to_lsdc(li2c->ddev); in __lsdc_gpio_i2c_set() 20 u8 val; in __lsdc_gpio_i2c_set() local 22 spin_lock_irqsave(&ldev->reglock, flags); in __lsdc_gpio_i2c_set() 26 * Setting this pin as input directly, write 1 for input. in __lsdc_gpio_i2c_set() 27 * The external pull-up resistor will pull the level up in __lsdc_gpio_i2c_set() 29 val = readb(li2c->dir_reg); in __lsdc_gpio_i2c_set() 30 val |= mask; in __lsdc_gpio_i2c_set() [all …]
|
/linux/drivers/pinctrl/visconti/ |
H A D | pinctrl-common.c | 1 // SPDX-License-Identifier: GPL-2.0 15 #include <linux/pinctrl/pinconf-generic.h> 16 #include "pinctrl-common.h" 19 #include "../pinctrl-utils.h" 42 const struct visconti_desc_pin *pin = &priv->devdata->pins[_pin]; in visconti_pin_config_set() local 46 unsigned int val, set_val, pude_val; in visconti_pin_config_set() local 49 dev_dbg(priv->dev, "%s: pin = %d (%s)\n", __func__, _pin, pin->pin.name); in visconti_pin_config_set() 51 spin_lock_irqsave(&priv->lock, flags); in visconti_pin_config_set() 64 val = readl(priv->base + pin->pudsel_offset); in visconti_pin_config_set() 65 val &= ~BIT(pin->pud_shift); in visconti_pin_config_set() [all …]
|
/linux/drivers/pinctrl/ |
H A D | pinctrl-keembay.c | 1 // SPDX-License-Identifier: GPL-2.0 12 #include <linux/pinctrl/pinconf-generic.h> 58 #define KEEMBAY_GPIO_REG_OFFSET(pin) ((pin) * 4) argument 61 * struct keembay_mux_desc - Mux properties of each GPIO pin 62 * @mode: Pin mode when operating in this function 63 * @name: Pin function name 83 * struct keembay_gpio_irq - Config of each GPIO Interrupt sources 84 * @source: Interrupt source number (0 - 7) 99 * struct keembay_pinctrl - Intel Keembay pinctrl structure 100 * @pctrl: Pointer to the pin controller device [all …]
|
H A D | pinctrl-pistachio.c | 1 // SPDX-License-Identifier: GPL-2.0-only 15 #include <linux/pinctrl/pinconf-generic.h> 24 #include "pinctrl-utils.h" 27 #define PADS_SCHMITT_EN_REG(pin) (PADS_SCHMITT_EN0 + 0x4 * ((pin) / 32)) argument 28 #define PADS_SCHMITT_EN_BIT(pin) BIT((pin) % 32) argument 31 #define PADS_PU_PD_REG(pin) (PADS_PU_PD0 + 0x4 * ((pin) / 16)) argument 32 #define PADS_PU_PD_SHIFT(pin) (2 * ((pin) % 16)) argument 45 #define PADS_SLEW_RATE_REG(pin) (PADS_SLEW_RATE0 + 0x4 * ((pin) / 32)) argument 46 #define PADS_SLEW_RATE_BIT(pin) BIT((pin) % 32) argument 49 #define PADS_DRIVE_STRENGTH_REG(pin) \ argument [all …]
|
H A D | pinctrl-aw9523.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Awinic AW9523B i2c pin controller driver 22 #include <linux/pinctrl/pinconf-generic.h> 32 * HW needs at least 20uS for reset and at least 1-2uS to recover from 40 /* Port 0: P0_0...P0_7 - Port 1: P1_0...P1_7 */ 41 #define AW9523_PIN_TO_PORT(pin) (pin >> 3) argument 42 #define AW9523_REG_IN_STATE(pin) (0x00 + AW9523_PIN_TO_PORT(pin)) argument 43 #define AW9523_REG_OUT_STATE(pin) (0x02 + AW9523_PIN_TO_PORT(pin)) argument 44 #define AW9523_REG_CONF_STATE(pin) (0x04 + AW9523_PIN_TO_PORT(pin)) argument 45 #define AW9523_REG_INTR_DIS(pin) (0x06 + AW9523_PIN_TO_PORT(pin)) argument [all …]
|
H A D | pinctrl-eyeq5.c | 1 // SPDX-License-Identifier: GPL-2.0-only 5 * The registers are located in a syscon region called OLB. There are two pin 7 * pull-down, pull-up, drive strength and muxing. 9 * For each pin, muxing is between two functions: (0) GPIO or (1) another one 10 * that is pin-dependent. Functions are declared statically in this driver. 13 * single pin, and its index/selector is the pin number. 15 * We use eq5p_ as prefix, as-in "EyeQ5 Pinctrl", but way shorter. 33 #include <linux/pinctrl/pinconf-generic.h> 39 #include "pinctrl-utils.h" 69 * Drive strength; two bits per pin. [all …]
|
H A D | pinctrl-st.c | 1 // SPDX-License-Identifier: GPL-2.0-only 78 * each register is dedicated per pin. 100 * (direction, retime-type, retime-clk, retime-delay) 102 * +----------------+ 103 *[31:28]| reserved-3 | 104 * +----------------+------------- 106 * +----------------+ v 108 * +----------------+ ^ 110 * +----------------+------------- 111 *[24] | reserved-2 | [all …]
|
/linux/sound/pci/lola/ |
H A D | lola_mixer.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * Support for Digigram Lola PCI-e boards 18 static int lola_init_pin(struct lola *chip, struct lola_pin *pin, in lola_init_pin() argument 21 unsigned int val; in lola_init_pin() local 24 pin->nid = nid; in lola_init_pin() 25 err = lola_read_param(chip, nid, LOLA_PAR_AUDIO_WIDGET_CAP, &val); in lola_init_pin() 27 dev_err(chip->card->dev, "Can't read wcaps for 0x%x\n", nid); in lola_init_pin() 30 val &= 0x00f00fff; /* test TYPE and bits 0..11 */ in lola_init_pin() 31 if (val == 0x00400200) /* Type = 4, Digital = 1 */ in lola_init_pin() 32 pin->is_analog = false; in lola_init_pin() [all …]
|
/linux/drivers/pinctrl/stm32/ |
H A D | pinctrl-stm32.c | 1 // SPDX-License-Identifier: GPL-2.0 28 #include <linux/pinctrl/pinconf-generic.h> 35 #include "../pinctrl-utils.h" 36 #include "pinctrl-stm32.h" 50 /* custom bitfield to backup pin status */ 84 unsigned pin; member 149 return function - 1; in stm32_gpio_get_alt() 160 bank->pin_backup[offset] &= ~BIT(STM32_GPIO_BKP_VAL); in stm32_gpio_backup_value() 161 bank->pin_backup[offset] |= value << STM32_GPIO_BKP_VAL; in stm32_gpio_backup_value() 167 bank->pin_backup[offset] &= ~(STM32_GPIO_BKP_MODE_MASK | in stm32_gpio_backup_mode() [all …]
|
/linux/drivers/pinctrl/sunxi/ |
H A D | pinctrl-sunxi.c | 6 * Maxime Ripard <maxime.ripard@free-electrons.com> 28 #include <linux/pinctrl/pinconf-generic.h> 33 #include <dt-bindings/pinctrl/sun4i-a10.h> 36 #include "pinctrl-sunxi.h" 51 * - Mux config 52 * - Data value 53 * - Drive level 54 * - Pull direction 59 * They take a pin number which is relative to the start of the current device. 62 u32 pin, u32 *reg, u32 *shift, u32 *mask) in sunxi_mux_reg() argument [all …]
|
/linux/drivers/pinctrl/meson/ |
H A D | pinctrl-meson.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Pin controller and GPIO driver for Amlogic Meson SoCs 14 * The AO bank is special because it belongs to the Always-On power 18 * For each pin controller there are 4 different register ranges that 20 * 1) pin muxing 46 #include <linux/pinctrl/pinconf-generic.h> 56 #include "../pinctrl-utils.h" 57 #include "pinctrl-meson.h" 64 * meson_get_bank() - find the bank containing a given pin 67 * @pin: the pin number [all …]
|
/linux/drivers/pinctrl/spear/ |
H A D | pinctrl-plgpio.c | 27 #define PIN_OFFSET(pin) (pin % MAX_GPIO_PER_REG) argument 28 #define REG_OFFSET(base, reg, pin) (base + reg + (pin / MAX_GPIO_PER_REG) \ argument 59 * p2o: function ptr for pin to offset conversion. This is required only for 60 * machines where mapping b/w pin and offset is not 1-to-1. 61 * o2p: function ptr for offset to pin conversion. This is required only for 62 * machines where mapping b/w pin and offset is not 1-to-1. 72 int (*p2o)(int pin); /* pin_to_offset */ 82 static inline u32 is_plgpio_set(struct regmap *regmap, u32 pin, u32 reg) in is_plgpio_set() argument 84 u32 offset = PIN_OFFSET(pin); in is_plgpio_set() 85 u32 reg_off = REG_OFFSET(0, reg, pin); in is_plgpio_set() [all …]
|
/linux/drivers/leds/ |
H A D | leds-bcm6328.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * Driver for BCM6328 memory-mapped LEDs, based on leds-syscon.c 59 * struct bcm6328_led - state container for bcm6328 based LEDs 63 * @pin: LED pin number 72 unsigned long pin; member 98 * bits [31:0] -> LEDs 8-23 99 * bits [47:32] -> LEDs 0-7 100 * bits [63:48] -> unused 102 static unsigned long bcm6328_pin2shift(unsigned long pin) in bcm6328_pin2shift() argument 104 if (pin < 8) in bcm6328_pin2shift() [all …]
|
/linux/drivers/pinctrl/uniphier/ |
H A D | pinctrl-uniphier-core.c | 1 // SPDX-License-Identifier: GPL-2.0+ 3 // Copyright (C) 2015-2017 Socionext Inc. 13 #include <linux/pinctrl/pinconf-generic.h> 19 #include "../pinctrl-utils.h" 20 #include "pinctrl-uniphier.h" 49 return priv->socdata->groups_count; in uniphier_pctl_get_groups_count() 57 return priv->socdata->groups[selector].name; in uniphier_pctl_get_group_name() 67 *pins = priv->socdata->groups[selector].pins; in uniphier_pctl_get_group_pins() 68 *num_pins = priv->socdata->groups[selector].num_pins; in uniphier_pctl_get_group_pins() 80 switch (uniphier_pin_get_pull_dir(desc->drv_data)) { in uniphier_pctl_pin_dbg_show() [all …]
|
/linux/drivers/pinctrl/realtek/ |
H A D | pinctrl-rtd.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * Realtek DHC pin controller driver 15 #include <linux/pinctrl/pinconf-generic.h> 23 #include "../pinctrl-utils.h" 24 #include "pinctrl-rtd.h" 41 {"realtek,drive-strength-p", RTD_DRIVE_STRENGH_P, 0}, 42 {"realtek,drive-strength-n", RTD_DRIVE_STRENGH_N, 0}, 43 {"realtek,duty-cycle", RTD_DUTY_CYCLE, 0}, 50 return data->info->num_groups; in rtd_pinctrl_get_groups_count() 58 return data->info->groups[selector].name; in rtd_pinctrl_get_group_name() [all …]
|
/linux/drivers/pinctrl/bcm/ |
H A D | pinctrl-ns2-mux.c | 1 // SPDX-License-Identifier: GPL-2.0-only 6 * corresponding mfio pin group is selected as gpio. 16 #include <linux/pinctrl/pinconf-generic.h> 22 #include "../pinctrl-utils.h" 87 * Northstar2 mux function and supported pin groups 133 * Pin configuration info 139 * @pull_shift: pull-up/pull-down control bit shift in the register 152 * Description of a pin in Northstar2 154 * @pin: pin number 155 * @name: pin name [all …]
|
/linux/drivers/gpu/drm/i915/display/ |
H A D | intel_hotplug_irq.c | 1 // SPDX-License-Identifier: MIT 16 typedef bool (*long_pulse_detect_func)(enum hpd_pin pin, u32 val); 18 typedef u32 (*hotplug_mask_func)(enum hpd_pin pin); 136 struct intel_hotplug *hpd = &dev_priv->display.hotplug; in intel_hpd_init_pins() 141 hpd->hpd = hpd_status_g4x; in intel_hpd_init_pins() 143 hpd->hpd = hpd_status_i915; in intel_hpd_init_pins() 148 hpd->hpd = hpd_xelpdp; in intel_hpd_init_pins() 150 hpd->hpd = hpd_gen11; in intel_hpd_init_pins() 152 hpd->hpd = hpd_bxt; in intel_hpd_init_pins() 154 hpd->hpd = NULL; /* no north HPD on SKL */ in intel_hpd_init_pins() [all …]
|
/linux/drivers/media/usb/dvb-usb-v2/ |
H A D | mxl111sf-gpio.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * mxl111sf-gpio.c - driver for the MaxLinear MXL111SF 5 * Copyright (C) 2010-2014 Michael Krufky <mkrufky@linuxtv.org> 8 #include "mxl111sf-gpio.h" 9 #include "mxl111sf-i2c.h" 12 /* ------------------------------------------------------------------------- */ 22 static int mxl111sf_set_gpo_state(struct mxl111sf_state *state, u8 pin, u8 val) in mxl111sf_set_gpo_state() argument 27 mxl_debug_adv("(%d, %d)", pin, val); in mxl111sf_set_gpo_state() 29 if ((pin > 0) && (pin < 8)) { in mxl111sf_set_gpo_state() 33 tmp &= ~(1 << (pin - 1)); in mxl111sf_set_gpo_state() [all …]
|
/linux/sound/pci/hda/ |
H A D | hda_generic.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 32 * snd_hda_gen_spec_init - initialize hda_gen_spec struct 39 snd_array_init(&spec->kctls, sizeof(struct snd_kcontrol_new), 32); in snd_hda_gen_spec_init() 40 snd_array_init(&spec->paths, sizeof(struct nid_path), 8); in snd_hda_gen_spec_init() 41 snd_array_init(&spec->loopback_list, sizeof(struct hda_amp_list), 8); in snd_hda_gen_spec_init() 42 mutex_init(&spec->pcm_mutex); in snd_hda_gen_spec_init() 48 * snd_hda_gen_add_kctl - Add a new kctl_new struct from the template 62 struct snd_kcontrol_new *knew = snd_array_new(&spec->kctls); in snd_hda_gen_add_kctl() 67 knew->name = kstrdup(name, GFP_KERNEL); in snd_hda_gen_add_kctl() 68 else if (knew->name) in snd_hda_gen_add_kctl() [all …]
|