Skip to content

Commit 4abae5b

Browse files
committed
Merge tag 'gpio-updates-for-v6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux
Pull gpio updates from Bartosz Golaszewski: "Thanks to little activity in December, this is really tiny. Just a few updates to drivers and device-tree bindings. Driver improvements: - support a new model in gpio-mpc8xxx - refactor gpio-tqmx86 and add support for direction setting - allow building gpio-omap with COMPILE_TEST=y - use gpiochip_get_data() instead of dev_get_drvdata() in gpio-twl6040 - drop unued field from driver data in gpio-altera - use generic request/free callbacks in gpio-regmap for better integration with pinctrl - use dev_err_probe() where applicable in gpio-pca953x - use existing dedicated GPIO defines in gpio-tps65219 instead of custom ones DT bindings: - document a new model in fsl,qoriq-gpio - explain the chip's latch clock pin and how it works like chip-select in fairchild,74hc595 - enable the gpio-line-names property for gpio-brcmstb" * tag 'gpio-updates-for-v6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: gpio: regmap: Use generic request/free ops gpio: altera: Drop .mapped_irq from driver data gpio: mpc8xxx: Add MPC8314 support dt-bindings: gpio: fsl,qoriq-gpio: Add compatible string fsl,mpc8314-gpio dt-bindings: gpio: fairchild,74hc595: Document chip select vs. latch clock gpio: tps65219: Use existing kernel gpio macros gpio: pca953x: log an error when failing to get the reset GPIO dt-bindings: gpio: brcmstb: permit gpio-line-names property gpio: tqmx86: add support for changing GPIO directions gpio: tqmx86: introduce tqmx86_gpio_clrsetbits() helper gpio: tqmx86: use cleanup guards for spinlock gpio: tqmx86: consistently refer to IRQs by hwirq numbers gpio: tqmx86: add macros for interrupt configuration gpio: omap: allow building the module with COMPILE_TEST=y gpio: twl4030: use gpiochip_get_data
2 parents 0ad9617 + b0fa00f commit 4abae5b

File tree

11 files changed

+160
-105
lines changed

11 files changed

+160
-105
lines changed

Documentation/devicetree/bindings/gpio/brcm,brcmstb-gpio.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ properties:
6464

6565
gpio-ranges: true
6666

67+
gpio-line-names:
68+
minItems: 1
69+
maxItems: 128
70+
6771
wakeup-source:
6872
type: boolean
6973
description: >

Documentation/devicetree/bindings/gpio/fairchild,74hc595.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,23 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
66

77
title: Generic 8-bit shift register
88

9+
description: |
10+
NOTE: These chips nominally don't have a chip select pin. They do however
11+
have a rising-edge triggered latch clock (or storage register clock) pin,
12+
which behaves like an active-low chip select.
13+
14+
After the bits are shifted into the shift register, CS# is driven high, which
15+
the 74HC595 sees as a rising edge on the latch clock that results in a
16+
transfer of the bits from the shift register to the storage register and thus
17+
to the output pins.
18+
_ _ _ _
19+
shift clock ____| |_| |_..._| |_| |_________
20+
21+
latch clock * trigger
22+
___ ________
23+
chip select# |___________________|
24+
25+
926
maintainers:
1027
- Maxime Ripard <mripard@kernel.org>
1128

Documentation/devicetree/bindings/gpio/fsl,qoriq-gpio.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ properties:
1515
- enum:
1616
- fsl,mpc5121-gpio
1717
- fsl,mpc5125-gpio
18+
- fsl,mpc8314-gpio
1819
- fsl,mpc8349-gpio
1920
- fsl,mpc8572-gpio
2021
- fsl,mpc8610-gpio

drivers/gpio/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,9 +529,9 @@ config GPIO_OCTEON
529529
family of SOCs.
530530

531531
config GPIO_OMAP
532-
tristate "TI OMAP GPIO support" if ARCH_OMAP2PLUS || COMPILE_TEST
532+
tristate "TI OMAP GPIO support"
533+
depends on ARCH_OMAP || COMPILE_TEST
533534
default y if ARCH_OMAP
534-
depends on ARM
535535
select GENERIC_IRQ_CHIP
536536
select GPIOLIB_IRQCHIP
537537
help

drivers/gpio/gpio-altera.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,12 @@
3232
* will be blocked until the current one completes.
3333
* @interrupt_trigger : specifies the hardware configured IRQ trigger type
3434
* (rising, falling, both, high)
35-
* @mapped_irq : kernel mapped irq number.
3635
*/
3736
struct altera_gpio_chip {
3837
struct gpio_chip gc;
3938
void __iomem *regs;
4039
raw_spinlock_t gpio_lock;
4140
int interrupt_trigger;
42-
int mapped_irq;
4341
};
4442

4543
static void altera_gpio_irq_unmask(struct irq_data *d)
@@ -235,6 +233,7 @@ static int altera_gpio_probe(struct platform_device *pdev)
235233
int reg, ret;
236234
struct altera_gpio_chip *altera_gc;
237235
struct gpio_irq_chip *girq;
236+
int mapped_irq;
238237

239238
altera_gc = devm_kzalloc(&pdev->dev, sizeof(*altera_gc), GFP_KERNEL);
240239
if (!altera_gc)
@@ -271,8 +270,8 @@ static int altera_gpio_probe(struct platform_device *pdev)
271270
if (IS_ERR(altera_gc->regs))
272271
return dev_err_probe(dev, PTR_ERR(altera_gc->regs), "failed to ioremap memory resource\n");
273272

274-
altera_gc->mapped_irq = platform_get_irq_optional(pdev, 0);
275-
if (altera_gc->mapped_irq < 0)
273+
mapped_irq = platform_get_irq_optional(pdev, 0);
274+
if (mapped_irq < 0)
276275
goto skip_irq;
277276

278277
if (device_property_read_u32(dev, "altr,interrupt-type", &reg)) {
@@ -296,7 +295,7 @@ static int altera_gpio_probe(struct platform_device *pdev)
296295
return -ENOMEM;
297296
girq->default_type = IRQ_TYPE_NONE;
298297
girq->handler = handle_bad_irq;
299-
girq->parents[0] = altera_gc->mapped_irq;
298+
girq->parents[0] = mapped_irq;
300299

301300
skip_irq:
302301
ret = devm_gpiochip_add_data(dev, &altera_gc->gc, altera_gc);

drivers/gpio/gpio-mpc8xxx.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ static const struct mpc8xxx_gpio_devtype mpc8xxx_gpio_devtype_default = {
285285
};
286286

287287
static const struct of_device_id mpc8xxx_gpio_ids[] = {
288+
{ .compatible = "fsl,mpc8314-gpio", },
288289
{ .compatible = "fsl,mpc8349-gpio", },
289290
{ .compatible = "fsl,mpc8572-gpio", .data = &mpc8572_gpio_devtype, },
290291
{ .compatible = "fsl,mpc8610-gpio", },

drivers/gpio/gpio-pca953x.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1088,7 +1088,8 @@ static int pca953x_probe(struct i2c_client *client)
10881088
*/
10891089
reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
10901090
if (IS_ERR(reset_gpio))
1091-
return PTR_ERR(reset_gpio);
1091+
return dev_err_probe(dev, PTR_ERR(reset_gpio),
1092+
"Failed to get reset gpio\n");
10921093
}
10931094

10941095
chip->client = client;

drivers/gpio/gpio-regmap.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,8 @@ struct gpio_regmap *gpio_regmap_register(const struct gpio_regmap_config *config
262262
chip->label = config->label ?: dev_name(config->parent);
263263
chip->can_sleep = regmap_might_sleep(config->regmap);
264264

265+
chip->request = gpiochip_generic_request;
266+
chip->free = gpiochip_generic_free;
265267
chip->get = gpio_regmap_get;
266268
if (gpio->reg_set_base && gpio->reg_clr_base)
267269
chip->set = gpio_regmap_set_with_clear;

drivers/gpio/gpio-tps65219.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
#define TPS65219_GPIO0_DIR_MASK BIT(3)
1616
#define TPS65219_GPIO0_OFFSET 2
1717
#define TPS65219_GPIO0_IDX 0
18-
#define TPS65219_GPIO_DIR_IN 1
19-
#define TPS65219_GPIO_DIR_OUT 0
2018

2119
struct tps65219_gpio {
2220
struct gpio_chip gpio_chip;
@@ -61,7 +59,7 @@ static int tps65219_gpio_get(struct gpio_chip *gc, unsigned int offset)
6159
* status bit.
6260
*/
6361

64-
if (tps65219_gpio_get_direction(gc, offset) == TPS65219_GPIO_DIR_OUT)
62+
if (tps65219_gpio_get_direction(gc, offset) == GPIO_LINE_DIRECTION_OUT)
6563
return -ENOTSUPP;
6664

6765
return ret;
@@ -124,10 +122,10 @@ static int tps65219_gpio_direction_input(struct gpio_chip *gc, unsigned int offs
124122
return -ENOTSUPP;
125123
}
126124

127-
if (tps65219_gpio_get_direction(gc, offset) == TPS65219_GPIO_DIR_IN)
125+
if (tps65219_gpio_get_direction(gc, offset) == GPIO_LINE_DIRECTION_IN)
128126
return 0;
129127

130-
return tps65219_gpio_change_direction(gc, offset, TPS65219_GPIO_DIR_IN);
128+
return tps65219_gpio_change_direction(gc, offset, GPIO_LINE_DIRECTION_IN);
131129
}
132130

133131
static int tps65219_gpio_direction_output(struct gpio_chip *gc, unsigned int offset, int value)
@@ -136,10 +134,10 @@ static int tps65219_gpio_direction_output(struct gpio_chip *gc, unsigned int off
136134
if (offset != TPS65219_GPIO0_IDX)
137135
return 0;
138136

139-
if (tps65219_gpio_get_direction(gc, offset) == TPS65219_GPIO_DIR_OUT)
137+
if (tps65219_gpio_get_direction(gc, offset) == GPIO_LINE_DIRECTION_OUT)
140138
return 0;
141139

142-
return tps65219_gpio_change_direction(gc, offset, TPS65219_GPIO_DIR_OUT);
140+
return tps65219_gpio_change_direction(gc, offset, GPIO_LINE_DIRECTION_OUT);
143141
}
144142

145143
static const struct gpio_chip tps65219_template_chip = {

0 commit comments

Comments
 (0)