summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2012-03-07 15:58:33 +0530
committerSimone Willett <swillett@nvidia.com>2012-04-03 17:54:47 -0700
commitdd9f72af7f35191551037062aa7a690687b58696 (patch)
tree945393ea9abf206aedf925816c81693b9d2b3214 /include/linux
parent55affcc6a7eccfbdd9f1c36787d0f90fc45634ed (diff)
regulator: fixed: Support for open drain gpio pin
Adding flag on fixed regulator board configuration structure to specify whether gpio is open drain type or not. Passing this information to gpio library when requesting gpio so that gpio driver can set the pin state accordingly, for open drain type: - Pin can be set HIGH as setting as input, PULL UP on pin make this as HIGH. - Pin can be set LOW as setting it as output and drive to LOW. The non-open drain pin can be set HIGH/LOW by setting it to output and driving it to HIGH/LOW. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> cherry picked from mainline commit a4d9f179cc788b7f4b735d32c2e4a3b2562e8240 Change-Id: I2ee7789db67fdeea77c0d6ac2b44876af36c803e Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/94150 Reviewed-by: Automatic_Commit_Validation_User
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/regulator/fixed.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/regulator/fixed.h b/include/linux/regulator/fixed.h
index ffd7d508e726..d9b3ef98e78c 100644
--- a/include/linux/regulator/fixed.h
+++ b/include/linux/regulator/fixed.h
@@ -26,6 +26,12 @@ struct regulator_init_data;
* @gpio: GPIO to use for enable control
* set to -EINVAL if not used
* @startup_delay: Start-up time in microseconds
+ * @gpio_is_open_drain: Gpio pin is open drain or normal type.
+ * If it is open drain type then HIGH will be set
+ * through PULL-UP with setting gpio as input
+ * and low will be set as gpio-output with driven
+ * to low. For non-open-drain case, the gpio will
+ * will be in output and drive to low/high accordingly.
* @enable_high: Polarity of enable GPIO
* 1 = Active high, 0 = Active low
* @enabled_at_boot: Whether regulator has been enabled at
@@ -43,6 +49,7 @@ struct fixed_voltage_config {
int microvolts;
int gpio;
unsigned startup_delay;
+ unsigned gpio_is_open_drain:1;
unsigned enable_high:1;
unsigned enabled_at_boot:1;
struct regulator_init_data *init_data;