[RFC] ath79: MikroTik RB912UAG-2HPnD: add initial value to SSR

Petr Štetiar ynezz at true.cz
Tue Mar 8 09:26:10 PST 2022


Denis Kalashnikov <denis281089 at gmail.com> [2022-01-20 16:54:20]:

Hi,

> diff --git a/target/linux/ath79/patches-5.10/451-gpio-74x164-init-val-support.patch b/target/linux/ath79/patches-5.10/451-gpio-74x164-init-val-support.patch
> new file mode 100644
> index 0000000000..9dabb181b5
> --- /dev/null
> +++ b/target/linux/ath79/patches-5.10/451-gpio-74x164-init-val-support.patch
> @@ -0,0 +1,20 @@
> +--- a/drivers/gpio/gpio-74x164.c
> ++++ b/drivers/gpio/gpio-74x164.c
> +@@ -145,6 +145,17 @@ static int gen_74x164_probe(struct spi_d
> + 	chip->gpio_chip.parent = &spi->dev;
> + 	chip->gpio_chip.owner = THIS_MODULE;
> + 
> ++	/*
> ++	 * Read optional inital value of registers. First byte -- last register.
> ++	 * E.g. init-data = /bits/ 8 <0x01 0x1f 0x02>;
> ++	 */
> ++	ret = of_property_read_u8_array(spi->dev.of_node, "init-data",
> ++		(u8 *)chip->buffer, (size_t)nregs);
> ++	if (ret && ret != -EINVAL /* Not found */) {
> ++		dev_err(&spi->dev, "Invalid 'init-data' property.\n");
> ++		return -EINVAL;
> ++	}
> ++

lets take this through upstream and backport solution accepted there, thanks.

Cheers,

Petr



More information about the openwrt-devel mailing list