aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/panel (follow)
AgeCommit message (Collapse)AuthorFilesLines
2016-01-28Revert "Staging: panel: usleep_range is preferred over udelay"Sudip Mukherjee1-19/+15
This reverts commit ebd43516d3879f882a403836bba8bc5791f26a28. We should not be sleeping inside spin_lock. Fixes: ebd43516d387 ("Staging: panel: usleep_range is preferred over udelay") Cc: Sirnam Swetha <theonly.ultimate@gmail.com> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Reported-by: Huang, Ying <ying.huang@intel.com> Tested-by: Huang, Ying <ying.huang@intel.com> Cc: stable <stable@vger.kernel.org> # 4.4 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-29Staging: panel: Logical continuations should be on the previous lineSirnam Swetha1-6/+6
This patch fixes the checkpatch issue: CHECK: Logical continuations should be on the previous line Signed-off-by: Sirnam Swetha <theonly.ultimate@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-29Staging: panel: usleep_range is preferred over udelaySirnam Swetha1-15/+19
This patch fixes the issue: CHECK: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.txt Signed-off-by: Sirnam Swetha <theonly.ultimate@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-29Staging: panel: Removing multiple blank linesSirnam Swetha1-1/+0
This patch fixes the checkpatch issue CHECK: Please don't use multiple blank lines Signed-off-by: Sirnam Swetha <theonly.ultimate@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-29Staging: panel: spaces preferred around that '/'Sirnam Swetha1-1/+1
This patch fixes the checkpatch issue: CHECK: spaces preferred around that '/' Signed-off-by: Sirnam Swetha <theonly.ultimate@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16staging: panel: Prefer using BIT MacroAmitoj Kaur Chawla1-3/+3
Replace bit shifting on 1 with the BIT(x) Macro The semantic patch used to find this is: @@ int g; @@ -(1 << g) +BIT(g) Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04Staging: panel: Replace NULL comparison.Aybuke Ozdemir1-10/+10
Use ! operating instead of NULL checks. Addresses "CHECK: Comparison to NULL" from checkpatch.pl. Signed-off-by: Aybuke Ozdemir <aybuke.147@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12staging: panel: panel.c: Fixed coding style issuesNayeemahmed Badebade1-21/+42
Fixed warnings reported by checkpatch.pl: - Block comments use a trailing */ on a separate line - Block comments use * on subsequent lines Signed-off-by: Nayeemahmed Badebade <itachi.opsrc@gmail.com> Acked-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-31staging: panel: fix block comment usageAlex Wilson1-4/+8
Fixed two coding style warnings concerning multiline comments. Signed-off-by: Alex Wilson <alex.david.wilson@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-26Merge tag 'staging-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/stagingLinus Torvalds1-39/+21
Pull staging driver updates from Greg KH: "Here's the big, really big, staging tree patches for 4.2-rc1. Loads of stuff in here, almost all just coding style fixes / churn, and a few new drivers as well, one of which I just disabled from the build a few minutes ago due to way too many build warnings. Other than the one "disable this driver" patch, all of these have been in linux-next for quite a while with no reported issues" * tag 'staging-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (1163 commits) staging: wilc1000: disable driver due to build warnings Staging: rts5208: fix CHANGE_LINK_STATE value Staging: sm750fb: ddk750_swi2c.c: Insert spaces before parenthesis Staging: sm750fb: ddk750_swi2c.c: Place braces on correct lines Staging: sm750fb: ddk750_swi2c.c: Insert spaces around operators Staging: sm750fb: ddk750_swi2c.c: Replace spaces with tabs Staging: sm750fb: ddk750_swi2c.h: Shorten lines to under 80 characters Staging: sm750fb: ddk750_swi2c.h: Replace spaces with tabs Staging: sm750fb: modedb.h: Shorten lines to under 80 characters Staging: sm750fb: modedb.h: Replace spaces with tabs staging: comedi: addi_apci_3120: rename 'this_board' variables staging: comedi: addi_apci_1516: rename 'this_board' variables staging: comedi: ni_atmio: cleanup ni_getboardtype() staging: comedi: vmk80xx: sanity check context used to get the boardinfo staging: comedi: vmk80xx: rename 'boardinfo' variables staging: comedi: dt3000: rename 'this_board' variables staging: comedi: adv_pci_dio: rename 'this_board' variables staging: comedi: cb_pcidas64: rename 'thisboard' variables staging: comedi: cb_pcidas: rename 'thisboard' variables staging: comedi: me4000: rename 'thisboard' variables ...
2015-06-01staging: panel: use new parport device modelSudip Mukherjee1-5/+9
Converted to use the new device-model parallel port. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31staging: panel: use schedule_timeout_interruptible()Nicholas Mc Guire1-5/+3
API consolidation with coccinelle found: ./drivers/staging/panel/panel.c:782:2-18: consolidation with schedule_timeout_*() recommended This is a 1:1 conversion with respect to schedule_timeout() to the schedule_timeout_interruptible() helper only - so only an API consolidation to improve readability. The timeout was being passed as (ms * HZ + 999) / 1000 but that simply looks wrong - rather than "manual" converting to jiffies, msecs_to_jiffies which handles all corner-cases correctly, was used. Patch was compile tested with x86_64_defconfig + CONFIG_STAGING=y, CONFIG_PARPORT=m, CONFIG_PANEL=m Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Acked-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24staging: panel: fix stackdumpSudip Mukherjee1-23/+21
if we load the module, unload and then again try to load the module, we will get a stackdump. In the module_exit function we are unregistering the device and releasing the parport. So when we reach the detach function parport is already null and the unregister_reboot_notifier() is never called. When we again try to load the module it again tries register_reboot_notifier() and gives us a stackdump as its earlier registration is still not removed. It was caused by the commit bb046fef9668 ('staging: panel: register reboot') Fix this by moving all the unregistering and releasing in the detach function, which should be the ideal case as the detach will be called if we try to unregister the driver or if the parport is removed. Fixes: bb046fef9668 ('staging: panel: register reboot') Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-30staging: panel: remove duplicate codeSudip Mukherjee1-14/+0
both the misc_deregister(), parport_release() and parport_unregister_device() is there in the module_exit function also. detach is called from parport_unregister_driver() and by the time detach executes misc_deregister(), parport_release() and parport_unregister_device() has already executed marking keypad_initialized and lcd.initialized as false. so this part of the code will never execute. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26staging: panel: fix lcd typeSudip Mukherjee1-6/+6
the lcd type as defined in the Kconfig is not matching in the code. as a result the rs, rw and en pins were getting interchanged. Kconfig defines the value of PANEL_LCD to be 1 if we select custom configuration but in the code LCD_TYPE_CUSTOM is defined as 5. my hardware is LCD_TYPE_CUSTOM, but the pins were assigned to it as pins of LCD_TYPE_OLD, and it was not working. Now values are corrected with referenece to the values defined in Kconfig and it is working. checked on JHD204A lcd with LCD_TYPE_CUSTOM configuration. Cc: <stable@vger.kernel.org> # 2.6.32+ Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Acked-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-20staging: panel: remove initialization checkSudip Mukherjee1-11/+0
no need to monitor init_in_progress now as keypad_send_key() can only be called after the timer is initialized. and timer is initialized from keypad_init() which is in the attach section and can only execute after the module has initialized. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Acked-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-20staging: panel: return register valueSudip Mukherjee1-3/+4
we were returning success even if the module failed to register. now we are returning the actual return value, success or error. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Acked-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-20staging: panel: register rebootSudip Mukherjee1-4/+3
we donot need the reboot notifier in module init section, as the notifier is used after lcd is initialized. so lets register for the reboot notifier only after we have successfully attached to the parallel port. and similarly unregister at detach. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Acked-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06staging: panel: initialize lcd if lcd enabledSudip Mukherjee1-19/+22
initialiaze lcd parameters only if lcd is enabled. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Acked-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06staging: panel: register driver after checking deviceSudip Mukherjee1-12/+6
register the driver only if lcd or keypad has been enabled and if both are disabled then just exit. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Acked-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26staging: panel: replace init_timer by setup_timerAya Mahfouz1-3/+1
This patch replaces init_timer and the 2 step initialization of function and data by setup_timer to make the code more concise. The issue was discovered using the following coccinelle script: @@ expression ds, e1, e2; @@ -init_timer (&ds); +setup_timer (&ds, e1, e2); ... ( -ds.function = e1; ... -ds.data = e2; | -ds.data = e2; ... -ds.function = e1; ) Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-28drivers/staging: use current->state helpersDavidlohr Bueso1-1/+1
Call __set_current_state() instead of assigning the new state directly. These interfaces also aid CONFIG_DEBUG_ATOMIC_SLEEP environments, keeping track of who changed the state. Signed-off-by: Davidlohr Bueso <dbueso@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-12staging: panel: Remove magic numbers in LCD commandsMariusz Gorski1-30/+66
Get rid of magic numbers in LCD commands and replace them with defined values, so that it's more obvious that the commands are doing. Signed-off-by: Mariusz Gorski <marius.gorski@gmail.com> Acked-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-12staging: panel: Remove unused variableMariusz Gorski1-6/+0
Remove lcd.left_shift because it is only written to at some places but never read from. Signed-off-by: Mariusz Gorski <marius.gorski@gmail.com> Acked-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-12-02staging: panel: Move LCD-related state into struct lcdMariusz Gorski1-121/+134
Move more or less all LCD-related state into struct lcd in order to get better cohesion; use bool instead of int where it makes sense. Signed-off-by: Mariusz Gorski <marius.gorski@gmail.com> Acked-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-12-02staging: panel: Remove more magic number comparisonMariusz Gorski1-10/+10
Use a defined value instead of magic number comparison for checking whether a module param value has been set. Signed-off-by: Mariusz Gorski <marius.gorski@gmail.com> Acked-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-12-02staging: panel: Refactor LCD init codeMariusz Gorski1-141/+163
Rework lcd_init method to make it a little bit more clear about the precedence of the params, move LCD geometry and pins layout to the LCD struct and thus make the LCD-related module params effectively read-only. Signed-off-by: Mariusz Gorski <marius.gorski@gmail.com> Acked-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-12-02staging: panel: Make two more module params read-onlyMariusz Gorski1-34/+37
Make keypad_type and lcd_type module params read-only. This step also starts making it more clear what is the precedence of device params coming from different sources (device profile, runtime module param values etc). Signed-off-by: Mariusz Gorski <marius.gorski@gmail.com> Acked-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-12-02staging: panel: Start making module params read-onlyMariusz Gorski1-14/+21
Start decoupling module params from the actual device state, both for lcd and keypad, by keeping the params read-only and moving the device state to related structs. Signed-off-by: Mariusz Gorski <marius.gorski@gmail.com> Acked-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-12-02staging: panel: Use defined value or checking module params stateMariusz Gorski1-43/+43
Avoid magic number and use a comparison with a defined value instead that checks whether module param has been set by the user to some value at loading time. Signed-off-by: Mariusz Gorski <marius.gorski@gmail.com> Acked-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-12-02staging: panel: Remove magic numbersMariusz Gorski1-10/+12
Get rid of magic numbers indicating that the value of a module param is not set. Use a defined value instead. Signed-off-by: Mariusz Gorski <marius.gorski@gmail.com> Acked-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-12-02staging: panel: Call init function directlyMariusz Gorski1-6/+1
Remove useless function and let the kernel call the actual init function directly. Signed-off-by: Mariusz Gorski <marius.gorski@gmail.com> Acked-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-12-02staging: panel: Set default parport module param valueMariusz Gorski1-4/+1
Set default parport module param value to DEFAULT_PARPORT so that a if-block can be avoided. Signed-off-by: Mariusz Gorski <marius.gorski@gmail.com> Acked-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-26staging: panel: Use better names for two defined valuesMariusz Gorski1-8/+8
Give DEFAULT_KEYPAD and DEFAULT_LCD defines better names, so that their meaning is emphasized. Signed-off-by: Mariusz Gorski <marius.gorski@gmail.com> Acked-By: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-26staging: panel: Reorder module parameter declarationsMariusz Gorski1-35/+38
Change the order of the module parameter declarations so that it matches the Kconfig order. Signed-off-by: Mariusz Gorski <marius.gorski@gmail.com> Acked-By: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-26staging: panel: Reorder DEFAULT_* values redefinesMariusz Gorski1-13/+13
Change the order of the DEFAULT_* values redefines so that it matches the Kconfig order. Signed-off-by: Mariusz Gorski <marius.gorski@gmail.com> Acked-By: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-26staging: panel: Reorder initial DEFAULT_* definesMariusz Gorski1-4/+4
Change the order of the initial DEFAULT_* defines so that it matches the Kconfig order. Signed-off-by: Mariusz Gorski <marius.gorski@gmail.com> Acked-By: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-05staging: panel: Fix single-open policy race conditionMariusz Gorski1-9/+10
Fix the implementation of a single-open policy for both devices (lcd and keypad) by using atomic_t instead of plain ints. Signed-off-by: Mariusz Gorski <marius.gorski@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-03staging: panel: Remove outdated TODO taskMariusz Gorski1-1/+0
Remove Lindent task from TODO file as it's obsolete. Signed-off-by: Mariusz Gorski <marius.gorski@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29staging: panel: Use designated initializersMariusz Gorski1-6/+6
Fix "warning: missing initializer [-Wmissing-field-initializers]" by using designated struct initializers. Signed-off-by: Mariusz Gorski <marius.gorski@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-10Staging: panel: fixed frivilous else statement warningVincent Heuken1-4/+5
Fixed one instance of the following checkpatch.pl warning in panel.c: WARNING: else is not generally useful after a break or return Signed-off-by: Vincent Heuken <me@vincentheuken.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-25staging: panel: (coding style) Multiple assignmentsDominique van den Broeck1-13/+30
Style-only modifications to comply with checkpatch.pl --strict --file. . Breaks down compound assignments. Signed-off-by: Dominique van den Broeck <domdevlin@free.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-23staging: panel: (coding style) Line alignments and malloc sizeofDominique van den Broeck1-13/+11
Style-only modifications to comply with checkpatch.pl --strict --file. . Correctly realigns the lines that needed to be ; . Suppress useless blank rows ; . Fix sizeof() issues in various -malloc() functions. Signed-off-by: Dominique van den Broeck <domdevlin@free.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-23staging: panel: (coding style) Matching bracesDominique van den Broeck1-10/+11
Style-only modifications to comply with checkpatch.pl --strict --file. . Adds every missing brace in condition statements. Signed-off-by: Dominique van den Broeck <domdevlin@free.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-23staging: panel: fix regression in lcd_writeBastien Armand1-1/+1
This patch fix a regression in lcd_write caused by commit 70a8c3eb8546cefe40fb0bc7991e8899b7b91075 Signed-off-by: Bastien Armand <armand.bastien@laposte.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-18staging: panel: add blank lines after declarationsBastien Armand1-0/+15
This patch fixes "Missing a blank line after declarations" checkpatch warnings in panel.c. Signed-off-by: Bastien Armand <armand.bastien@laposte.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-18staging: panel: fix sparse warnings in keypad_readBastien Armand1-2/+2
This patch fixes two sparse warnings related to keypad_read : warning: incorrect type in argument 1 (different address spaces) warning: incorrect type in initializer (incompatible argument 2 (different address spaces)) Signed-off-by: Bastien Armand <armand.bastien@laposte.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-18staging: panel: fix sparse warnings in lcd_writeBastien Armand1-96/+109
This patch fixes two sparse warnings related to lcd_write : warning: incorrect type in argument 1 (different address spaces) warning: incorrect type in initializer (incompatible argument 2 (different address spaces)) lcd_write can be used from kernel space (in panel_lcd_print) or from user space. So we introduce the lcd_write_char function that will write a char to the device. We modify lcd_write and panel_lcd_print to use it. Finally we add __user annotation missing in lcd_write. Signed-off-by: Bastien Armand <armand.bastien@laposte.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-18staging: panel: replace del_timer by del_timer_syncJulia Lawall1-1/+1
Use del_timer_sync to ensure that the timer is stopped on all CPUs before the driver exists. This change was suggested by Thomas Gleixner. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r@ declarer name module_exit; identifier ex; @@ module_exit(ex); @@ identifier r.ex; @@ ex(...) { <... - del_timer + del_timer_sync (...) ...> } // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-27Staging: panel: Fix quoted string split across line in panel.cMonam Agarwal1-18/+9
This patch fixes the following checkpatch.pl warning in panel.c: WARNING: quoted string split across lines Signed-off-by: Monam Agarwal <monamagarwal123@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>