aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorBruno Prémont <bonbons@linux-vserver.org>2010-04-11 06:17:45 -0400
committerJiri Kosina <jkosina@suse.cz>2010-04-11 14:26:46 -0400
commit5435f2818ea08bcb381dcd2a99b1607b2a42f329 (patch)
tree493f43cc5458e494a45d28ff776eea40880cb6c3 /drivers/hid
parenteb741103f17a19fccf7c795ed1d9662196acc6e5 (diff)
HID: hid-picolcd depends on LCD_CLASS_DEVICE
HID_PICOLCD should depend on LCD_CLASS_DEVICE, otherwise the build fails when HID_PICOLCD=y and LCD_CLASS_DEVICE=m: hid-picolcd.c:(.text+0x84523f): undefined reference to `lcd_device_unregister' hid-picolcd.c:(.text+0x8478ab): undefined reference to `lcd_device_register' hid-picolcd.c:(.text+0x84c15f): undefined reference to `lcd_device_unregister' Same applies to FB, BACKLIGHT_CLASS_DEVICE and LEDS_CLASS. Add suboptions for those features to handle the deps on kbuild side and just check HID_PICOLCD_* in the code. Reported-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/Kconfig53
-rw-r--r--drivers/hid/hid-picolcd.c40
2 files changed, 64 insertions, 29 deletions
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
index a2ecd83bfe89..0e8aa63e3f55 100644
--- a/drivers/hid/Kconfig
+++ b/drivers/hid/Kconfig
@@ -265,11 +265,6 @@ config HID_PETALYNX
265config HID_PICOLCD 265config HID_PICOLCD
266 tristate "PicoLCD (graphic version)" 266 tristate "PicoLCD (graphic version)"
267 depends on USB_HID 267 depends on USB_HID
268 select FB_DEFERRED_IO if FB
269 select FB_SYS_FILLRECT if FB
270 select FB_SYS_COPYAREA if FB
271 select FB_SYS_IMAGEBLIT if FB
272 select FB_SYS_FOPS if FB
273 ---help--- 268 ---help---
274 This provides support for Minibox PicoLCD devices, currently 269 This provides support for Minibox PicoLCD devices, currently
275 only the graphical ones are supported. 270 only the graphical ones are supported.
@@ -277,14 +272,54 @@ config HID_PICOLCD
277 This includes support for the following device features: 272 This includes support for the following device features:
278 - Keypad 273 - Keypad
279 - Switching between Firmware and Flash mode 274 - Switching between Firmware and Flash mode
280 - Framebuffer for monochrome 256x64 display
281 - Backlight control (needs CONFIG_BACKLIGHT_CLASS_DEVICE)
282 - Contrast control (needs CONFIG_LCD_CLASS_DEVICE)
283 - General purpose outputs (needs CONFIG_LEDS_CLASS)
284 - EEProm / Flash access (via debugfs) 275 - EEProm / Flash access (via debugfs)
276 Features selectively enabled:
277 - Framebuffer for monochrome 256x64 display
278 - Backlight control
279 - Contrast control
280 - General purpose outputs
285 Features that are not (yet) supported: 281 Features that are not (yet) supported:
286 - IR 282 - IR
287 283
284config HID_PICOLCD_FB
285 bool "Framebuffer support" if EMBEDDED
286 default !EMBEDDED
287 depends on HID_PICOLCD
288 depends on HID_PICOLCD=FB || FB=y
289 select FB_DEFERRED_IO
290 select FB_SYS_FILLRECT
291 select FB_SYS_COPYAREA
292 select FB_SYS_IMAGEBLIT
293 select FB_SYS_FOPS
294 ---help---
295 Provide access to PicoLCD's 256x64 monochrome display via a
296 frambuffer device.
297
298config HID_PICOLCD_BACKLIGHT
299 bool "Backlight control" if EMBEDDED
300 default !EMBEDDED
301 depends on HID_PICOLCD
302 depends on HID_PICOLCD=BACKLIGHT_CLASS_DEVICE || BACKLIGHT_CLASS_DEVICE=y
303 ---help---
304 Provide access to PicoLCD's backlight control via backlight
305 class.
306
307config HID_PICOLCD_LCD
308 bool "Contrast control" if EMBEDDED
309 default !EMBEDDED
310 depends on HID_PICOLCD
311 depends on HID_PICOLCD=LCD_CLASS_DEVICE || LCD_CLASS_DEVICE=y
312 ---help---
313 Provide access to PicoLCD's LCD contrast via lcd class.
314
315config HID_PICOLCD_LEDS
316 bool "GPO via leds class" if EMBEDDED
317 default !EMBEDDED
318 depends on HID_PICOLCD
319 depends on HID_PICOLCD=LEDS_CLASS || LEDS_CLASS=y
320 ---help---
321 Provide access to PicoLCD's GPO pins via leds class.
322
288config HID_QUANTA 323config HID_QUANTA
289 tristate "Quanta Optical Touch" 324 tristate "Quanta Optical Touch"
290 depends on USB_HID 325 depends on USB_HID
diff --git a/drivers/hid/hid-picolcd.c b/drivers/hid/hid-picolcd.c
index 0eacc6b6d5bb..0fbc7d396164 100644
--- a/drivers/hid/hid-picolcd.c
+++ b/drivers/hid/hid-picolcd.c
@@ -77,7 +77,7 @@
77#define REPORT_HOOK_VERSION 0xf7 /* LCD: IN[2], OUT[1] */ 77#define REPORT_HOOK_VERSION 0xf7 /* LCD: IN[2], OUT[1] */
78#define REPORT_EXIT_FLASHER 0xff /* Bootloader: OUT[2] */ 78#define REPORT_EXIT_FLASHER 0xff /* Bootloader: OUT[2] */
79 79
80#if defined(CONFIG_FB) || defined(CONFIG_FB_MODULE) 80#ifdef CONFIG_HID_PICOLCD_FB
81/* Framebuffer 81/* Framebuffer
82 * 82 *
83 * The PicoLCD use a Topway LCD module of 256x64 pixel 83 * The PicoLCD use a Topway LCD module of 256x64 pixel
@@ -128,7 +128,7 @@ static const struct fb_var_screeninfo picolcdfb_var = {
128 .bits_per_pixel = 1, 128 .bits_per_pixel = 1,
129 .grayscale = 1, 129 .grayscale = 1,
130}; 130};
131#endif /* CONFIG_FB */ 131#endif /* CONFIG_HID_PICOLCD_FB */
132 132
133/* Input device 133/* Input device
134 * 134 *
@@ -183,7 +183,7 @@ struct picolcd_data {
183 struct input_dev *input_cir; 183 struct input_dev *input_cir;
184 unsigned short keycode[PICOLCD_KEYS]; 184 unsigned short keycode[PICOLCD_KEYS];
185 185
186#if defined(CONFIG_FB) || defined(CONFIG_FB_MODULE) 186#ifdef CONFIG_HID_PICOLCD_FB
187 /* Framebuffer stuff */ 187 /* Framebuffer stuff */
188 u8 fb_update_rate; 188 u8 fb_update_rate;
189 u8 fb_bpp; 189 u8 fb_bpp;
@@ -191,21 +191,21 @@ struct picolcd_data {
191 u8 *fb_bitmap; /* framebuffer */ 191 u8 *fb_bitmap; /* framebuffer */
192 struct fb_info *fb_info; 192 struct fb_info *fb_info;
193 struct fb_deferred_io fb_defio; 193 struct fb_deferred_io fb_defio;
194#endif /* CONFIG_FB */ 194#endif /* CONFIG_HID_PICOLCD_FB */
195#if defined(CONFIG_LCD_CLASS_DEVICE) || defined(CONFIG_LCD_CLASS_DEVICE_MODULE) 195#ifdef CONFIG_HID_PICOLCD_LCD
196 struct lcd_device *lcd; 196 struct lcd_device *lcd;
197 u8 lcd_contrast; 197 u8 lcd_contrast;
198#endif 198#endif /* CONFIG_HID_PICOLCD_LCD */
199#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) || defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE) 199#ifdef CONFIG_HID_PICOLCD_BACKLIGHT
200 struct backlight_device *backlight; 200 struct backlight_device *backlight;
201 u8 lcd_brightness; 201 u8 lcd_brightness;
202 u8 lcd_power; 202 u8 lcd_power;
203#endif /* CONFIG_BACKLIGHT_CLASS_DEVICE */ 203#endif /* CONFIG_HID_PICOLCD_BACKLIGHT */
204#if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE) 204#ifdef CONFIG_HID_PICOLCD_LEDS
205 /* LED stuff */ 205 /* LED stuff */
206 u8 led_state; 206 u8 led_state;
207 struct led_classdev *led[8]; 207 struct led_classdev *led[8];
208#endif /* CONFIG_LEDS_CLASS */ 208#endif /* CONFIG_HID_PICOLCD_LEDS */
209 209
210 /* Housekeeping stuff */ 210 /* Housekeeping stuff */
211 spinlock_t lock; 211 spinlock_t lock;
@@ -287,7 +287,7 @@ static struct picolcd_pending *picolcd_send_and_wait(struct hid_device *hdev,
287 return work; 287 return work;
288} 288}
289 289
290#if defined(CONFIG_FB) || defined(CONFIG_FB_MODULE) 290#ifdef CONFIG_HID_PICOLCD_FB
291/* Send a given tile to PicoLCD */ 291/* Send a given tile to PicoLCD */
292static int picolcd_fb_send_tile(struct hid_device *hdev, int chip, int tile) 292static int picolcd_fb_send_tile(struct hid_device *hdev, int chip, int tile)
293{ 293{
@@ -766,9 +766,9 @@ static void picolcd_exit_framebuffer(struct picolcd_data *data)
766{ 766{
767} 767}
768#define picolcd_fbinfo(d) NULL 768#define picolcd_fbinfo(d) NULL
769#endif /* CONFIG_FB */ 769#endif /* CONFIG_HID_PICOLCD_FB */
770 770
771#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) || defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE) 771#ifdef CONFIG_HID_PICOLCD_BACKLIGHT
772/* 772/*
773 * backlight class device 773 * backlight class device
774 */ 774 */
@@ -864,9 +864,9 @@ static inline int picolcd_resume_backlight(struct picolcd_data *data)
864{ 864{
865 return 0; 865 return 0;
866} 866}
867#endif /* CONFIG_BACKLIGHT_CLASS_DEVICE */ 867#endif /* CONFIG_HID_PICOLCD_BACKLIGHT */
868 868
869#if defined(CONFIG_LCD_CLASS_DEVICE) || defined(CONFIG_LCD_CLASS_DEVICE_MODULE) 869#ifdef CONFIG_HID_PICOLCD_LCD
870/* 870/*
871 * lcd class device 871 * lcd class device
872 */ 872 */
@@ -957,9 +957,9 @@ static inline int picolcd_resume_lcd(struct picolcd_data *data)
957{ 957{
958 return 0; 958 return 0;
959} 959}
960#endif /* CONFIG_LCD_CLASS_DEVICE */ 960#endif /* CONFIG_HID_PICOLCD_LCD */
961 961
962#if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE) 962#ifdef CONFIG_HID_PICOLCD_LEDS
963/** 963/**
964 * LED class device 964 * LED class device
965 */ 965 */
@@ -1104,7 +1104,7 @@ static inline int picolcd_leds_set(struct picolcd_data *data)
1104{ 1104{
1105 return 0; 1105 return 0;
1106} 1106}
1107#endif /* CONFIG_LEDS_CLASS */ 1107#endif /* CONFIG_HID_PICOLCD_LEDS */
1108 1108
1109/* 1109/*
1110 * input class device 1110 * input class device
@@ -1243,10 +1243,10 @@ static int picolcd_reset(struct hid_device *hdev)
1243 1243
1244 picolcd_resume_lcd(data); 1244 picolcd_resume_lcd(data);
1245 picolcd_resume_backlight(data); 1245 picolcd_resume_backlight(data);
1246#if defined(CONFIG_FB) || defined(CONFIG_FB_MODULE) 1246#ifdef CONFIG_HID_PICOLCD_FB
1247 if (data->fb_info) 1247 if (data->fb_info)
1248 schedule_delayed_work(&data->fb_info->deferred_work, 0); 1248 schedule_delayed_work(&data->fb_info->deferred_work, 0);
1249#endif /* CONFIG_FB */ 1249#endif /* CONFIG_HID_PICOLCD_FB */
1250 1250
1251 picolcd_leds_set(data); 1251 picolcd_leds_set(data);
1252 return 0; 1252 return 0;