aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-picolcd.h
diff options
context:
space:
mode:
authorBruno Prémont <bonbons@linux-vserver.org>2012-08-19 13:32:04 -0400
committerJiri Kosina <jkosina@suse.cz>2012-09-05 05:48:06 -0400
commit16048709b2f6a7e721ac677f9a6741ac1c13ffd7 (patch)
tree3714cd94ea235a4869d55f8de990e8d4518ac714 /drivers/hid/hid-picolcd.h
parenta5785cc0101928663c8ed89f42afea719aecee09 (diff)
HID: picoLCD: rework hid-fbdev interaction
Split out all FB related data out of struct picolcd_data into a struct picolcd_fb_data that is allocated with fb_info. This way fb_info may cleanly outlive struct picolcd_data for as long as needed for its last user to drop his reference. Access to struct picolcd_data is now protected with struct picolcd_fb_data's lock and tile update reports are only generated while picolcd_fbdata->picolcd is not NULL and is not marked as failed (which indicates unplug in progress). Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-picolcd.h')
-rw-r--r--drivers/hid/hid-picolcd.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/hid/hid-picolcd.h b/drivers/hid/hid-picolcd.h
index 9200be165526..dc4c795dea5c 100644
--- a/drivers/hid/hid-picolcd.h
+++ b/drivers/hid/hid-picolcd.h
@@ -90,11 +90,6 @@ struct picolcd_data {
90 90
91#ifdef CONFIG_HID_PICOLCD_FB 91#ifdef CONFIG_HID_PICOLCD_FB
92 /* Framebuffer stuff */ 92 /* Framebuffer stuff */
93 u8 fb_update_rate;
94 u8 fb_bpp;
95 u8 fb_force;
96 u8 *fb_vbitmap; /* local copy of what was sent to PicoLCD */
97 u8 *fb_bitmap; /* framebuffer */
98 struct fb_info *fb_info; 93 struct fb_info *fb_info;
99#endif /* CONFIG_HID_PICOLCD_FB */ 94#endif /* CONFIG_HID_PICOLCD_FB */
100#ifdef CONFIG_HID_PICOLCD_LCD 95#ifdef CONFIG_HID_PICOLCD_LCD
@@ -119,9 +114,21 @@ struct picolcd_data {
119 int status; 114 int status;
120#define PICOLCD_BOOTLOADER 1 115#define PICOLCD_BOOTLOADER 1
121#define PICOLCD_FAILED 2 116#define PICOLCD_FAILED 2
122#define PICOLCD_READY_FB 4
123}; 117};
124 118
119#ifdef CONFIG_HID_PICOLCD_FB
120struct picolcd_fb_data {
121 /* Framebuffer stuff */
122 spinlock_t lock;
123 struct picolcd_data *picolcd;
124 u8 update_rate;
125 u8 bpp;
126 u8 force;
127 u8 ready;
128 u8 *vbitmap; /* local copy of what was sent to PicoLCD */
129 u8 *bitmap; /* framebuffer */
130};
131#endif /* CONFIG_HID_PICOLCD_FB */
125 132
126/* Find a given report */ 133/* Find a given report */
127#define picolcd_in_report(id, dev) picolcd_report(id, dev, HID_INPUT_REPORT) 134#define picolcd_in_report(id, dev) picolcd_report(id, dev, HID_INPUT_REPORT)