gpio: qpnp-gpio: Issue lookups based on device name

qpnp-gpio manages gpio_chip queries based on the slave
ID. This has a limitation in that it restricts the number of
gpio_chips per slave ID to one. However, some PMICs have both MPP
and GPIO on the same slave, and thus the slave ID is not a
meaningful unit to search for.

Instead, make use of the 'label' binding to give the
primary dev-container node a name. This name will serve as the
gpio_chip label, which can be used in lookups.

Change-Id: Ic20caeb4622d73449a983992275446c733ddd89a
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
This commit is contained in:
Michael Bohan
2012-05-29 15:40:18 -07:00
committed by Stephen Boyd
parent a22d6fb262
commit 6ee7045f1d
4 changed files with 31 additions and 21 deletions

View File

@@ -106,11 +106,11 @@ int qpnp_pin_config(int gpio, struct qpnp_pin_cfg *param);
/**
* qpnp_pin_map - Obtain Linux GPIO number from device spec
* @slave_id: slave_id of the spmi_device for the gpio in question.
* @name: Name assigned by the 'label' binding for the primary node.
* @pmic_pin: PMIC pin number to lookup.
*
* This routine is used in legacy configurations that do not support
* Device Tree. If you are using Device Tree, you should not use this.
* For such cases, use of_get_gpio() instead.
* For such cases, use of_get_gpio() or friends instead.
*/
int qpnp_pin_map(uint16_t slave_id, uint32_t pmic_pin);
int qpnp_pin_map(const char *name, uint32_t pmic_pin);