Skip to content

Commit 64f89f6

Browse files
author
Bartosz Golaszewski
committed
gpio: generic: rename BGPIOF_ flags to GPIO_GENERIC_
Make the flags passed to gpio_generic_chip_init() use the same prefix as the rest of the modernized generic GPIO chip API. Link: https://lore.kernel.org/r/20250917-gpio-generic-flags-v1-1-69f51fee8c89@linaro.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
1 parent fc51149 commit 64f89f6

22 files changed

Lines changed: 47 additions & 45 deletions

drivers/gpio/gpio-amdpt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ static int pt_gpio_probe(struct platform_device *pdev)
9494
.dat = pt_gpio->reg_base + PT_INPUTDATA_REG,
9595
.set = pt_gpio->reg_base + PT_OUTPUTDATA_REG,
9696
.dirout = pt_gpio->reg_base + PT_DIRECTION_REG,
97-
.flags = BGPIOF_READ_OUTPUT_REG_SET,
97+
.flags = GPIO_GENERIC_READ_OUTPUT_REG_SET,
9898
};
9999

100100
ret = gpio_generic_chip_init(&pt_gpio->chip, &config);

drivers/gpio/gpio-brcmstb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ static int brcmstb_gpio_probe(struct platform_device *pdev)
630630
* else leave I/O in little endian mode.
631631
*/
632632
#if defined(CONFIG_MIPS) && defined(__BIG_ENDIAN)
633-
flags = BGPIOF_BIG_ENDIAN_BYTE_ORDER;
633+
flags = GPIO_GENERIC_BIG_ENDIAN_BYTE_ORDER;
634634
#endif
635635

636636
of_property_for_each_u32(np, "brcm,gpio-bank-widths", bank_width) {

drivers/gpio/gpio-cadence.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ static int cdns_gpio_probe(struct platform_device *pdev)
181181
config.dat = cgpio->regs + CDNS_GPIO_INPUT_VALUE;
182182
config.set = cgpio->regs + CDNS_GPIO_OUTPUT_VALUE;
183183
config.dirin = cgpio->regs + CDNS_GPIO_DIRECTION_MODE;
184-
config.flags = BGPIOF_READ_OUTPUT_REG_SET;
184+
config.flags = GPIO_GENERIC_READ_OUTPUT_REG_SET;
185185

186186
ret = gpio_generic_chip_init(&cgpio->gen_gc, &config);
187187
if (ret) {

drivers/gpio/gpio-ge.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ static int __init gef_gpio_probe(struct platform_device *pdev)
7373
.dat = regs + GEF_GPIO_IN,
7474
.set = regs + GEF_GPIO_OUT,
7575
.dirin = regs + GEF_GPIO_DIRECT,
76-
.flags = BGPIOF_BIG_ENDIAN_BYTE_ORDER,
76+
.flags = GPIO_GENERIC_BIG_ENDIAN_BYTE_ORDER,
7777
};
7878

7979
ret = gpio_generic_chip_init(chip, &config);

drivers/gpio/gpio-grgpio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ static int grgpio_probe(struct platform_device *ofdev)
359359
.dat = regs + GRGPIO_DATA,
360360
.set = regs + GRGPIO_OUTPUT,
361361
.dirout = regs + GRGPIO_DIR,
362-
.flags = BGPIOF_BIG_ENDIAN_BYTE_ORDER,
362+
.flags = GPIO_GENERIC_BIG_ENDIAN_BYTE_ORDER,
363363
};
364364

365365
gc = &priv->chip.gc;

drivers/gpio/gpio-hisi.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,8 @@ static int hisi_gpio_probe(struct platform_device *pdev)
300300
.clr = hisi_gpio->reg_base + HISI_GPIO_SWPORT_DR_CLR_WX,
301301
.dirout = hisi_gpio->reg_base + HISI_GPIO_SWPORT_DDR_SET_WX,
302302
.dirin = hisi_gpio->reg_base + HISI_GPIO_SWPORT_DDR_CLR_WX,
303-
.flags = BGPIOF_NO_SET_ON_INPUT | BGPIOF_UNREADABLE_REG_DIR,
303+
.flags = GPIO_GENERIC_NO_SET_ON_INPUT |
304+
GPIO_GENERIC_UNREADABLE_REG_DIR,
304305
};
305306

306307
ret = gpio_generic_chip_init(&hisi_gpio->chip, &config);

drivers/gpio/gpio-hlwd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ static int hlwd_gpio_probe(struct platform_device *pdev)
253253
.dat = hlwd->regs + HW_GPIOB_IN,
254254
.set = hlwd->regs + HW_GPIOB_OUT,
255255
.dirout = hlwd->regs + HW_GPIOB_DIR,
256-
.flags = BGPIOF_BIG_ENDIAN_BYTE_ORDER,
256+
.flags = GPIO_GENERIC_BIG_ENDIAN_BYTE_ORDER,
257257
};
258258

259259
res = gpio_generic_chip_init(&hlwd->gpioc, &config);

drivers/gpio/gpio-ixp4xx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ static int ixp4xx_gpio_probe(struct platform_device *pdev)
289289
* for big endian.
290290
*/
291291
#if defined(CONFIG_CPU_BIG_ENDIAN)
292-
flags = BGPIOF_BIG_ENDIAN_BYTE_ORDER;
292+
flags = GPIO_GENERIC_BIG_ENDIAN_BYTE_ORDER;
293293
#else
294294
flags = 0;
295295
#endif

drivers/gpio/gpio-mmio.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -554,16 +554,16 @@ static int bgpio_setup_io(struct gpio_generic_chip *chip,
554554
chip->reg_set = cfg->set;
555555
gc->set = bgpio_set_set;
556556
gc->set_multiple = bgpio_set_multiple_set;
557-
} else if (cfg->flags & BGPIOF_NO_OUTPUT) {
557+
} else if (cfg->flags & GPIO_GENERIC_NO_OUTPUT) {
558558
gc->set = bgpio_set_none;
559559
gc->set_multiple = NULL;
560560
} else {
561561
gc->set = bgpio_set;
562562
gc->set_multiple = bgpio_set_multiple;
563563
}
564564

565-
if (!(cfg->flags & BGPIOF_UNREADABLE_REG_SET) &&
566-
(cfg->flags & BGPIOF_READ_OUTPUT_REG_SET)) {
565+
if (!(cfg->flags & GPIO_GENERIC_UNREADABLE_REG_SET) &&
566+
(cfg->flags & GPIO_GENERIC_READ_OUTPUT_REG_SET)) {
567567
gc->get = bgpio_get_set;
568568
if (!chip->be_bits)
569569
gc->get_multiple = bgpio_get_set_multiple;
@@ -593,19 +593,19 @@ static int bgpio_setup_direction(struct gpio_generic_chip *chip,
593593
if (cfg->dirout || cfg->dirin) {
594594
chip->reg_dir_out = cfg->dirout;
595595
chip->reg_dir_in = cfg->dirin;
596-
if (cfg->flags & BGPIOF_NO_SET_ON_INPUT)
596+
if (cfg->flags & GPIO_GENERIC_NO_SET_ON_INPUT)
597597
gc->direction_output = bgpio_dir_out_dir_first;
598598
else
599599
gc->direction_output = bgpio_dir_out_val_first;
600600
gc->direction_input = bgpio_dir_in;
601601
gc->get_direction = bgpio_get_dir;
602602
} else {
603-
if (cfg->flags & BGPIOF_NO_OUTPUT)
603+
if (cfg->flags & GPIO_GENERIC_NO_OUTPUT)
604604
gc->direction_output = bgpio_dir_out_err;
605605
else
606606
gc->direction_output = bgpio_simple_dir_out;
607607

608-
if (cfg->flags & BGPIOF_NO_INPUT)
608+
if (cfg->flags & GPIO_GENERIC_NO_INPUT)
609609
gc->direction_input = bgpio_dir_in_err;
610610
else
611611
gc->direction_input = bgpio_simple_dir_in;
@@ -654,7 +654,7 @@ int gpio_generic_chip_init(struct gpio_generic_chip *chip,
654654
gc->label = dev_name(dev);
655655
gc->base = -1;
656656
gc->request = bgpio_request;
657-
chip->be_bits = !!(flags & BGPIOF_BIG_ENDIAN);
657+
chip->be_bits = !!(flags & GPIO_GENERIC_BIG_ENDIAN);
658658

659659
ret = gpiochip_get_ngpios(gc, dev);
660660
if (ret)
@@ -665,33 +665,33 @@ int gpio_generic_chip_init(struct gpio_generic_chip *chip,
665665
return ret;
666666

667667
ret = bgpio_setup_accessors(dev, chip,
668-
flags & BGPIOF_BIG_ENDIAN_BYTE_ORDER);
668+
flags & GPIO_GENERIC_BIG_ENDIAN_BYTE_ORDER);
669669
if (ret)
670670
return ret;
671671

672672
ret = bgpio_setup_direction(chip, cfg);
673673
if (ret)
674674
return ret;
675675

676-
if (flags & BGPIOF_PINCTRL_BACKEND) {
676+
if (flags & GPIO_GENERIC_PINCTRL_BACKEND) {
677677
chip->pinctrl = true;
678678
/* Currently this callback is only used for pincontrol */
679679
gc->free = gpiochip_generic_free;
680680
}
681681

682682
chip->sdata = chip->read_reg(chip->reg_dat);
683683
if (gc->set == bgpio_set_set &&
684-
!(flags & BGPIOF_UNREADABLE_REG_SET))
684+
!(flags & GPIO_GENERIC_UNREADABLE_REG_SET))
685685
chip->sdata = chip->read_reg(chip->reg_set);
686686

687-
if (flags & BGPIOF_UNREADABLE_REG_DIR)
687+
if (flags & GPIO_GENERIC_UNREADABLE_REG_DIR)
688688
chip->dir_unreadable = true;
689689

690690
/*
691691
* Inspect hardware to find initial direction setting.
692692
*/
693693
if ((chip->reg_dir_out || chip->reg_dir_in) &&
694-
!(flags & BGPIOF_UNREADABLE_REG_DIR)) {
694+
!(flags & GPIO_GENERIC_UNREADABLE_REG_DIR)) {
695695
if (chip->reg_dir_out)
696696
chip->sdir = chip->read_reg(chip->reg_dir_out);
697697
else if (chip->reg_dir_in)
@@ -787,10 +787,10 @@ static int bgpio_pdev_probe(struct platform_device *pdev)
787787
return -ENOMEM;
788788

789789
if (device_is_big_endian(dev))
790-
flags |= BGPIOF_BIG_ENDIAN_BYTE_ORDER;
790+
flags |= GPIO_GENERIC_BIG_ENDIAN_BYTE_ORDER;
791791

792792
if (device_property_read_bool(dev, "no-output"))
793-
flags |= BGPIOF_NO_OUTPUT;
793+
flags |= GPIO_GENERIC_NO_OUTPUT;
794794

795795
config = (struct gpio_generic_chip_config) {
796796
.dev = dev,

drivers/gpio/gpio-mpc8xxx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,13 +350,13 @@ static int mpc8xxx_probe(struct platform_device *pdev)
350350
.sz = 4,
351351
.dat = mpc8xxx_gc->regs + GPIO_DAT,
352352
.dirout = mpc8xxx_gc->regs + GPIO_DIR,
353-
.flags = BGPIOF_BIG_ENDIAN
353+
.flags = GPIO_GENERIC_BIG_ENDIAN
354354
};
355355

356356
if (device_property_read_bool(dev, "little-endian")) {
357357
dev_dbg(dev, "GPIO registers are LITTLE endian\n");
358358
} else {
359-
config.flags |= BGPIOF_BIG_ENDIAN_BYTE_ORDER;
359+
config.flags |= GPIO_GENERIC_BIG_ENDIAN_BYTE_ORDER;
360360
dev_dbg(dev, "GPIO registers are BIG endian\n");
361361
}
362362

0 commit comments

Comments
 (0)