* Re: [RESEND PATCH] sh: ecovec24: use static device properties to describe the touchscreen
2026-07-13 21:41 [RESEND PATCH] sh: ecovec24: use static device properties to describe the touchscreen Dmitry Torokhov
@ 2026-09-09 17:29 ` Dmitry Torokhov
2026-09-10 7:24 ` Bartosz Golaszewski
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Dmitry Torokhov @ 2026-09-09 17:29 UTC (permalink / raw)
To: John Paul Adrian Glaubitz
Cc: Linus Walleij, Bartosz Golaszewski, Kuninori Morimoto,
Mark Brown, jacopo mondi, linux-sh, linux-kernel, linux-gpio,
Yoshinori Sato, Rich Felker
On Mon, Jul 13, 2026 at 02:41:31PM -0700, Dmitry Torokhov wrote:
> Convert the board to use static device properties instead of platform
> data to describe the touchscreen, so that support for platform data can
> be removed from tsc2007 driver (ecovec24 is the last board using this
> mechanism of describing tsc2007).
>
> Device properties do not allow custom board methods, so the method for
> getting "pen down" state was removed (the driver is capable of working
> without it). If this functionality is needed proper pin control/gpio
> support needs to be implemented so that the same pin can serve as an
> input GPIO and an interrupt.
>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---
>
> This is a resend of the patch I sent in August of 2024. My fault of not
> noticing reply from Adrian inquiring about potential negative impact
> from not having GPIO-based "pen down" detection. I believe this is fine,
> the "pen down" is an optional feature and the driver can detect the
> touches even when it is not specified. Additionally, this is an
> evaluation board, so user impact should be negligible.
>
> However the bigger question is whether ecovec24 board still relevant.
> According to my research it has the following regressions currently
> unfixed:
>
> 5716fb9bd9c6 ("mmc: spi: Convert to use GPIO descriptors")
> - MMC SPI device naming broken (broke SD fallback mode)
>
> 9fda6693335c ("spi: sh-msiof: Convert to use GPIO descriptors")
> - SPI CS polarity inverted (broke initialization on the MSIOF0 SPI bus)
>
> c2f9b05fd5c1 ("media: arch: sh: ecovec: Use new renesas-ceu camera driver")
> - Camera array sentinel missing (causes out-of-bounds reads and
> potentially kernel panics)
> - Camera standby polarity inverted (enadvertently keeps cameras
> permanently powered off)
> - Camera disabled iby default (board defconfig points to a deleted
> driver)
>
> They are ~6 years old, so I wonder: do people actually *actively* use
> this board with modern kernels? Should it simply be removed?
John, gentle ping...
>
> Thanks!
>
> arch/sh/boards/mach-ecovec24/setup.c | 38 ++++++++--------------------
> 1 file changed, 11 insertions(+), 27 deletions(-)
>
> diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
> index a641e26f8fdf..110a77f903b5 100644
> --- a/arch/sh/boards/mach-ecovec24/setup.c
> +++ b/arch/sh/boards/mach-ecovec24/setup.c
> @@ -26,6 +26,7 @@
> #include <linux/platform_data/tmio.h>
> #include <linux/platform_data/tsc2007.h>
> #include <linux/platform_device.h>
> +#include <linux/property.h>
> #include <linux/regulator/fixed.h>
> #include <linux/regulator/machine.h>
> #include <linux/sh_eth.h>
> @@ -589,39 +590,21 @@ static struct platform_device keysc_device = {
> /* TouchScreen */
> #define IRQ0 evt2irq(0x600)
>
> -static int ts_get_pendown_state(struct device *dev)
> -{
> - int val = 0;
> - gpio_free(GPIO_FN_INTC_IRQ0);
> - gpio_request(GPIO_PTZ0, NULL);
> - gpio_direction_input(GPIO_PTZ0);
> -
> - val = gpio_get_value(GPIO_PTZ0);
> -
> - gpio_free(GPIO_PTZ0);
> - gpio_request(GPIO_FN_INTC_IRQ0, NULL);
> -
> - return val ? 0 : 1;
> -}
> -
> -static int ts_init(void)
> -{
> - gpio_request(GPIO_FN_INTC_IRQ0, NULL);
> - return 0;
> -}
> +static const struct property_entry tsc2007_properties[] = {
> + PROPERTY_ENTRY_U32("ti,x-plate-ohms", 180),
> + { }
> +};
>
> -static struct tsc2007_platform_data tsc2007_info = {
> - .model = 2007,
> - .x_plate_ohms = 180,
> - .get_pendown_state = ts_get_pendown_state,
> - .init_platform_hw = ts_init,
> +static const struct software_node tsc2007_swnode = {
> + .name = "tsc2007",
> + .properties = tsc2007_properties,
> };
>
> static struct i2c_board_info ts_i2c_clients = {
> I2C_BOARD_INFO("tsc2007", 0x48),
> .type = "tsc2007",
> - .platform_data = &tsc2007_info,
> .irq = IRQ0,
> + .swnode = &tsc2007_swnode,
> };
>
> static struct regulator_consumer_supply cn12_power_consumers[] =
> @@ -1242,8 +1225,9 @@ static int __init arch_setup(void)
> gpio_direction_output(GPIO_PTF4, 1);
>
> /* enable TouchScreen */
> - i2c_register_board_info(0, &ts_i2c_clients, 1);
> + gpio_request(GPIO_FN_INTC_IRQ0, NULL);
> irq_set_irq_type(IRQ0, IRQ_TYPE_LEVEL_LOW);
> + i2c_register_board_info(0, &ts_i2c_clients, 1);
> }
>
> /* enable CEU0 */
> --
> 2.55.0.795.g602f6c329a-goog
>
>
--
Dmitry
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [RESEND PATCH] sh: ecovec24: use static device properties to describe the touchscreen
2026-07-13 21:41 [RESEND PATCH] sh: ecovec24: use static device properties to describe the touchscreen Dmitry Torokhov
2026-09-09 17:29 ` Dmitry Torokhov
@ 2026-09-10 7:24 ` Bartosz Golaszewski
2026-09-16 17:01 ` Linus Walleij
2026-09-16 19:14 ` John Paul Adrian Glaubitz
3 siblings, 0 replies; 6+ messages in thread
From: Bartosz Golaszewski @ 2026-09-10 7:24 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Linus Walleij, Bartosz Golaszewski, Kuninori Morimoto,
Mark Brown, jacopo mondi, linux-sh, linux-kernel, linux-gpio,
Yoshinori Sato, Rich Felker, John Paul Adrian Glaubitz
On Mon, 13 Jul 2026 23:41:31 +0200, Dmitry Torokhov
<dmitry.torokhov@gmail.com> said:
> Convert the board to use static device properties instead of platform
> data to describe the touchscreen, so that support for platform data can
> be removed from tsc2007 driver (ecovec24 is the last board using this
> mechanism of describing tsc2007).
>
> Device properties do not allow custom board methods, so the method for
> getting "pen down" state was removed (the driver is capable of working
> without it). If this functionality is needed proper pin control/gpio
> support needs to be implemented so that the same pin can serve as an
> input GPIO and an interrupt.
>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---
>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RESEND PATCH] sh: ecovec24: use static device properties to describe the touchscreen
2026-07-13 21:41 [RESEND PATCH] sh: ecovec24: use static device properties to describe the touchscreen Dmitry Torokhov
2026-09-09 17:29 ` Dmitry Torokhov
2026-09-10 7:24 ` Bartosz Golaszewski
@ 2026-09-16 17:01 ` Linus Walleij
2026-09-16 17:10 ` John Paul Adrian Glaubitz
2026-09-16 19:14 ` John Paul Adrian Glaubitz
3 siblings, 1 reply; 6+ messages in thread
From: Linus Walleij @ 2026-09-16 17:01 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Yoshinori Sato, Rich Felker, John Paul Adrian Glaubitz,
Bartosz Golaszewski, Kuninori Morimoto, Mark Brown, jacopo mondi,
linux-sh, linux-kernel, linux-gpio
On Mon, Jul 13, 2026 at 11:41 PM Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
> Convert the board to use static device properties instead of platform
> data to describe the touchscreen, so that support for platform data can
> be removed from tsc2007 driver (ecovec24 is the last board using this
> mechanism of describing tsc2007).
>
> Device properties do not allow custom board methods, so the method for
> getting "pen down" state was removed (the driver is capable of working
> without it). If this functionality is needed proper pin control/gpio
> support needs to be implemented so that the same pin can serve as an
> input GPIO and an interrupt.
>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RESEND PATCH] sh: ecovec24: use static device properties to describe the touchscreen
2026-09-16 17:01 ` Linus Walleij
@ 2026-09-16 17:10 ` John Paul Adrian Glaubitz
0 siblings, 0 replies; 6+ messages in thread
From: John Paul Adrian Glaubitz @ 2026-09-16 17:10 UTC (permalink / raw)
To: Linus Walleij, Dmitry Torokhov
Cc: Yoshinori Sato, Rich Felker, Bartosz Golaszewski,
Kuninori Morimoto, Mark Brown, jacopo mondi, linux-sh,
linux-kernel, linux-gpio
Hi Linus and Dmitry,
On Wed, 2026-09-16 at 19:01 +0200, Linus Walleij wrote:
> On Mon, Jul 13, 2026 at 11:41 PM Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
>
> > Convert the board to use static device properties instead of platform
> > data to describe the touchscreen, so that support for platform data can
> > be removed from tsc2007 driver (ecovec24 is the last board using this
> > mechanism of describing tsc2007).
> >
> > Device properties do not allow custom board methods, so the method for
> > getting "pen down" state was removed (the driver is capable of working
> > without it). If this functionality is needed proper pin control/gpio
> > support needs to be implemented so that the same pin can serve as an
> > input GPIO and an interrupt.
> >
> > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
>
> Reviewed-by: Linus Walleij <linusw@kernel.org>
Thanks a lot for the review! I'm working on them now.
Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RESEND PATCH] sh: ecovec24: use static device properties to describe the touchscreen
2026-07-13 21:41 [RESEND PATCH] sh: ecovec24: use static device properties to describe the touchscreen Dmitry Torokhov
` (2 preceding siblings ...)
2026-09-16 17:01 ` Linus Walleij
@ 2026-09-16 19:14 ` John Paul Adrian Glaubitz
3 siblings, 0 replies; 6+ messages in thread
From: John Paul Adrian Glaubitz @ 2026-09-16 19:14 UTC (permalink / raw)
To: Dmitry Torokhov, Rich Felker, Yoshinori Sato
Cc: Linus Walleij, Bartosz Golaszewski, Kuninori Morimoto,
Mark Brown, jacopo mondi, linux-sh, linux-kernel, linux-gpio
Hi Dmitry,
On Mon, 2026-07-13 at 14:41 -0700, Dmitry Torokhov wrote:
> Convert the board to use static device properties instead of platform
> data to describe the touchscreen, so that support for platform data can
> be removed from tsc2007 driver (ecovec24 is the last board using this
> mechanism of describing tsc2007).
>
> Device properties do not allow custom board methods, so the method for
> getting "pen down" state was removed (the driver is capable of working
> without it). If this functionality is needed proper pin control/gpio
> support needs to be implemented so that the same pin can serve as an
> input GPIO and an interrupt.
>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---
>
> This is a resend of the patch I sent in August of 2024. My fault of not
> noticing reply from Adrian inquiring about potential negative impact
> from not having GPIO-based "pen down" detection. I believe this is fine,
> the "pen down" is an optional feature and the driver can detect the
> touches even when it is not specified. Additionally, this is an
> evaluation board, so user impact should be negligible.
>
> However the bigger question is whether ecovec24 board still relevant.
> According to my research it has the following regressions currently
> unfixed:
>
> 5716fb9bd9c6 ("mmc: spi: Convert to use GPIO descriptors")
> - MMC SPI device naming broken (broke SD fallback mode)
>
> 9fda6693335c ("spi: sh-msiof: Convert to use GPIO descriptors")
> - SPI CS polarity inverted (broke initialization on the MSIOF0 SPI bus)
>
> c2f9b05fd5c1 ("media: arch: sh: ecovec: Use new renesas-ceu camera driver")
> - Camera array sentinel missing (causes out-of-bounds reads and
> potentially kernel panics)
> - Camera standby polarity inverted (enadvertently keeps cameras
> permanently powered off)
> - Camera disabled iby default (board defconfig points to a deleted
> driver)
>
> They are ~6 years old, so I wonder: do people actually *actively* use
> this board with modern kernels? Should it simply be removed?
We want to switch arch/sh to using device trees in the future anyway, then
we can decide which boards to keep and which ones to remove. We have a patch
series by Yoshinori Sato to convert arch/sh to device trees. It still needs
some work though.
> Thanks!
>
> arch/sh/boards/mach-ecovec24/setup.c | 38 ++++++++--------------------
> 1 file changed, 11 insertions(+), 27 deletions(-)
>
> diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
> index a641e26f8fdf..110a77f903b5 100644
> --- a/arch/sh/boards/mach-ecovec24/setup.c
> +++ b/arch/sh/boards/mach-ecovec24/setup.c
> @@ -26,6 +26,7 @@
> #include <linux/platform_data/tmio.h>
> #include <linux/platform_data/tsc2007.h>
> #include <linux/platform_device.h>
> +#include <linux/property.h>
> #include <linux/regulator/fixed.h>
> #include <linux/regulator/machine.h>
> #include <linux/sh_eth.h>
> @@ -589,39 +590,21 @@ static struct platform_device keysc_device = {
> /* TouchScreen */
> #define IRQ0 evt2irq(0x600)
>
> -static int ts_get_pendown_state(struct device *dev)
> -{
> - int val = 0;
> - gpio_free(GPIO_FN_INTC_IRQ0);
> - gpio_request(GPIO_PTZ0, NULL);
> - gpio_direction_input(GPIO_PTZ0);
> -
> - val = gpio_get_value(GPIO_PTZ0);
> -
> - gpio_free(GPIO_PTZ0);
> - gpio_request(GPIO_FN_INTC_IRQ0, NULL);
> -
> - return val ? 0 : 1;
> -}
> -
> -static int ts_init(void)
> -{
> - gpio_request(GPIO_FN_INTC_IRQ0, NULL);
> - return 0;
> -}
> +static const struct property_entry tsc2007_properties[] = {
> + PROPERTY_ENTRY_U32("ti,x-plate-ohms", 180),
> + { }
> +};
>
> -static struct tsc2007_platform_data tsc2007_info = {
> - .model = 2007,
> - .x_plate_ohms = 180,
> - .get_pendown_state = ts_get_pendown_state,
> - .init_platform_hw = ts_init,
> +static const struct software_node tsc2007_swnode = {
> + .name = "tsc2007",
> + .properties = tsc2007_properties,
> };
>
> static struct i2c_board_info ts_i2c_clients = {
> I2C_BOARD_INFO("tsc2007", 0x48),
> .type = "tsc2007",
> - .platform_data = &tsc2007_info,
> .irq = IRQ0,
> + .swnode = &tsc2007_swnode,
> };
>
> static struct regulator_consumer_supply cn12_power_consumers[] =
> @@ -1242,8 +1225,9 @@ static int __init arch_setup(void)
> gpio_direction_output(GPIO_PTF4, 1);
>
> /* enable TouchScreen */
> - i2c_register_board_info(0, &ts_i2c_clients, 1);
> + gpio_request(GPIO_FN_INTC_IRQ0, NULL);
> irq_set_irq_type(IRQ0, IRQ_TYPE_LEVEL_LOW);
> + i2c_register_board_info(0, &ts_i2c_clients, 1);
> }
>
> /* enable CEU0 */
> --
> 2.55.0.795.g602f6c329a-goog
>
Looks good to me. I'll pick this up for v7.4.
Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
^ permalink raw reply [flat|nested] 6+ messages in thread