Skip to content

Commit 2d5a4d1

Browse files
committed
leds: aw2013: Import WT88047 configs
* Squashed commits from: https://github.com/LineageOS/android_kernel_wingtech_msm8916/commits/cm-13.0 Change-Id: I228063ad6adb2dd97707d61e816f9976db2e5ad1
1 parent ba8727f commit 2d5a4d1

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

drivers/leds/leds-aw2013.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@
4242
#define AW_LED_RESET_MASK 0x55
4343

4444
#define AW_LED_RESET_DELAY 8
45+
#ifndef CONFIG_MACH_WT88047
4546
#define AW2013_VDD_MIN_UV 2600000
4647
#define AW2013_VDD_MAX_UV 3300000
48+
#endif
4749
#define AW2013_VI2C_MIN_UV 1800000
4850
#define AW2013_VI2C_MAX_UV 1800000
4951

@@ -59,7 +61,9 @@ struct aw2013_led {
5961
struct work_struct work;
6062
struct workqueue_struct *workqueue;
6163
struct mutex lock;
64+
#ifndef CONFIG_MACH_WT88047
6265
struct regulator *vdd;
66+
#endif
6367
struct regulator *vcc;
6468
int num_leds;
6569
int id;
@@ -91,12 +95,14 @@ static int aw2013_power_on(struct aw2013_led *led, bool on)
9195
int rc;
9296

9397
if (on) {
98+
#ifndef CONFIG_MACH_WT88047
9499
rc = regulator_enable(led->vdd);
95100
if (rc) {
96101
dev_err(&led->client->dev,
97102
"Regulator vdd enable failed rc=%d\n", rc);
98103
return rc;
99104
}
105+
#endif
100106

101107
if (led->pdata->awgpio <= 0) {
102108
rc = regulator_enable(led->vcc);
@@ -108,12 +114,14 @@ static int aw2013_power_on(struct aw2013_led *led, bool on)
108114
}
109115
led->poweron = true;
110116
} else {
117+
#ifndef CONFIG_MACH_WT88047
111118
rc = regulator_disable(led->vdd);
112119
if (rc) {
113120
dev_err(&led->client->dev,
114121
"Regulator vdd disable failed rc=%d\n", rc);
115122
return rc;
116123
}
124+
#endif
117125

118126
if (led->pdata->awgpio <= 0) {
119127
rc = regulator_disable(led->vcc);
@@ -128,18 +136,22 @@ static int aw2013_power_on(struct aw2013_led *led, bool on)
128136
return rc;
129137

130138
fail_enable_reg:
139+
#ifndef CONFIG_MACH_WT88047
131140
rc = regulator_disable(led->vdd);
132141
if (rc)
133142
dev_err(&led->client->dev,
134143
"Regulator vdd disable failed rc=%d\n", rc);
144+
#endif
135145

136146
return rc;
137147

138148
fail_disable_reg:
149+
#ifndef CONFIG_MACH_WT88047
139150
rc = regulator_enable(led->vdd);
140151
if (rc)
141152
dev_err(&led->client->dev,
142153
"Regulator vdd enable failed rc=%d\n", rc);
154+
#endif
143155

144156
return rc;
145157
}
@@ -178,6 +190,7 @@ static int aw2013_power_init(struct aw2013_led *led, bool on)
178190
int rc;
179191

180192
if (on) {
193+
#ifndef CONFIG_MACH_WT88047
181194
led->vdd = regulator_get(&led->client->dev, "vdd");
182195
if (IS_ERR(led->vdd)) {
183196
rc = PTR_ERR(led->vdd);
@@ -196,6 +209,7 @@ static int aw2013_power_init(struct aw2013_led *led, bool on)
196209
goto reg_vdd_put;
197210
}
198211
}
212+
#endif
199213

200214
if (led->pdata->awgpio > 0) {
201215
rc = aw2013_configure_gpio(led, on);
@@ -225,10 +239,12 @@ static int aw2013_power_init(struct aw2013_led *led, bool on)
225239
}
226240
}
227241
} else {
242+
#ifndef CONFIG_MACH_WT88047
228243
if (regulator_count_voltages(led->vdd) > 0)
229244
regulator_set_voltage(led->vdd, 0, AW2013_VDD_MAX_UV);
230245

231246
regulator_put(led->vdd);
247+
#endif
232248

233249
if (!led->pdata->awgpio <= 0) {
234250
if (regulator_count_voltages(led->vcc) > 0)
@@ -242,10 +258,12 @@ static int aw2013_power_init(struct aw2013_led *led, bool on)
242258
reg_vcc_put:
243259
regulator_put(led->vcc);
244260
reg_vdd_set_vtg:
261+
#ifndef CONFIG_MACH_WT88047
245262
if (regulator_count_voltages(led->vdd) > 0)
246263
regulator_set_voltage(led->vdd, 0, AW2013_VDD_MAX_UV);
247264
reg_vdd_put:
248265
regulator_put(led->vdd);
266+
#endif
249267
return rc;
250268
}
251269

0 commit comments

Comments
 (0)