@@ -121,7 +121,17 @@ static const struct keyboard_led_drvdata keyboard_led_drvdata_acpi = {
121
121
122
122
#endif /* CONFIG_ACPI */
123
123
124
- #if IS_ENABLED (CONFIG_CROS_EC )
124
+ #if IS_ENABLED (CONFIG_MFD_CROS_EC_DEV )
125
+ static int keyboard_led_init_ec_pwm_mfd (struct platform_device * pdev )
126
+ {
127
+ struct cros_ec_dev * ec_dev = dev_get_drvdata (pdev -> dev .parent );
128
+ struct cros_ec_device * cros_ec = ec_dev -> ec_dev ;
129
+ struct keyboard_led * keyboard_led = platform_get_drvdata (pdev );
130
+
131
+ keyboard_led -> ec = cros_ec ;
132
+
133
+ return 0 ;
134
+ }
125
135
126
136
static int
127
137
keyboard_led_set_brightness_ec_pwm (struct led_classdev * cdev ,
@@ -169,44 +179,6 @@ keyboard_led_get_brightness_ec_pwm(struct led_classdev *cdev)
169
179
return resp -> percent ;
170
180
}
171
181
172
- static int keyboard_led_init_ec_pwm (struct platform_device * pdev )
173
- {
174
- struct keyboard_led * keyboard_led = platform_get_drvdata (pdev );
175
-
176
- keyboard_led -> ec = dev_get_drvdata (pdev -> dev .parent );
177
- if (!keyboard_led -> ec ) {
178
- dev_err (& pdev -> dev , "no parent EC device\n" );
179
- return - EINVAL ;
180
- }
181
-
182
- return 0 ;
183
- }
184
-
185
- static const __maybe_unused struct keyboard_led_drvdata keyboard_led_drvdata_ec_pwm = {
186
- .init = keyboard_led_init_ec_pwm ,
187
- .brightness_set_blocking = keyboard_led_set_brightness_ec_pwm ,
188
- .brightness_get = keyboard_led_get_brightness_ec_pwm ,
189
- .max_brightness = KEYBOARD_BACKLIGHT_MAX ,
190
- };
191
-
192
- #else /* IS_ENABLED(CONFIG_CROS_EC) */
193
-
194
- static const __maybe_unused struct keyboard_led_drvdata keyboard_led_drvdata_ec_pwm = {};
195
-
196
- #endif /* IS_ENABLED(CONFIG_CROS_EC) */
197
-
198
- #if IS_ENABLED (CONFIG_MFD_CROS_EC_DEV )
199
- static int keyboard_led_init_ec_pwm_mfd (struct platform_device * pdev )
200
- {
201
- struct cros_ec_dev * ec_dev = dev_get_drvdata (pdev -> dev .parent );
202
- struct cros_ec_device * cros_ec = ec_dev -> ec_dev ;
203
- struct keyboard_led * keyboard_led = platform_get_drvdata (pdev );
204
-
205
- keyboard_led -> ec = cros_ec ;
206
-
207
- return 0 ;
208
- }
209
-
210
182
static const struct keyboard_led_drvdata keyboard_led_drvdata_ec_pwm_mfd = {
211
183
.init = keyboard_led_init_ec_pwm_mfd ,
212
184
.brightness_set_blocking = keyboard_led_set_brightness_ec_pwm ,
@@ -270,17 +242,6 @@ static const struct acpi_device_id keyboard_led_acpi_match[] = {
270
242
MODULE_DEVICE_TABLE (acpi , keyboard_led_acpi_match );
271
243
#endif
272
244
273
- #ifdef CONFIG_OF
274
- static const struct of_device_id keyboard_led_of_match [] = {
275
- {
276
- .compatible = "google,cros-kbd-led-backlight" ,
277
- .data = & keyboard_led_drvdata_ec_pwm ,
278
- },
279
- {}
280
- };
281
- MODULE_DEVICE_TABLE (of , keyboard_led_of_match );
282
- #endif
283
-
284
245
static const struct platform_device_id keyboard_led_id [] = {
285
246
{ "cros-keyboard-leds" , 0 },
286
247
{}
@@ -291,7 +252,6 @@ static struct platform_driver keyboard_led_driver = {
291
252
.driver = {
292
253
.name = "cros-keyboard-leds" ,
293
254
.acpi_match_table = ACPI_PTR (keyboard_led_acpi_match ),
294
- .of_match_table = of_match_ptr (keyboard_led_of_match ),
295
255
},
296
256
.probe = keyboard_led_probe ,
297
257
.id_table = keyboard_led_id ,
0 commit comments