lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 5 May 2023 11:08:50 -0700
From:   Dmitry Torokhov <dmitry.torokhov@...il.com>
To:     Linus Walleij <linus.walleij@...aro.org>
Cc:     Aaro Koskinen <aaro.koskinen@....fi>,
        Janusz Krzysztofik <jmkrzyszt@...il.com>,
        Tony Lindgren <tony@...mide.com>,
        Russell King <linux@...linux.org.uk>,
        Daniel Mack <daniel@...que.org>,
        Haojian Zhuang <haojian.zhuang@...il.com>,
        Robert Jarzmik <robert.jarzmik@...e.fr>,
        Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
        Mark Brown <broonie@...nel.org>,
        Bartosz Golaszewski <bartosz.golaszewski@...aro.org>,
        Andreas Kemnade <andreas@...nade.info>,
        Helge Deller <deller@....de>,
        Ulf Hansson <ulf.hansson@...aro.org>,
        linux-omap@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-kernel@...r.kernel.org, linux-mips@...r.kernel.org,
        linux-input@...r.kernel.org, linux-spi@...r.kernel.org,
        linux-fbdev@...r.kernel.org, dri-devel@...ts.freedesktop.org,
        linux-mmc@...r.kernel.org
Subject: Re: [PATCH v3 1/3] Input: ads7846 - Convert to use software nodes

Hi Linus,
On Fri, May 05, 2023 at 01:16:55PM +0200, Linus Walleij wrote:
> 
> Populate the devices on the Nokia 770 CBUS I2C using software
> nodes instead of platform data quirks. This includes the LCD
> and the ADS7846 touchscreen so the conversion just brings the LCD
> along with it as software nodes is an all-or-nothing design
> pattern.

Wow, so that worked , awesome!

> +static const struct property_entry nokia770_ads7846_props[] = {
> +	PROPERTY_ENTRY_U32("touchscreen-size-x", 4096),
> +	PROPERTY_ENTRY_U32("touchscreen-size-y", 4096),
> +	PROPERTY_ENTRY_U32("touchscreen-max-pressure", 256),
> +	PROPERTY_ENTRY_U32("touchscreen-average-samples", 10),
> +	PROPERTY_ENTRY_U16("ti,x-plate-ohms", 180),
> +	PROPERTY_ENTRY_U16("ti,debounce-tol", 3),
> +	PROPERTY_ENTRY_U16("ti,debounce-rep", 1),
> +	PROPERTY_ENTRY_GPIO("pendown-gpios", &nokia770_gpiochip1_node,
> +			    ADS7846_PENDOWN_GPIO, GPIO_ACTIVE_HIGH),

Looking at the driver this actually needs to be GPIO_ACTIVE_LOW.

>  
> +static struct gpiod_lookup_table spitz_ads7846_gpio_table = {
> +	.dev_id = "spi2.0",
> +	.table = {
> +		GPIO_LOOKUP("gpio-pxa", SPITZ_GPIO_TP_INT,
> +			    "pendown", GPIO_ACTIVE_HIGH),

GPIO_ACTIVE_LOW here too.

> +static struct gpiod_lookup_table db1100_touch_gpio_table = {
> +	.dev_id = "spi0.0",
> +	.table = {
> +		GPIO_LOOKUP("alchemy-gpio2", 21,
> +			    "pendown", GPIO_ACTIVE_HIGH),

And here as well.

> @@ -223,7 +220,7 @@ static int get_pendown_state(struct ads7846 *ts)
>  	if (ts->get_pendown_state)
>  		return ts->get_pendown_state();
>  
> -	return !gpio_get_value(ts->gpio_pendown);
> +	return !gpiod_get_value(ts->gpio_pendown);

This needs to be

	return !gpiod_get_value_raw(ts->gpio_pendown);

I looked at various DTSes we have and they use a mix of active high and
active low annotations, so we have to go with the "raw" variant for now,
and then update to normal one once we update bad DTSes.

Thanks!

-- 
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ