@@ -121,7 +121,17 @@ static const struct keyboard_led_drvdata keyboard_led_drvdata_acpi = {
121121
122122#endif /* CONFIG_ACPI */
123123
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+ }
125135
126136static int
127137keyboard_led_set_brightness_ec_pwm (struct led_classdev * cdev ,
@@ -169,44 +179,6 @@ keyboard_led_get_brightness_ec_pwm(struct led_classdev *cdev)
169179 return resp -> percent ;
170180}
171181
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-
210182static const struct keyboard_led_drvdata keyboard_led_drvdata_ec_pwm_mfd = {
211183 .init = keyboard_led_init_ec_pwm_mfd ,
212184 .brightness_set_blocking = keyboard_led_set_brightness_ec_pwm ,
@@ -270,17 +242,6 @@ static const struct acpi_device_id keyboard_led_acpi_match[] = {
270242MODULE_DEVICE_TABLE (acpi , keyboard_led_acpi_match );
271243#endif
272244
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-
284245static const struct platform_device_id keyboard_led_id [] = {
285246 { "cros-keyboard-leds" , 0 },
286247 {}
@@ -291,7 +252,6 @@ static struct platform_driver keyboard_led_driver = {
291252 .driver = {
292253 .name = "cros-keyboard-leds" ,
293254 .acpi_match_table = ACPI_PTR (keyboard_led_acpi_match ),
294- .of_match_table = of_match_ptr (keyboard_led_of_match ),
295255 },
296256 .probe = keyboard_led_probe ,
297257 .id_table = keyboard_led_id ,
0 commit comments