History log of /linux-master/drivers/hsi/controllers/omap_ssi_port.c
Revision Date Author Comments
# 42877c38 25-May-2023 Osama Muhammad <osmtendev@gmail.com>

HSI: omap_ssi_port: Drop error checking for debugfs_create_dir

This patch fixes the error checking in omap_ssi_port.c. The DebugFS
kernel API is developed in a way that the caller can safely ignore the
errors that occur during the creation of DebugFS nodes.

Signed-off-by: Osama Muhammad <osmtendev@gmail.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>


# 551e325b 25-Aug-2022 Jack Wang <jinpu.wang@ionos.com>

HSI: omap_ssi_port: Fix dma_map_sg error check

dma_map_sg return 0 on error, in case of error return -EIO
to caller.

Cc: Sebastian Reichel <sre@kernel.org>
Cc: linux-kernel@vger.kernel.org (open list)
Fixes: b209e047bc74 ("HSI: Introduce OMAP SSI driver")
Signed-off-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>


# c1030cd4 30-Jul-2019 Stephen Boyd <swboyd@chromium.org>

HSI: Remove dev_err() usage after platform_get_irq()

We don't need dev_err() messages when platform_get_irq() fails now that
platform_get_irq() prints an error message itself when something goes
wrong. Let's remove these prints with a simple semantic patch.

// <smpl>
@@
expression ret;
struct platform_device *E;
@@

ret =
(
platform_get_irq(E, ...)
|
platform_get_irq_byname(E, ...)
);

if ( \( ret < 0 \| ret <= 0 \) )
{
(
-if (ret != -EPROBE_DEFER)
-{ ...
-dev_err(...);
-... }
|
...
-dev_err(...);
)
...
}
// </smpl>

While we're here, remove braces on if statements that only have one
statement (manually).

Cc: Sebastian Reichel <sre@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>


# 2b27bdcc 29-May-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 336

Based on 1 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 as
published by the free software foundation this program is
distributed in the hope that it will be useful but without any
warranty without even the implied warranty of merchantability or
fitness for a particular purpose see the gnu general public license
for more details you should have received a copy of the gnu general
public license along with this program if not write to the free
software foundation inc 51 franklin st fifth floor boston ma 02110
1301 usa

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-only

has been chosen to replace the boilerplate/reference in 246 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Alexios Zavras <alexios.zavras@intel.com>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190530000436.674189849@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 1ff85bfa 28-Dec-2018 YueHaibing <yuehaibing@huawei.com>

HSI: omap_ssi_port: fix debugfs_simple_attr.cocci warnings

Use DEFINE_DEBUGFS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTRIBUTE
for debugfs files.

Semantic patch information:
Rationale: DEFINE_SIMPLE_ATTRIBUTE + debugfs_create_file()
imposes some significant overhead as compared to
DEFINE_DEBUGFS_ATTRIBUTE + debugfs_create_file_unsafe().

Generated by: scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>


# 3a658e09 30-Nov-2018 Yangtao Li <tiny.windzz@gmail.com>

HSI: omap_ssi: Change to use DEFINE_SHOW_ATTRIBUTE macro

Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>


# ac316725 19-Jun-2018 Randy Dunlap <rdunlap@infradead.org>

headers: separate linux/mod_devicetable.h from linux/platform_device.h

At over 4000 #includes, <linux/platform_device.h> is the 9th most
#included header file in the Linux kernel. It does not need
<linux/mod_devicetable.h>, so drop that header and explicitly add
<linux/mod_devicetable.h> to source files that need it.

4146 #include <linux/platform_device.h>

After this patch, there are 225 files that use <linux/mod_devicetable.h>,
for a reduction of around 3900 times that <linux/mod_devicetable.h>
does not have to be read & parsed.

225 #include <linux/mod_devicetable.h>

This patch was build-tested on 20 different arch-es.

It also makes these drivers SubmitChecklist#1 compliant.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: kbuild test robot <lkp@intel.com> # drivers/media/platform/vimc/
Reported-by: kbuild test robot <lkp@intel.com> # drivers/pinctrl/pinctrl-u300.c
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 9c99e5e5 17-Jun-2016 Sebastian Reichel <sre@kernel.org>

HSI: omap_ssi: drop pm_runtime_irq_safe

pm_runtime_irq_safe increases the parents runtime usage
counter effectively keeping the OMAP SoC from idling.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
Acked-by: Tony Lindgren <tony@atomide.com>
Tested-by: Pavel Machek <pavel@ucw.cz>


# ad60db2f 11-May-2016 Sebastian Reichel <sre@kernel.org>

HSI: omap_ssi_port: use rpm autosuspend API

Instead of immediately sending the SSI module to
sleep, wait some time in case of new incoming or
outgoing traffic.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
Tested-by: Pavel Machek <pavel@ucw.cz>


# 4e552310 19-May-2016 Sebastian Reichel <sre@kernel.org>

HSI: omap_ssi: call msg->complete() from process context

msg->complete() should always be called from process context once
irq_safe runtime pm flag is no longer set for omap-ssi.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
Tested-by: Pavel Machek <pavel@ucw.cz>


# 604fdfa4 17-Jun-2016 Sebastian Reichel <sre@kernel.org>

HSI: omap_ssi_port: ensure clocks are kept enabled during transfer

ensure, that clocks remain enabled, when a transfer is started.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
Tested-by: Pavel Machek <pavel@ucw.cz>


# d2b8d695 17-Jun-2016 Sebastian Reichel <sre@kernel.org>

HSI: omap_ssi_port: replace pm_runtime_put_sync with non-sync variant

There is no need to wait for hardware to really reach idle states,
so just release runtime PM asynchronously.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
Tested-by: Pavel Machek <pavel@ucw.cz>


# fa1572d9 17-Jun-2016 Sebastian Reichel <sre@kernel.org>

HSI: omap_ssi_port: avoid calling runtime_pm_*_sync inside spinlock

runtime_pm_*_sync can block when irq_safe flag is removed
from omap-ssi driver, so it may not be called while a
spinlock is held.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
Tested-by: Pavel Machek <pavel@ucw.cz>


# 62aa292b 17-Jun-2016 Sebastian Reichel <sre@kernel.org>

HSI: omap_ssi_port: avoid pm_runtime_get_sync in ssi_start_dma and ssi_start_pio

These functions may be called from atomic context,
so avoid synchronous runtime pm calls.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
Tested-by: Pavel Machek <pavel@ucw.cz>


# c4a62573 17-Jun-2016 Sebastian Reichel <sre@kernel.org>

HSI: omap_ssi_port: switch to threaded pio irq

Move pio interrupt handler from tasklet into thread to
allow runtime_pm_get_sync calls without irq_safe being
set.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
Tested-by: Pavel Machek <pavel@ucw.cz>


# 7c5d8162 11-May-2016 Sebastian Reichel <sre@kernel.org>

HSI: omap_ssi_port: prepare start_tx/stop_tx for blocking pm_runtime calls

ssi_start_tx and ssi_stop_tx may be called from atomic context. Once
pm_runtime_irq_safe() is removed for omap-ssi, this will fail, due
to blocking pm_runtime_*_sync() calls.

This fixes ssi_stop_tx by using non-sync API and ssi_start_tx by
using a worker thread.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
Tested-by: Pavel Machek <pavel@ucw.cz>


# 2083057a 30-Apr-2016 Sebastian Reichel <sre@kernel.org>

HSI: omap_ssi_port: replace wkin_cken with atomic bitmap operations

This simplifies the code and avoids holding a spin_lock when
runtime pm calls are made. Once the irq_safe flag is removed
for omap_ssi's runtime pm, pm_runtime_get/put_sync can sleep,
which is a no-go while holding a spin_lock.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
Tested-by: Pavel Machek <pavel@ucw.cz>


# cb70e4c1 30-Apr-2016 Sebastian Reichel <sre@kernel.org>

HSI: omap_ssi: convert cawake irq handler to thread

Convert cawake interrupt handler from tasklet to
threaded interrupt handler in preparation of
blocking runtime_pm calls.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
Tested-by: Pavel Machek <pavel@ucw.cz>


# 8c009f1f 30-Apr-2016 Sebastian Reichel <sre@kernel.org>

HSI: omap_ssi_port: remove useless newline

Signed-off-by: Sebastian Reichel <sre@kernel.org>
Tested-by: Pavel Machek <pavel@ucw.cz>


# c2f90a46 03-May-2016 Arnd Bergmann <arnd@arndb.de>

HSI: omap-ssi: move omap_ssi_port_update_fclk

After the clk change support, the ssi omap ssi core driver
now calls into the port driver to change fclk. This function
was previously inside of an #ifdef, because it was only used
when CONFIG_PM is enabled. Now it also gets used without
power management support:

drivers/hsi/built-in.o: In function `ssi_clk_event':
omap_ssi_port.c:(.text+0x1bf8): undefined reference to `omap_ssi_port_update_fclk'

This moves the function outside of the CONFIG_PM guard.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 4bcf7414528a ("HSI: omap-ssi: add clk change support")
Signed-off-by: Sebastian Reichel <sre@kernel.org>


# ac8e3ff3 03-May-2016 Arnd Bergmann <arnd@arndb.de>

HSI: omap-ssi: include pinctrl header files

The driver now uses some pinctrl functions, but fails
to build if PINCTRL is disabled because the respective
header files are only included indirectly:

drivers/hsi/controllers/omap_ssi_core.c: In function 'ssi_clk_event':
drivers/hsi/controllers/omap_ssi_core.c:317:4: error: implicit declaration of function 'pinctrl_pm_select_idle_state' [-Werror=implicit-function-declaration]
drivers/hsi/controllers/omap_ssi_core.c:339:4: error: implicit declaration of function 'pinctrl_pm_select_default_state' [-Werror=implicit-function-declaration]
drivers/hsi/controllers/omap_ssi_port.c: In function 'ssi_flush':
drivers/hsi/controllers/omap_ssi_port.c:520:2: error: implicit declaration of function 'pinctrl_pm_select_idle_state' [-Werror=implicit-function-declaration]

This includes the headers from the files that call the functions,
which works even if pinctrl is turned off.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 4bcf7414528a ("HSI: omap-ssi: add clk change support")
Signed-off-by: Sebastian Reichel <sre@kernel.org>


# 4bcf7414 30-Jan-2016 Sebastian Reichel <sre@kernel.org>

HSI: omap-ssi: add clk change support

This adds support for frequency changes of the SSI
functional clock, which may occur due to DVFS.

Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-By: Sebastian Reichel <sre@kernel.org>


# 0fae1989 29-Apr-2016 Sebastian Reichel <sre@kernel.org>

HSI: omap_ssi: built omap_ssi and omap_ssi_port into one module

Merge omap_ssi and omap_ssi_port into one module. This
fixes problems with module cycle dependencies introduced
by future patches.

Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Sebastian Reichel <sre@kernel.org>


# 0845e1f2 29-Apr-2016 Sebastian Reichel <sre@kernel.org>

HSI: omap_ssi: make sure probe stays available

device can be unbind/rebind, so probe should
stay available.

Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Sebastian Reichel <sre@kernel.org>


# 73e6ce09 29-Apr-2016 Sebastian Reichel <sre@kernel.org>

HSI: omap_ssi_port: switch to gpiod API

Simplify driver by switching to new gpio descriptor based API.

Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Sebastian Reichel <sre@kernel.org>


# 525e1abc 21-Sep-2015 Andrzej Hajda <a.hajda@samsung.com>

HSI: omap_ssi_port: fix handling of_get_named_gpio result

The function can return negative value.

The problem has been detected using proposed semantic patch
scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1].

[1]: http://permalink.gmane.org/gmane.linux.kernel/2038576

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>


# e74eba04 14-Oct-2015 Roger Quadros <rogerq@ti.com>

hsi: omap_ssi_port: Prevent warning if cawake_gpio is not defined.

The error handling path is broken as cawake_gpio was defined as
unsigned integer causing the following warnings on boards that don't
use SSI port and so don't have cawake_gpio defined. e.g. beagleboard C4.

[ 30.094635] WARNING: CPU: 0 PID: 322 at drivers/gpio/gpiolib.c:86 gpio_to_desc+0xa4/0xb8()
[ 30.103363] invalid GPIO -2
[ 30.106292] Modules linked in: omap_ssi_port(+) cpufreq_dt cfbfillrect cfbimgblt leds_gpio cfbcopyarea thermal_sys led_class hwmon gpio_keys encoder_tfp410 connector_analog_tv connector_dvi omap_hdq snd phy_i
[ 30.145477] CPU: 0 PID: 322 Comm: modprobe Not tainted 4.3.0-rc4-00030-gca978c0-dirty #335
[ 30.154174] Hardware name: Generic OMAP3-GP (Flattened Device Tree)
[ 30.160827] [<c0016ef4>] (unwind_backtrace) from [<c00131f4>] (show_stack+0x10/0x14)
[ 30.168975] [<c00131f4>] (show_stack) from [<c033cf08>] (dump_stack+0x80/0x9c)
[ 30.176635] [<c033cf08>] (dump_stack) from [<c003e920>] (warn_slowpath_common+0x7c/0xb8)
[ 30.185180] [<c003e920>] (warn_slowpath_common) from [<c003e9f0>] (warn_slowpath_fmt+0x30/0x40)
[ 30.194366] [<c003e9f0>] (warn_slowpath_fmt) from [<c0376314>] (gpio_to_desc+0xa4/0xb8)
[ 30.202819] [<c0376314>] (gpio_to_desc) from [<c0376ac8>] (gpio_request_one+0x14/0x11c)
[ 30.211273] [<c0376ac8>] (gpio_request_one) from [<c037370c>] (devm_gpio_request_one+0x3c/0x78)
[ 30.220458] [<c037370c>] (devm_gpio_request_one) from [<bf184210>] (ssi_port_probe+0x118/0x504 [omap_ssi_port])
[ 30.231170] [<bf184210>] (ssi_port_probe [omap_ssi_port]) from [<c03d4cfc>] (platform_drv_probe+0x48/0xa4)
[ 30.241424] [<c03d4cfc>] (platform_drv_probe) from [<c03d3678>] (driver_probe_device+0x1dc/0x2a0)
[ 30.250793] [<c03d3678>] (driver_probe_device) from [<c03d37d0>] (__driver_attach+0x94/0x98)
[ 30.259643] [<c03d37d0>] (__driver_attach) from [<c03d1d60>] (bus_for_each_dev+0x54/0x88)
[ 30.268249] [<c03d1d60>] (bus_for_each_dev) from [<c03d2d50>] (bus_add_driver+0xe8/0x1f8)
[ 30.276916] [<c03d2d50>] (bus_add_driver) from [<c03d4118>] (driver_register+0x78/0xf4)
[ 30.285369] [<c03d4118>] (driver_register) from [<c03d5380>] (__platform_driver_probe+0x34/0xd8)
[ 30.294647] [<c03d5380>] (__platform_driver_probe) from [<c00097e4>] (do_one_initcall+0x80/0x1d8)
[ 30.303985] [<c00097e4>] (do_one_initcall) from [<c011617c>] (do_init_module+0x5c/0x1cc)
[ 30.312561] [<c011617c>] (do_init_module) from [<c00c7a68>] (load_module+0x18c8/0x1f0c)
[ 30.320983] [<c00c7a68>] (load_module) from [<c00c8188>] (SyS_init_module+0xdc/0x150)
[ 30.329223] [<c00c8188>] (SyS_init_module) from [<c000f7e0>] (ret_fast_syscall+0x0/0x1c)

Fixes: b209e047bc743 ("HSI: Introduce OMAP SSI driver")
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>


# 96a1c18a 03-Dec-2014 Rafael J. Wysocki <rafael.j.wysocki@intel.com>

hsi / OMAP / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM

After commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is
selected) PM_RUNTIME is always set if PM is set, so #ifdef blocks
depending on CONFIG_PM_RUNTIME may now be changed to depend on
CONFIG_PM.

Do that for the omap_ssi driver.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-By: Sebastian Reichel <sre@kernel.org>


# 53b72c17 20-Oct-2014 Wolfram Sang <wsa@kernel.org>

hsi: controllers: drop owner assignment from platform_drivers

A platform_driver does not need to set an owner, it will be populated by the
driver core.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>


# 068afbbe 19-Oct-2014 Sebastian Reichel <sre@kernel.org>

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>


# c2acb7c4 29-Jul-2014 Wei Yongjun <yongjun_wei@trendmicro.com.cn>

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>


# b74d4954 17-Jul-2014 Andrey Utkin <andrey.krieger.utkin@gmail.com>

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>


# b357d7b5 04-Jun-2014 Arnd Bergmann <arnd@arndb.de>

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>


# b209e047 15-Dec-2013 Sebastian Reichel <sre@kernel.org>

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>