Commit Graph

30 Commits

Author SHA1 Message Date
Sebastian Reichel 068afbbebe HSI: omap_ssi_port: Don't print uninitialized err
Do not print err variable, that has nothing to do with the error.
This fixes a warning, that is printed at build time:

drivers/hsi/controllers/omap_ssi_port.c: In function ‘ssi_port_probe’:
drivers/hsi/controllers/omap_ssi_port.c:1121:10: warning: ‘err’ may be used uninitialized in this function [-Wuninitialized]

Signed-off-by: Sebastian Reichel <sre@kernel.org>
2014-10-20 00:11:59 +02:00
Michael Opdenacker a26a425081 HSI: remove deprecated IRQF_DISABLED
Remove the use of the IRQF_DISABLED flag
from drivers/hsi/clients/nokia-modem.c

It's a NOOP since 2.6.35 and it will be removed soon.

Signed-off-by: Michael Opdenacker <michael.opdenacker@free-electrons.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2014-10-03 04:19:35 +02:00
Linus Torvalds ec6c0a7778 HSI changes for the v3.17 series
* misc. fixes in SSI related drivers
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABCgAGBQJT4WkMAAoJENju1/PIO/qaJHEP/jJbNgyl9Yk9/zSWPFmaU7NA
 XlK1ul3Hqdni/iKk9kxDU+fnUs7JP2PYtpvbGKQGMSFsnKU5B4pEM79qcESUiEIT
 TXYj/dimllJuxXAlqp6U+XRlQAqs0VWBdYoyQtR6rY9NijPW3k6tMN3DKwmJ9L2p
 tDSTJnSQKmpARp/W+gOvcA0Jk68cVasAQqjbiZGTOPigHsLsUTeU2tYZnNi0qZpw
 yZ0rF7qFiqtrQZ4tADe7BQgggW/UJponL0Xvb7rsORUfKDot4qx6Vy3tChCqVz6u
 eKx1cm93yC8RVCVeLb0Wbt1RL8Xk2T6Pvk/5YdYS2v4Q3TN32BG5er2HJs+GFvlR
 PeTDYwSncoNzFBp8HGIJRsp3rr1xg1N0/4mpYdrxHhs2/4AIcv+RIDGgcydzS6aV
 obXxNyAHzsJzJTYPqfISATqxMYcVIa7/opt50x0XEdQ7NTBpPp5Wb6cLNROZ7x6t
 q7Ku7c5bAkLL7VzDrs1oLWxrNCRBGLFmzrnUykeHPcT7SYsRZV8l2w8SEaYGc0W9
 0Uhb2rZeOiBoPa2+tad9HHxcXJKi1XBX8Yj9/IclqWCJJt63CtBaddMPEof6xZpE
 rGIVA/ut3azbqTgJ0si4HkO+/k/5apAJJW+CojTjzj8TqKn6JiToDnDWyOTJTbMV
 JcW379525VV9luU82ssO
 =jKr0
 -----END PGP SIGNATURE-----

Merge tag 'hsi-for-3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-hsi

Pull HSI changes from Sebastian Reichel:
 "Misc fixes in SSI related drivers"

* tag 'hsi-for-3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-hsi:
  HSI: omap_ssi: Fix return value check in ssi_debug_add_ctrl()
  HSI: omap_ssi_port: Fix return value check in ssi_debug_add_port()
  HSI: ssi_protocol: Fix sparse non static symbol warning
  drivers/hsi/controllers/omap_ssi{,_port}.c: fix failure checks
2014-08-06 20:06:14 -07:00
Wei Yongjun 3fd276e9c0 HSI: omap_ssi: Fix return value check in ssi_debug_add_ctrl()
In case of error, the function debugfs_create_*() returns NULL
pointer not ERR_PTR() if debugfs is enabled. The IS_ERR() test
in the return value check should be replaced with NULL test.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2014-07-31 00:20:33 +02:00
Wei Yongjun c2acb7c4d5 HSI: omap_ssi_port: Fix return value check in ssi_debug_add_port()
In case of error, the function debugfs_create_*() returns NULL
pointer not ERR_PTR() if debugfs is enabled. The IS_ERR() test
in the return value check should be replaced with NULL test.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2014-07-31 00:20:21 +02:00
Wei Yongjun 0a0ea07d3d HSI: ssi_protocol: Fix sparse non static symbol warning
Fixes the following sparse warning:

drivers/hsi/clients/ssi_protocol.c:904:6: warning:
 symbol 'ssip_port_event' was not declared. Should it be static?

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2014-07-20 09:31:16 +02:00
Andrey Utkin b74d4954ae drivers/hsi/controllers/omap_ssi{,_port}.c: fix failure checks
1.

[linux-3.16-rc5/drivers/hsi/controllers/omap_ssi.c:357]: (style) Checking if
unsigned variable 'gdd_irq' is less than zero.

Source code is

    omap_ssi->gdd_irq = platform_get_irq_byname(pd, "gdd_mpu");
    if (omap_ssi->gdd_irq < 0) {

2.

[linux-3.16-rc5/drivers/hsi/controllers/omap_ssi_port.c:1017]: (style) Checking
if unsigned variable 'irq' is less than zero.

Source code is

    omap_port->irq = platform_get_irq(pd, 0);
    if (omap_port->irq < 0) {

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=80441
Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Andrey Utkin <andrey.krieger.utkin@gmail.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2014-07-17 22:45:28 +02:00
Tom Gundersen c835a67733 net: set name_assign_type in alloc_netdev()
Extend alloc_netdev{,_mq{,s}}() to take name_assign_type as argument, and convert
all users to pass NET_NAME_UNKNOWN.

Coccinelle patch:

@@
expression sizeof_priv, name, setup, txqs, rxqs, count;
@@

(
-alloc_netdev_mqs(sizeof_priv, name, setup, txqs, rxqs)
+alloc_netdev_mqs(sizeof_priv, name, NET_NAME_UNKNOWN, setup, txqs, rxqs)
|
-alloc_netdev_mq(sizeof_priv, name, setup, count)
+alloc_netdev_mq(sizeof_priv, name, NET_NAME_UNKNOWN, setup, count)
|
-alloc_netdev(sizeof_priv, name, setup)
+alloc_netdev(sizeof_priv, name, NET_NAME_UNKNOWN, setup)
)

v9: move comments here from the wrong commit

Signed-off-by: Tom Gundersen <teg@jklm.no>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-15 16:12:48 -07:00
Arnd Bergmann b357d7b58f hsi: omap_ssi_port: use normal module refcounting
The ref_module() function is used for internal housekeeping of the
module code, it's not normally used by subsystems or device drivers,
and the use of ref_module in the omap_ssi_port driver causes a link
build error when modules are disabled:

hsi/controllers/omap_ssi_port.c: In function 'ssi_port_probe':
hsi/controllers/omap_ssi_port.c:1119:2: error: implicit declaration of function 'ref_module' [-Werror=implicit-function-declaration]

This changes the omap_ssi_port driver to use try_module_get()
and module_put() instead, which is the normal way to ensure that
the driver providing a device used in another module does not
go away.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Sebastian Reichel <sre@kernel.org>
Cc: Carlos Chinea <carlos.chinea@nokia.com>
Cc: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2014-06-05 00:59:05 +02:00
Arnd Bergmann 518e1624f5 HSI: fix omap ssi driver dependency
The SSI protocol implementation has an incorrect dependency on the OMAP_SSI
driver, which allows SSI to be built-in while the underlying OMAP_SSI
implementation is a loadable module, causing a link error.

This changes the dependency to the simpler 'depends on OMAP_SSI' that also
ensures that SSI-protocol can only be a module if OMAP_SSI is not built-in.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Sebastian Reichel <sre@kernel.org>
Cc: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2014-06-03 23:46:28 +02:00
Sebastian Reichel eafaebd987 HSI: Introduce Nokia N900 modem driver
The Nokia N900's modem is connected via Synchronous Serial Interface (SSI),
which is a legacy version of MIPI's High-speed Synchronous Serial Interface
(HSI).

The handles the GPIOs for enabling and resetting the modem and instanciates
ssi-protocol for data exchange. It does not yet support exchanging voice data
with the modem.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
Reviewed-by: Pavel Machek <pavel@ucw.cz>
Tested-By: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
2014-05-16 00:55:42 +02:00
Sebastian Reichel dc7bf5d718 HSI: Introduce driver for SSI Protocol
This adds a driver for the SSI McSAAB protocol as used in
the Nokia N900.

Signed-off-by: Carlos Chinea <carlos.chinea@nokia.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Tested-By: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
2014-05-16 00:55:30 +02:00
Sebastian Reichel b209e047bc HSI: Introduce OMAP SSI driver
Add OMAP SSI driver to the HSI subsystem.

The Synchronous Serial Interface (SSI) is a legacy version
of HSI. As in the case of HSI, it is mainly used to connect
Application engines (APE) with cellular modem engines (CMT)
in cellular handsets.

It provides a multichannel, full-duplex, multi-core communication
with no reference clock. The OMAP SSI block is capable of reaching
speeds of 110 Mbit/s.

Signed-off-by: Carlos Chinea <carlos.chinea@nokia.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Tested-By: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
2014-05-16 00:54:51 +02:00
Sebastian Reichel a2aa24734d HSI: Add common DT binding for HSI client devices
Implement and document generic DT bindings for HSI clients.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
Reviewed-by: Pavel Machek <pavel@ucw.cz>
Tested-By: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
2014-05-16 00:54:45 +02:00
Sebastian Reichel 8491451024 HSI: export method to (un)register clients
Expose method for registering and unregistering HSI clients, so that
client drivers can register other client drivers.

This is useful for HSI drivers, which want to use the functionality
of other HSI drivers. For example the N900 modem driver can load HSI
drivers for mcsaab protocol and speech protocol.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
Reviewed-by: Pavel Machek <pavel@ucw.cz>
Tested-By: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
2014-05-16 00:54:41 +02:00
Sebastian Reichel a088cf161c HSI: Add channel resource support to HSI clients
Make HSI channel ids platform data, which can be provided
by platform data.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
Tested-By: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
2014-05-16 00:54:36 +02:00
Sebastian Reichel a0bf37edb4 HSI: method to unregister clients from an hsi port
This exports a method to unregister all clients from
an hsi port.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
Reviewed-by: Pavel Machek <pavel@ucw.cz>
Tested-By: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
2014-05-16 00:54:29 +02:00
Sebastian Reichel 84d93b5e60 HSI: hsi-char: fix driver for multiport scenarios
Fix return code check of alloc_chrdev_region, which
returns 0 on success.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
Reviewed-by: Pavel Machek <pavel@ucw.cz>
2014-05-04 09:49:58 +02:00
Greg Kroah-Hartman 0017314689 hsi: convert bus code to use dev_groups
The dev_attrs field of struct bus_type is going away soon, dev_groups
should be used instead.  This converts the hsi code to use the
correct field.

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-16 18:36:04 -07:00
Kees Cook 02aa2a3763 drivers: avoid format string in dev_set_name
Calling dev_set_name with a single paramter causes it to be handled as a
format string.  Many callers are passing potentially dynamic string
content, so use "%s" in those cases to avoid any potential accidents,
including wrappers like device_create*() and bdi_register().

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-07-03 16:07:41 -07:00
Randy Dunlap 8eae508b7c hsi: fix kernel-doc warnings
Fix kernel-doc warnings in hsi files:

  Warning(include/linux/hsi/hsi.h:136): Excess struct/union/enum/typedef member 'e_handler' description in 'hsi_client'
  Warning(include/linux/hsi/hsi.h:136): Excess struct/union/enum/typedef member 'pclaimed' description in 'hsi_client'
  Warning(include/linux/hsi/hsi.h:136): Excess struct/union/enum/typedef member 'nb' description in 'hsi_client'
  Warning(drivers/hsi/hsi.c:434): No description found for parameter 'handler'
  Warning(drivers/hsi/hsi.c:434): Excess function parameter 'cb' description in 'hsi_register_port_event'

Don't document "private:" fields with kernel-doc notation.
If you want to leave them fully documented, that's OK, but
then don't mark them as "private:".

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Carlos Chinea <carlos.chinea@nokia.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org
Cc: linux-omap@vger.kernel.org
Acked-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-03-01 13:39:00 -08:00
Greg Kroah-Hartman 0fe763c570 Drivers: misc: remove __dev* attributes.
CONFIG_HOTPLUG is going away as an option.  As a result, the __dev*
markings need to be removed.

This change removes the use of __devinit, __devexit_p, __devinitdata,
__devinitconst, and __devexit from these drivers.

Based on patches originally written by Bill Pemberton, but redone by me
in order to handle some of the coding style issues better, by hand.

Cc: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-03 15:57:16 -08:00
Carlos Chinea fdadb6e9a5 HSI: hsi_char: Remove max_data_size from sysfs
Remove max_data_size sysfs entry. Otherwise is possible
to have a buffer overrun if its value is increased after
the device is open.

Signed-off-by: Carlos Chinea <carlos.chinea@nokia.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2012-04-23 14:23:32 +03:00
Carlos Chinea ec1c56ff81 HSI: hsi: Rework hsi_event interface
Remove custom hack and make use of the notifier chain interfaces for
delivering events from the ports to their associated clients.
Clients that want to receive port events need to register their callbacks
using hsi_register_port_event(). The callbacks can be called in interrupt
context. Use hsi_unregestier_port_event() to undo the registration.

Signed-off-by: Carlos Chinea <carlos.chinea@nokia.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2012-04-23 14:23:32 +03:00
Carlos Chinea 6f02b9e9b4 HSI: hsi: Remove controllers and ports from the bus
HSI controllers and ports do not belong to the HSI bus.
Those devices are not supposed to have a driver attached to them.

Signed-off-by: Carlos Chinea <carlos.chinea@nokia.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2012-04-23 14:23:32 +03:00
Carlos Chinea 90e41f9dc7 HSI: hsi: Fix error path cleanup on client registration
HSI client structure should be freed on error path after
calling device_registration by dropping a reference to it.

Signed-off-by: Carlos Chinea <carlos.chinea@nokia.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2012-04-23 14:23:31 +03:00
Carlos Chinea 5a218ceba7 HSI: hsi: Rework hsi_controller release
Use the proper release mechanism for hsi_controller and
hsi_ports structures. Free the structures through their
associated device release callbacks.

Signed-off-by: Carlos Chinea <carlos.chinea@nokia.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2012-04-23 14:23:31 +03:00
Andras Domokos f9e402016d HSI: hsi_char: Add HSI char device kernel configuration
Add HSI character device kernel configuration

Signed-off-by: Andras Domokos <andras.domokos@nokia.com>
Signed-off-by: Carlos Chinea <carlos.chinea@nokia.com>
2012-01-05 15:42:13 +02:00
Andras Domokos 4e69fc2275 HSI: hsi_char: Add HSI char device driver
Add HSI char device driver to the kernel.

Signed-off-by: Andras Domokos <andras.domokos@nokia.com>
Signed-off-by: Carlos Chinea <carlos.chinea@nokia.com>
2012-01-05 15:42:13 +02:00
Carlos Chinea a056ab8c7a HSI: hsi: Introducing HSI framework
Adds HSI framework in to the linux kernel.

High Speed Synchronous Serial Interface (HSI) is a
serial interface mainly used for connecting application
engines (APE) with cellular modem engines (CMT) in cellular
handsets.

HSI provides multiplexing for up to 16 logical channels,
low-latency and full duplex communication.

Signed-off-by: Carlos Chinea <carlos.chinea@nokia.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2012-01-05 15:42:13 +02:00