Commit graph

23 commits

Author SHA1 Message Date
Kumar Kartikeya Dwivedi
eac859b84e staging: emxx_udc: Make incorrectly defined global static
The global gpio_desc pointer and int vbus_irq were defined in the header,
instead put the definitions in the translation unit and make them static as
there's only a single consumer, and these symbols shouldn't pollute the
global namespace.

This fixes the following sparse warnings for this driver:
drivers/staging/emxx_udc/emxx_udc.c: note: in included file:
drivers/staging/emxx_udc/emxx_udc.h:23:18: warning: symbol 'vbus_gpio' was not
declared. Should it be static?  drivers/staging/emxx_udc/emxx_udc.h:24:5:
warning: symbol 'vbus_irq' was not declared. Should it be static?

Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Link: https://lore.kernel.org/r/20210207085911.270746-1-memxor@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-07 10:15:05 +01:00
Mikhail Gusarov
14850f8ffb staging: emxx_udc: Remove misplaced debugging aid
emxx_udc.h contained a #if 0 block with debugging macros. These should
be supplied via command line or Kconfig.

Fixes checkstyle's
WARNING: Consider removing the code enclosed by this #if 0 and its #endif

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Link: https://lore.kernel.org/r/20200911213350.15914-1-dottedmag@dottedmag.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-13 09:20:46 +02:00
Alex Dewar
217b97f69e staging: emxx_udc: Use standard BIT() macro
Currently emxx_udc.h defines bit values using local macros. Use the
standard one instead.

Also, combine bit values with bitwise-or rather than addition, as
suggested by Coccinelle.

Signed-off-by: Alex Dewar <alex.dewar90@gmail.com>
Link: https://lore.kernel.org/r/20200818134922.409195-1-alex.dewar90@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-08-18 16:12:14 +02:00
Saiyam Doshi
8b77d94e69 staging: emxx_udc: remove local TRUE/FALSE definition
As the function argument and variables are defined as type 'bool',
remove local TRUE/FALSE define and change usage of those macros
with boolean value.

Signed-off-by: Saiyam Doshi <saiyamdoshi.in@gmail.com>
Link: https://lore.kernel.org/r/20190908175247.GA20699@SD
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-12 10:35:51 +01:00
Nishad Kamdar
48101806c5 Staging: emxx_udc: Switch to the gpio descriptor interface
Convert VBUS GPIO to use GPIO descriptors from <linux/gpio/consumer.h>
and stop using the old GPIO API.

Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-15 16:25:58 +01:00
Carmeli Tamir
64407f6e7d staging: emxx_udc: Added missing __iomem modifier to handle p_regs
Since in nbu2ss_drv_probe() p_regs is assigned from mmio_base, which is
marked as __iomem, p_regs also should be market with __iomem.

Signed-off-by: Carmeli Tamir <carmeli.tamir@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-08 03:59:47 -08:00
Greg Kroah-Hartman
a04c7278d3 staging: emxx_udc: remove redundant license text
Now that the SPDX tag is in the emxx_udc driver files, that identifies
the license in a specific and legally-defined manner.  So the extra GPL
text wording can be removed as it is no longer needed at all.

This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text.  And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.

No copyright headers or other non-license-description text was removed.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-15 16:03:46 +01:00
Greg Kroah-Hartman
38e08a45ed staging: emxx_udc: add SPDX identifier.
It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Fix up the staging emxx_udc driver to have a proper SPDX identifier,
based on the license text in the file itself.  The SPDX identifier is a
legally binding shorthand, which can be used instead of the full boiler
plate text.

This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Kate Stewart <kstewart@linuxfoundation.org>
Cc: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-15 16:03:45 +01:00
Alexis Lothoré
2c513789b4 staging: emxx_udc: Update "reserved" registers name
Ensure that "Reserved" members of registers mapping structure do not mix
upper/lower case

Signed-off-by: Alexis Lothoré <alexis.lothore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-15 07:42:00 +02:00
Alexis Lothoré
75d9c39376 staging: emxx_udc: Update EPn variables name
Update EPn* variables names to EPN* to prevent CamelCase usage

Signed-off-by: Alexis Lothoré <alexis.lothore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-15 07:42:00 +02:00
Varsha Rao
a71c8e9b8e staging: emxx_udc: Add comment for spinlock_t definition.
Members of nbu2ss_udc structure can change device state, maintain
completion state and control driver. Also provide access to read and
write to register. Hence, exclusive access to nbu2ss_udc is required.
The lock variable of type spinlock_t guarantees the exclusive access
and protects it.

In this patch, comment is added for spinlock_t definition, to fix the
following checkpatch issue:

CHECK: spinlock_t definition without comment

Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-09 14:13:51 +01:00
Anchal Jain
190b95170d staging: emxx_udc: Fix unsigned int to bare use of unsigned
This is a patch to fixes up a
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
found by the checkpatch.pl tool

Signed-off-by: Anchal Jain <anchalj109@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-16 10:10:34 +02:00
Sandhya Bankar
b6d3b4577e Staging: emxx_udc: emxx_udc: Add space around operator.
Add space around operator.This patch is found by checkpatch.pl script.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Ravi Teja Darbha
b68ff8f61e staging: emxx_udc: Avoid using multiple blank lines
Fixed multiple blank lines warning by checkpatch.pl

Signed-off-by: Ravi Teja Darbha <ravi2j@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:51 -07:00
Ravi Teja Darbha
446be1b553 staging: emxx_udc: Remove FSF mailing address
FSF mailing address is no longer required to be specified. Hence
removed.

Signed-off-by: Ravi Teja Darbha <ravi2j@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:51 -07:00
Hari Prasath Gujulan Elango
f194f4e9e5 staging: emxx_udc: remove commented code
This patch removes commented code warned by checkpatch.pl

Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-15 21:56:37 -07:00
Haneen Mohammed
f737ea50ba Staging: emxx_udc: Remove custom printk macro ERR
This patch removes custom printk macro ERR.
All the calls to this macro were replaced by de_err and pr_err.

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06 09:54:26 -08:00
Haneen Mohammed
f6ef6c094e Staging: emxx_udc: Fix do not add new typedefs and remove volatile
This patch fixes the following checkpatch.pl warnings:"do not add new
typedefs" and "Use of volatile is usually wrong".
Remove typedefs keyword and rename identifiers appropriately.
Remove volatile from union usb_regs_access
Update related  files.

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06 09:54:26 -08:00
Vatika Harlalka
ce5aebd678 Staging: emxx_udc: Convert from __attribute__((aligned(size))) to __aligned(size)
This patch addresses the checkpatch.pl warning
WARNING: __aligned(size) is preferred over __attribute__((aligned(size)))

aligned(x) is a macro :
#define __aligned(x)                   __attribute__((aligned(x)))

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-24 15:28:35 -08:00
Peter Chen
9239d88fc5 staging: emxx_udc: use common is_selfpowered
Delete private selfpowered variable, and use common one.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-01-29 10:32:48 -06:00
Paul Bolle
5e5d744364 staging: emxx_udc: remove check for CONFIG_MACH_EMGR
There's a check for CONFIG_MACH_EMGR. But the Kconfig symbol MACH_EMGR
doesn't exist. Remove that check and the single #define it hides. Note
that this macro isn't used by this driver anyway.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08 13:48:01 -07:00
Magnus Damm
96b29cacc7 staging: emxx_udc: I/O memory and IRQ resource support
Adjust the emxx_udc driver to make use of the standard
driver model to pass I/O memory and IRQ as resources
instead of hard coding those things in the driver.

Needs more work - the VBUS signal is yet not handled.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-19 14:42:48 -07:00
Magnus Damm
33aa8d45a4 staging: emxx_udc: Add Emma Mobile USB Gadget driver
Add the emxx_udc driver to staging based on an old linux-2.6.35.7
android tree. The driver has been brushed up slightly to complile
but it is still in great need of cleanup.

At this point DT bindings are clearly lacking and I doubt that the
driver even can run with multiple instances (global variables, hurray!).

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-19 14:42:17 -07:00