> On Fri, Nov 15, 2013 at 7:42 AM, Alexander Shiyan <[email protected]> wrote:
>
> > SYSCON driver was designed for using memory areas (registers)
> > that are used in several subsystems. There are systems (CPUs)
> > which use bits in one register for various purposes and thus
> > should be handled by various kernel subsystems. This driver
> > allows you to use the individual SYSCON bits as GPIOs.
> > This is RFC only yet, so I did not add DT bindings for this
> > driver.
> >
> > Signed-off-by: Alexander Shiyan <[email protected]>
...
> > +static int syscon_gpio_get(struct gpio_chip *chip, unsigned offset)
> > +{
> > + struct syscon_gpio_priv *priv = to_syscon_gpio(chip);
> > + unsigned int val;
> > + int ret;
> > +
> > + ret = regmap_read(priv->syscon, priv->bit_offset / 32, &val);
> > + if (ret < 0)
> > + return ret;
> > +
> > + return !!(val & (priv->bit_offset % 32));
> > +}
>
> Grrr OK drivers/mfd/syscon has its regmap constrained like that:
>
> static struct regmap_config syscon_regmap_config = {
> .reg_bits = 32,
> .val_bits = 32,
> .reg_stride = 4,
> };
>
> Assuming just like the people causing the y2k problem that
> "32 bits ought to fit everyone".
>
> This is not your fault, but I'd like you to insert a big comment
> explaining that the syscon driver semantics hammer down the
> 32 bit register width and there is nothing you can do about it.
You mean the comment in the source code or in the DT bindings?
Thanks.
---
N�����r��y����b�X��ǧv�^�){.n�+����{�����{ay�ʇڙ�,j��f���h���z��w���
���j:+v���w�j�m��������zZ+�����ݢj"��!�i