Re: [PATCH 3/3] input: gpio_keys: Make use of the device property API

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

 



On Sun, Feb 28, 2016 at 02:03:34AM +0000, sergk sergk2mail wrote:
> Sorry to interrupt with question, but I guess this thread has right
> people for related to this topic question.
> The question is reversed to the topic - how to, having working touch
> driver in Android and Windows determine which exactly gpio pin is used
> as INT\WAKE gpio by the driver?

On ACPI systems the device description has either Interrupt() or
GpioInt() resource in its _CRS list (see
Documentation/acpi/gpio-properties.txt).

> Or for example even when I have some variant of such gpio pin how to
> ensure that it is exactly this gpio?
> For example practical task: I am trying to determine which exactly
> gpio pin is responsible for INT/WAKE touchscreen on Chuwi Vi10
> (baytrail x86_64 Arch 4.4.2 vanilla kernel with my custom config).
> Exploring /sys/class/gpio/* have guessed that in Android it is
> probably gpio134 but in Linux 4.4.2 probably gpio393. How to compare
> such pins and ensure that in Linux 393 gpio is the same as 134 in
> Android?
> Is this possible to do in any predictable (not guessing or enumerating
> all range) way?

Both DT and ACPI provide means to assign GPIOs to devices. We can then
use Linux APIs to query those. For example getting GPIO with name
"reset" is done like:

	struct gpio_desc *reset_desc;

	reset_desc = gpiod_get(dev, "reset", GPIOD_OUT_HIGH);

This will retrieve the GPIO using firmware description (ACPI, DT) if
available. No need to deal with the GPIO numbers.
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux