Re: [PATCH v8 2/9] Input: goodix - reset device at init

From: Bastien Nocera
Date: Fri Oct 09 2015 - 10:23:26 EST


On Thu, 2015-10-08 at 17:23 +0300, Irina Tirdea wrote:
> After power on, it is recommended that the driver resets the device.
> The reset procedure timing is described in the datasheet and is used
> at device init (before writing device configuration) and
> for power management. It is a sequence of setting the interrupt
> and reset pins high/low at specific timing intervals. This procedure
> also includes setting the slave address to the one specified in the
> ACPI/device tree.
>
> This is based on Goodix datasheets for GT911 and GT9271 and on Goodix
> driver gt9xx.c for Android (publicly available in Android kernel
> trees for various devices).
>
> For reset the driver needs to control the interrupt and
> reset gpio pins (configured through ACPI/device tree). For devices
> that do not have the gpio pins properly declared, the functionality
> depending on these pins will not be available, but the device can
> still
> be used with basic functionality.
>
> For both device tree and ACPI, the interrupt gpio pin configuration
> is
> read from the "irq-gpio" property and the reset pin configuration is
> read from the "reset-gpio" property. For ACPI 5.1, named properties
> can be specified using the _DSD section. This functionality will not
> be
> available for devices that use indexed gpio pins declared in the _CRS
> section (we need to provide backward compatibility with devices
> that do not support using the interrupt gpio pin as output).
>
> For ACPI, the pins can be specified using ACPI 5.1:
> Device (STAC)
> {
> ÂÂÂÂName (_HID, "GDIX1001")
> ÂÂÂÂ...
>
> ÂÂÂÂMethod (_CRS, 0, Serialized)
> ÂÂÂÂ{
> ÂÂÂÂÂÂÂÂName (RBUF, ResourceTemplate ()
> ÂÂÂÂÂÂÂÂ{
> ÂÂÂÂÂÂÂÂÂÂÂÂI2cSerialBus (0x0014, ControllerInitiated, 0x00061A80,
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂAddressingMode7Bit, "\\I2C0",
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ0x00, ResourceConsumer, ,
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ)
>
> ÂÂÂÂÂÂÂÂÂÂÂÂGpioInt (Edge, ActiveHigh, Exclusive, PullNone, 0x0000,
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ"\\I2C0", 0x00, ResourceConsumer, ,
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ)
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ{ÂÂÂ// Pin list
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ0
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ}
>
> ÂÂÂÂÂÂÂÂÂÂÂÂGpioIo (Exclusive, PullDown, 0x0000, 0x0000,
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂIoRestrictionOutputOnly, "\\I2C0", 0x00,
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂResourceConsumer, ,
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ)
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ{
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ1
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ}
> ÂÂÂÂÂÂÂÂ})
> ÂÂÂÂÂÂÂÂReturn (RBUF)
> ÂÂÂÂ}
>
> ÂÂÂÂName (_DSD,ÂÂPackage ()
> ÂÂÂÂ{
> ÂÂÂÂÂÂÂÂToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
> ÂÂÂÂÂÂÂÂPackage ()
> ÂÂÂÂÂÂÂÂ{
> ÂÂÂÂÂÂÂÂÂÂÂÂPackage (2) {"irq-gpio", Package() {^STAC, 0, 0, 0 }},
> ÂÂÂÂÂÂÂÂÂÂÂÂPackage (2) {"reset-gpio", Package() {^STAC, 1, 0, 0 }},
> ÂÂÂÂÂÂÂÂÂÂÂÂ...
> ÂÂÂÂÂÂÂÂ}
> ÂÂÂÂ}
>
> Signed-off-by: Octavian Purdila <octavian.purdila@xxxxxxxxx>
> Signed-off-by: Irina Tirdea <irina.tirdea@xxxxxxxxx>

Didn't actually cause problems on my system, and the documentation
looks good.

Acked-by: Bastien Nocera <hadess@xxxxxxxxxx>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/