aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-picolcd.c
Commit message (Collapse)AuthorAge
* Fix common misspellingsLucas De Marchi2011-03-31
| | | | | | Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
* backlight: add backlight typeMatthew Garrett2011-03-22
| | | | | | | | | | | | | | | | | | | There may be multiple ways of controlling the backlight on a given machine. Allow drivers to expose the type of interface they are providing, making it possible for userspace to make appropriate policy decisions. Signed-off-by: Matthew Garrett <mjg@redhat.com> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: David Airlie <airlied@linux.ie> Cc: Alex Deucher <alexdeucher@gmail.com> Cc: Ben Skeggs <bskeggs@redhat.com> Cc: Zhang Rui <rui.zhang@intel.com> Cc: Len Brown <lenb@kernel.org> Cc: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* Merge branches 'upstream' and 'upstream-fixes' into for-linusJiri Kosina2011-01-07
|\
| * HID: hid-picolcd: Fix memory leak in picolcd_debug_out_report()Jesper Juhl2011-01-02
| | | | | | | | | | | | | | | | | | | | We have a memory leak in drivers/hid/hid-picolcd.c::picolcd_debug_out_report() in an error path.. We are not always freeing the memory allocated to 'buff' - this patch makes sure we always kfree() what we allocate with kmalloc() when it is no longer needed. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * HID: picolcd: fix misuse of logical operation in place of bitopDavid Sterba2010-12-27
| | | | | | | | | | | | | | CC: Bruno Prémont <bonbons@linux-vserver.org> CC: Jiri Kosina <jkosina@suse.cz> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | HID: hid-picolcd: don't use flush_scheduled_work()Tejun Heo2010-12-11
| | | | | | | | | | | | | | | | | | flush_scheduled_work() is deprecated and scheduled to be removed. Directly flush picolcd_fb_cleanup on exit instead. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | HID: Add and use hid_<level>: dev_<level> equivalentsJoe Perches2010-12-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Neaten current uses of dev_<level> by adding and using hid specific hid_<level> macros. Convert existing uses of dev_<level> uses to hid_<level>. Convert hid-pidff printk uses to hid_<level>. Remove err_hid and use hid_err instead. Add missing newlines to logging messages where necessary. Coalesce format strings. Add and use pr_fmt(fmt) KBUILD_MODNAME ": " fmt Other miscellaneous changes: Add const struct hid_device * argument to hid-core functions extract() and implement() so hid_<level> can be used by them. Fix bad indentation in hid-core hid_input_field function that calls extract() function above. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | HID: add hid_hw_open/close/power() handlersDmitry Torokhov2010-12-08
|/ | | | | | | | Instead of exposing the guts of hid->ll_driver relationship to HID sub-drivers provide these helpers to encapsulate the details. Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: picolcd: correct ordering of framebuffer freeingBruno Prémont2010-08-06
| | | | | | | Fix the free() ordering (which was never reached due to wrong check). Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: picolcd: testing the wrong variableDan Carpenter2010-08-06
| | | | | | | | "ref_cnt" is a point to the reference count and it's non-null. We really want to test the reference count itself. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: picolcd: implement refcounting of framebufferBruno Prémont2010-07-12
| | | | | | | | | | | | | As our device may be hot-unplugged and framebuffer cannot handle this case by itself we need to keep track of usage count so as to release fb_info and framebuffer memory only after the last user has closed framebuffer. We need to do the freeing in a scheduled work as fb_release() is called with fb_info lock held. Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: picolcd: do not reallocate memory on depth changeBruno Prémont2010-07-12
| | | | | | | | | | | | | | | Reallocating memory in depth change does not work well if some userspace application has mmapped() the framebuffer as that mapping does not get adjusted (thus application continues to write to old buffer). In addition doing deferred_io_cleanup() and init() inside of set_par() tends to deadlock with fbcon's flashing cursor. Avoid all this by allocating a buffer that can hold 8bpp framebuffer and just use 1/8 of it while running at 1bpp. Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: picolcd: Add minimal palette required by fbcon on 8bppBruno Prémont2010-07-12
| | | | | | | | | | | Add a minimal palette so fbcon does not try to dereference a NULL point when fb is set to 8bpp. fbcon stores pixels the other way around in bytes for 1bpp than intially implemented, correct this. Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: picolcd: fix deferred_io init/cleanup to fb orderingBruno Prémont2010-07-11
| | | | | | | | | | Adjust ordering if framebuffer (un)registration and defio init/cleanup to match the correct order (init defio, register FB ... unregister FB, cleanup defio) Acked-by: Jaya Kumar <jayakumar.lkml@gmail.com> Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: picolcd: Eliminate use after freeJulia Lawall2010-05-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The skip label frees resp, which has not been allocated at the point of this goto and then does a break, based on the fact that err is non-zero. This is replaced by a break directly. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @free@ expression E; position p; @@ kfree@p(E) @@ expression free.E, subE<=free.E, E1; position free.p; @@ kfree@p(E) ... ( subE = E1 | * E ) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: add PM support to PicoLCD deviceBruno Prémont2010-05-03
| | | | | | | | Add PM support in order to turn off backlight on suspend, restore it on resume and especially restore complete state on reset-resume. Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: split picolcd's operation_mode sysfs attributeBruno Prémont2010-04-27
| | | | | | | | | | | | | Original operation_mode sysfs attribute accepts the operation mode as main value with an option delay as second value to change the start-up delay on mode change. As it is preferred to have exactly one value per sysfs attribute, extract this delay into a separate sysfs attribute called operation_mode_delay. Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: fix picolcd's version parsingBruno Prémont2010-04-26
| | | | | | | | During grouping of version checking code bootloader mode's version bytes got swapped. Fix their order. Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: hid-picolcd depends on LCD_CLASS_DEVICEBruno Prémont2010-04-11
| | | | | | | | | | | | | | | | | | 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>
* HID: picolcd: fix build failureJiri Kosina2010-04-01
| | | | | | | Using copy_{to,from}_user requires the include of linux/uaccess.h. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: add experimental access to PicoLCD device's EEPROM and FLASHBruno Prémont2010-03-31
| | | | | | | | | | | | | | The PicoLCD device has a small amount of EEPROM and also provides access to its FLASH where firmware and splash image are saved. In flasher mode FLASH access is the only active feature. Give read/write access to both via debugfs files. NOTE: EEPROM and FLASH access should be switched to better suited API, until then the will reside in debugfs Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: add GPO (leds) support to PicoLCD deviceBruno Prémont2010-03-31
| | | | | | | | | | Add leds support to PicoLCD device to drive the GPO pins. GPO support depends on leds class and is only being compiled if leds class has been selected. Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: add lcd support to PicoLCD deviceBruno Prémont2010-03-31
| | | | | | | | | | Add lcd support to PicoLCD device. LCD support depends on lcd class and is only being compiled if lcd class has been selected. Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: add backlight support to PicoLCD deviceBruno Prémont2010-03-31
| | | | | | | | | | Add backlight support to PicoLCD device. Backlight support depends on backlight class and is only being compiled if backlight class has been selected. Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: add framebuffer support to PicoLCD deviceBruno Prémont2010-03-31
| | | | | | | | | | | | Add framebuffer support to PicoLCD device with use of deferred-io. Only changed areas of framebuffer get sent to device in order to save USB bandwidth and especially resources on PicoLCD device or allow higher refresh rate for a small area. Changed tiles are determined while updating shadow framebuffer. Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: new driver for PicoLCD deviceBruno Prémont2010-03-31
Add basic driver for PicoLCD graphics device. Initially support keypad with input device and provide support for debugging communication via events file from debugfs. Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>