tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Regulator



> Date: Wed, 12 Jan 2022 14:34:24 +0000
> From: Emmanuel Dreyfus <manu%netbsd.org@localhost>
> 
> There is another readblock. The Linux driver for Goodix touchpanel 
> uses a beast called regulator, which seems to control the chip
> power supply:
>         ts->avdd28 = devm_regulator_get(dev, "AVDD28");
> (...)
>         ts->vddio = devm_regulator_get(dev, "VDDIO");
> (...)
>         /* power up the controller */
>         error = regulator_enable(ts->avdd28);
> (...)
>         error = regulator_enable(ts->vddio);

This is something that will be provided by the fdt, when you are
running it on a platform with fdt.  For example, quoting from
sys/external/gpl2/dist/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi:

	touchscreen@5d {
		compatible = "goodix,gt917s";
		reg = <0x5d>;
		interrupt-parent = <&pio>;
		interrupts = <7 4 IRQ_TYPE_LEVEL_HIGH>; /* PH4 */
		irq-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
		reset-gpios = <&pio 7 11 GPIO_ACTIVE_HIGH>; /* PH11 */
		AVDD28-supply = <&reg_ldo_io0>;
		VDDIO-supply = <&reg_ldo_io0>;
		touchscreen-size-x = <720>;
		touchscreen-size-y = <1440>;
	};

This is part of the fdt bus attachment.  But if the platform isn't
described by fdt, e.g. you're on an acpi system instead, the driver
might not need to mess with regulators at all (or, it might be acpi
with embedded device tree data).

Can you say more about the platform this is on?  How do you discover
the touchscreen device -- via what kind of firmware or bus/device
enumeration?  If this is acpi, can you share acpidump -dt?  Do you
have documentation for the hardware you can share?


Home | Main Index | Thread Index | Old Index