Re: [PATCH v2 2/2] gpio: vf610: Switch to gpio-mmio

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Bough,

thanks for testing all my patches!

On Mon, Feb 17, 2025 at 12:24 PM Bough Chen <haibo.chen@xxxxxxx> wrote:

> 1, need to use port->gpio_base instead port->base.

Oh, what a mistake. Fixed.

> 2, vf610 has register GPIO_PDIR, if find the direction is input, need to read this register to get the input value.
> But for mmio driver, it will read the gc->reg_set, which is GPIO_PSOR with flags
> BGPIOF_READ_OUTPUT_REG_SET,  this is not correct. Seems current bgpio_init()
> need to add another parameter to input this GPIO_PDIR, but this will has big impact.
>
> I try to adjust the bgpio_init like this:
> ret = bgpio_init(gc, dev, 4, port->gpio_base + GPIO_PDIR, port->gpio_base + GPIO_PSOR,
>  port->gpio_base + GPIO_PCOR, port->sdata->have_paddr ? port->base + GPIO_PDDR : NULL, NULL, flags);
>
> But still can't work fine, because when gpio is config in output mode, it will read GPIO_PSOR
> as output value, but for vf610, read GPIO_PSOR/GPIO_PCOR already return 0

But what happens if we *only* specify PSOR as setting register to bgpio?

Usually when there are set/clear registers, the block also allows direct
read/modify/write on the output data register (I have seen this once
before...)

I sent a v3 like that. Does this work?

Else I think we should perhaps simply bite the bullet and add a new
argument to bgpio_init() for passing set/clear/data triplets. It can't
be avoided: if this sort of hardware does exist with set and clear
and a non-writeable data register, then gpio-mmio should support
it.

Yours,
Linus Walleij





[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux