[Letux-kernel] [PATCH] lx16: fix card detection on mmc1 and heartbeat led

H. Nikolaus Schaller hns at goldelico.com
Sun Feb 18 10:47:36 CET 2024


Hi all,
I have found the reason why the /dev/input/event0 buttons are
reported only once and /proc/interrupts counts only button
press.

The problem is in irq_set_type() which also needs to use the
non-shadow version for the X1600.

On a broader perspective this

	is_soc_or_above(jzpc, ID_X1000)

mechanism appears to be a little un-practical. I am tempted to
replace it by

	soc_supports_feature(jzpc, FEATURE)

and #defines based on BIT(ID_X1000) | BIT(ID_X2000) or similar.

Then there could be a

	#define FEATURE_SHADOW_REGISTERS ... and we exclude ID_X1600 there.

This would also allow to get rid of the imprecise order of ID numbers
and allow chips with higher number to not have a feature...

Especially I wonder why this is baked into such bitfield logic and
code instead of adding bitfield flags to ingenic_chip_info. Well, it
saves a little space for all the ingenic_chip_info tables but adds
code.

Anyways it is not worth to change (and discussions with maintainers).
Rather, we should find out why the shadow registers are not working.
And fix other drivers and issues.

BR,
Nikolaus

Latest version with this patch pushed: https://git.goldelico.com/?p=letux-kernel.git;a=shortlog;h=refs/heads/work-x1600-v6



> Am 11.02.2024 um 08:21 schrieb H. Nikolaus Schaller <hns at goldelico.com>:
> 
> Great!
> 
> This makes heartbeat LED work.
> 
> BR,
> Nikolaus
> 
>> Am 11.02.2024 um 00:21 schrieb Andreas Kemnade <andreas at kemnade.info>:
>> 
>> Shadow pinctrl seems not fully working, lets use the non-shadow variant
>> Heartbeat led works, mmc1 now gives -145 as well if card is present,
>> if not there, we have silence.
>> 
>> Signed-off-by: Andreas Kemnade <andreas at kemnade.info>
>> ---
>> on top of paulb-letux-6.7-rc8-mmc
>> drivers/pinctrl/pinctrl-ingenic.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>> 
>> diff --git a/drivers/pinctrl/pinctrl-ingenic.c b/drivers/pinctrl/pinctrl-ingenic.c
>> index 6f5515329383a..f6de8eeda5cda 100644
>> --- a/drivers/pinctrl/pinctrl-ingenic.c
>> +++ b/drivers/pinctrl/pinctrl-ingenic.c
>> @@ -3937,7 +3937,7 @@ static int ingenic_pinmux_set_pin_fn(struct ingenic_pinctrl *jzpc,
>> dev_dbg(jzpc->dev, "set pin P%c%u to function %u\n",
>> 'A' + offt, idx, func);
>> 
>> - if (is_soc_or_above(jzpc, ID_X1000)) {
>> + if (0 && is_soc_or_above(jzpc, ID_X1000)) {
>> ingenic_shadow_config_pin(jzpc, pin, JZ4770_GPIO_INT, false);
>> ingenic_shadow_config_pin(jzpc, pin, GPIO_MSK, false);
>> ingenic_shadow_config_pin(jzpc, pin, JZ4770_GPIO_PAT1, func & 0x2);
>> @@ -4006,7 +4006,7 @@ static int ingenic_pinmux_gpio_set_direction(struct pinctrl_dev *pctldev,
>> dev_dbg(pctldev->dev, "set pin P%c%u to %sput\n",
>> 'A' + offt, idx, input ? "in" : "out");
>> 
>> - if (is_soc_or_above(jzpc, ID_X1000)) {
>> + if (0 && is_soc_or_above(jzpc, ID_X1000)) {
>> ingenic_shadow_config_pin(jzpc, pin, JZ4770_GPIO_INT, false);
>> ingenic_shadow_config_pin(jzpc, pin, GPIO_MSK, true);
>> ingenic_shadow_config_pin(jzpc, pin, JZ4770_GPIO_PAT1, input);
>> -- 
>> 2.39.2
>> 
>> _______________________________________________
>> https://projects.goldelico.com/p/gta04-kernel/
>> Letux-kernel mailing list
>> Letux-kernel at openphoenux.org
>> http://lists.goldelico.com/mailman/listinfo.cgi/letux-kernel
> 



More information about the Letux-kernel mailing list