[Letux-kernel] X1600 Pullup/down

H. Nikolaus Schaller hns at goldelico.com
Fri Mar 15 07:48:53 CET 2024


Hi Paul,

it may be that we have a bug for setting the pullup/down registers for the x1600.

This is done in ingenic_set_bias().

Since the ID_X1600 >= ID_JZ4770 it calls

	ingenic_config_pin(jzpc, pin, JZ4770_GPIO_PEN, !bias);

Now JZ4770_GPIO_PEN is defined as 0x70.

But the PULL-UP/DOWN enabled State register is at offset 0x80 and
there are SET and CLEAR registers at 0x84 and 0x88. There seems to be no equivalent
with any other chip, not even the X1830 or X2000.

So we have to add new register constants. Something like

#define X1600_GPIO_PEN                         0x80

        } else if (is_soc_or_above(jzpc, ID_X1600)) {
                 ingenic_config_pin(jzpc, pin, X1600_GPIO_PEN, !bias);
        } else if (is_soc_or_above(jzpc, ID_JZ4770)) {
                 ingenic_config_pin(jzpc, pin, JZ4770_GPIO_PEN, !bias);

BTW: we have the same issue in our letux-5.10.y-lx16 kernel.
And it got unnoticed since I had no application so far that relies on
pullup/down...

Do you think this is the right way to go?

BR,
Nikolaus


More information about the Letux-kernel mailing list