platform/kernel/linux-exynos.git
6 years agotizen_tm2_defconfig: replace custom rfkill-bcm with mainline hci_bcm driver sandbox/m.szyprowski/dev/tizen-next-bluetooth
Marek Szyprowski [Fri, 14 Dec 2018 11:04:10 +0000 (12:04 +0100)]
tizen_tm2_defconfig: replace custom rfkill-bcm with mainline hci_bcm driver

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
6 years agoarm64: dts: exynos: use mainline Broadcom Bluetooth chip bindings
Marek Szyprowski [Fri, 14 Dec 2018 10:21:06 +0000 (11:21 +0100)]
arm64: dts: exynos: use mainline Broadcom Bluetooth chip bindings

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
6 years agoBluetooth: hci_bcm: Document struct bcm_device
Lukas Wunner [Wed, 10 Jan 2018 15:32:10 +0000 (16:32 +0100)]
Bluetooth: hci_bcm: Document struct bcm_device

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
6 years agoBluetooth: hci_bcm: Invalidate IRQ on request failure
Lukas Wunner [Wed, 10 Jan 2018 15:32:10 +0000 (16:32 +0100)]
Bluetooth: hci_bcm: Invalidate IRQ on request failure

If devm_request_irq() fails, the driver bails out of bcm_request_irq()
but continues to ->setup the device (because the IRQ is optional).

The driver subsequently calls devm_free_irq(), enable_irq_wake() and
disable_irq_wake() on the IRQ even though requesting it failed.

Avoid by invalidating the IRQ on request failure.

Cc: Frédéric Danis <frederic.danis.oss@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
6 years agoBluetooth: hci_bcm: Fix unbalanced pm_runtime_disable()
Lukas Wunner [Wed, 10 Jan 2018 15:32:10 +0000 (16:32 +0100)]
Bluetooth: hci_bcm: Fix unbalanced pm_runtime_disable()

On ->setup, pm_runtime_enable() is only called if a valid IRQ was found,
but on ->close(), pm_runtime_disable() is called unconditionally.
Disablement of runtime PM is recorded in a counter, so every
pm_runtime_disable() needs to be balanced.  Fix it.

Cc: Frédéric Danis <frederic.danis.oss@gmail.com>
Reported-and-reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
6 years agoBluetooth: hci_bcm: Fix race on close
Lukas Wunner [Wed, 10 Jan 2018 15:32:10 +0000 (16:32 +0100)]
Bluetooth: hci_bcm: Fix race on close

Upon ->close, the driver powers the Bluetooth controller down, deasserts
the device wake pin, updates the runtime PM status to "suspended" and
finally frees the IRQ.

Because the IRQ is freed last, a runtime resume can take place after
the controller was powered down.  The impact is not grave, the worst
thing that can happen is that the device wake pin is reasserted (should
have no effect while the regulator is off) and that setting the runtime
PM status to "suspended" does not reflect reality.

Still, it's wrong, so free the IRQ first.

Cc: Frédéric Danis <frederic.danis.oss@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
6 years agoBluetooth: hci_bcm: Clean up unnecessary #ifdef
Lukas Wunner [Wed, 10 Jan 2018 15:32:10 +0000 (16:32 +0100)]
Bluetooth: hci_bcm: Clean up unnecessary #ifdef

pm_runtime_disable() and pm_runtime_set_suspended() are replaced with
empty inlines if CONFIG_PM is disabled, so there's no need to #ifdef
them.

device_init_wakeup() is likewise replaced with an inline, though it's
not empty, but it and devm_free_irq() can be made conditional on
IS_ENABLED(CONFIG_PM), which is preferable to #ifdef as per section 20
of Documentation/process/coding-style.rst.

Cc: Frédéric Danis <frederic.danis.oss@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
6 years agoBluetooth: hci_bcm: Validate IRQ before using it
Ronald Tschalär [Wed, 10 Jan 2018 15:32:10 +0000 (16:32 +0100)]
Bluetooth: hci_bcm: Validate IRQ before using it

The ->close, ->suspend and ->resume hooks assume presence of a valid IRQ
if the device is wakeup capable.  However it's entirely possible that
wakeup was enabled by some other entity besides this driver and in this
case the user will get a WARN splat if no valid IRQ was found.  Avoid by
checking if the IRQ is valid, i.e. > 0.

Case in point:  On recent MacBook Pros, the Bluetooth device lacks an
IRQ (because host wakeup is handled by the SMC, independently of the
operating system), but it does possess a _PRW method (which specifies
the SMC's GPE as wake event).  The ACPI core therefore automatically
marks the physical Bluetooth device wakeup capable upon binding it to
its ACPI companion:

device_set_wakeup_capable+0x96/0xb0
acpi_bind_one+0x28a/0x310
acpi_platform_notify+0x20/0xa0
device_add+0x215/0x690
serdev_device_add+0x57/0xf0
acpi_serdev_add_device+0xc9/0x110
acpi_ns_walk_namespace+0x131/0x280
acpi_walk_namespace+0xf5/0x13d
serdev_controller_add+0x6f/0x110
serdev_tty_port_register+0x98/0xf0
tty_port_register_device_attr_serdev+0x3a/0x70
uart_add_one_port+0x268/0x500
serial8250_register_8250_port+0x32e/0x490
dw8250_probe+0x46c/0x720
platform_drv_probe+0x35/0x90
driver_probe_device+0x300/0x450
bus_for_each_drv+0x67/0xb0
__device_attach+0xde/0x160
bus_probe_device+0x9c/0xb0
device_add+0x448/0x690
platform_device_add+0x10e/0x260
mfd_add_device+0x392/0x4c0
mfd_add_devices+0xb1/0x110
intel_lpss_probe+0x2a9/0x610 [intel_lpss]
intel_lpss_pci_probe+0x7a/0xa8 [intel_lpss_pci]

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Ronald Tschalär <ronald@innovation.ch>
[lukas: fix up ->suspend and ->resume as well, add commit message]
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
6 years agoBluetooth: hci_bcm: Mandate presence of shutdown and device wake GPIO
Lukas Wunner [Wed, 10 Jan 2018 15:32:10 +0000 (16:32 +0100)]
Bluetooth: hci_bcm: Mandate presence of shutdown and device wake GPIO

Commit 0395ffc1ee05 ("Bluetooth: hci_bcm: Add PM for BCM devices")
amended this driver to request a shutdown and device wake GPIO on probe,
but mandated that only one of them need to be present:

/* Make sure at-least one of the GPIO is defined and that
 * a name is specified for this instance
 */
if ((!dev->device_wakeup && !dev->shutdown) || !dev->name) {
dev_err(&pdev->dev, "invalid platform data\n");
return -EINVAL;
}

However the same commit added a call to bcm_gpio_set_power() to the
->probe hook, which unconditionally accesses *both* GPIOs.  Luckily,
the resulting NULL pointer deref was never reported, suggesting there's
no machine where either GPIO is missing.

Commit 8a92056837fd ("Bluetooth: hci_bcm: Add (runtime)pm support to the
serdev driver") removed the check whether at least one of the GPIOs is
present without specifying a reason.

Because commit 62aaefa7d038 ("Bluetooth: hci_bcm: improve use of gpios
API") refactored the driver to use devm_gpiod_get_optional() instead of
devm_gpiod_get(), one is now tempted to believe that the driver doesn't
require *any* of the two GPIOs.

Which is wrong, the driver still requires both GPIOs to avoid a NULL
pointer deref.  To this end, establish the status quo ante and request
the GPIOs with devm_gpiod_get() again.  Bail out of ->probe if either
of them is missing.

Oddly enough, whereas bcm_gpio_set_power() accesses the device wake pin
unconditionally, bcm_suspend_device() and bcm_resume_device() do check
for its presence before accessing it.  Those checks are superfluous,
so remove them.

Cc: Frédéric Danis <frederic.danis.oss@gmail.com>
Cc: Loic Poulain <loic.poulain@linaro.org>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
6 years agoBluetooth: hci_bcm: Streamline runtime PM code
Lukas Wunner [Tue, 26 Dec 2017 15:07:34 +0000 (17:07 +0200)]
Bluetooth: hci_bcm: Streamline runtime PM code

This driver seeks to force the Bluetooth device on for the duration of
5 seconds when the Bluetooth device has woken the host and after a
complete packet has been received.  It does that by calling:

    pm_runtime_get();
    pm_runtime_mark_last_busy();
    pm_runtime_put_autosuspend();

The same can be achieved more succinctly with:

    pm_request_resume();

That's because after runtime resuming the device, rpm_resume() invokes
pm_runtime_mark_last_busy() followed by rpm_idle(), which will cause
the device to be suspended after expiration of the autosuspend_delay.

No functional change intended.

Cc: Frédéric Danis <frederic.danis.oss@gmail.com>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
6 years agoBluetooth: hci_bcm: Correct context of IRQ polarity message
Ian W MORRISON [Sat, 7 Oct 2017 06:16:08 +0000 (17:16 +1100)]
Bluetooth: hci_bcm: Correct context of IRQ polarity message

As the overwriting of IRQ polarity to active low occurs during the driver
probe using 'bt_dev_warn' to display the warning results in '(null)' being
displayed for the device. This patch uses 'dev_warn' to correctly display
the device in the warning instead.

Signed-off-by: Ian W MORRISON <ianwmorrison@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
6 years agoBluetooth: hci_bcm: Add (runtime)pm support to the serdev driver
Hans de Goede [Wed, 4 Oct 2017 18:43:43 +0000 (20:43 +0200)]
Bluetooth: hci_bcm: Add (runtime)pm support to the serdev driver

Make the serdev driver use struct bcm_device as its driver data and share
all the pm / GPIO / IRQ related code paths with the platform driver.

After this commit the 2 drivers are in essence the same and the serdev
driver interface can be used for all ACPI enumerated HCI UARTs.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
6 years agoBluetooth: hci_bcm: Make suspend/resume functions platform_dev independent
Hans de Goede [Wed, 4 Oct 2017 18:43:42 +0000 (20:43 +0200)]
Bluetooth: hci_bcm: Make suspend/resume functions platform_dev independent

Use dev_get_drvdata instead of platform_get_drvdata in the suspend /
resume functions. This is a preparation patch for adding (runtime)pm
support to the serdev path.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
6 years agoBluetooth: hci_bcm: Make acpi_probe get irq from ACPI resources
Hans de Goede [Wed, 4 Oct 2017 18:43:41 +0000 (20:43 +0200)]
Bluetooth: hci_bcm: Make acpi_probe get irq from ACPI resources

The ACPI subsys is going to move over to instantiating ACPI enumerated
HCIs as serdevs, rather then as platform devices.

So we need to make bcm_acpi_probe() suitable for use on non platform-
devices too, which means that we cannot rely on platform_get_irq()
getting called.

This commit modifies bcm_acpi_probe() to directly get the irq from
the ACPI resources, this is a preparation patch for adding (runtime)pm
support to the serdev path.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
6 years agoBluetooth: hci_bcm: Rename bcm_platform_probe to bcm_get_resources
Hans de Goede [Wed, 4 Oct 2017 18:43:40 +0000 (20:43 +0200)]
Bluetooth: hci_bcm: Rename bcm_platform_probe to bcm_get_resources

After our previous changes, there is nothing platform specific about
bcm_platform_probe anymore, rename it to bcm_get_resources.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
6 years agoBluetooth: hci_bcm: Store device pointer instead of platform_device pointer
Hans de Goede [Wed, 4 Oct 2017 18:43:39 +0000 (20:43 +0200)]
Bluetooth: hci_bcm: Store device pointer instead of platform_device pointer

The ACPI subsys is going to move over to instantiating ACPI enumerated
HCIs as serdevs, rather then as platform devices.

This means that the serdev driver paths of hci_bcm.c also need to start
supporting (runtime)pm through GPIOs and a host-wake IRQ.

The hci_bcm code is already mostly independent of how the HCI gets
instantiated, but even though the code only cares about pdev->dev, it
was storing pdev itself in struct bcm_device.

This commit stores pdev->dev rather then pdev in struct bcm_device, this
is a preparation patch for adding (runtime)pm support to the serdev path.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
6 years agoBluetooth: hci_bcm: Move platform_get_irq call to bcm_probe
Hans de Goede [Wed, 4 Oct 2017 18:43:38 +0000 (20:43 +0200)]
Bluetooth: hci_bcm: Move platform_get_irq call to bcm_probe

The ACPI subsys is going to move over to instantiating ACPI enumerated
HCIs as serdevs, rather then as platform devices.

Most of the code in bcm_platform_probe is actually not platform
specific and will work with any struct device passed to it, the one
platform specific call in bcm_platform_probe is platform_get_irq.

This commit moves platform_get_irq call to the platform-driver's bcm_probe
function, this is a preparation patch for adding (runtime)pm support to
the serdev path.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
6 years agoBluetooth: hci_bcm: Move bcm_platform_probe call out of bcm_acpi_probe
Hans de Goede [Wed, 4 Oct 2017 18:43:37 +0000 (20:43 +0200)]
Bluetooth: hci_bcm: Move bcm_platform_probe call out of bcm_acpi_probe

Since bcm_acpi_probe calls bcm_platform_probe, bcm_probe always ends up
calling bcm_platform_probe.

This commit simplifies things by making bcm_probe always call
bcm_platform_probe itself.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
6 years agoRevert "Bluetooth: hci_bcm: Treat Interrupt ACPI resources as always being active...
Marek Szyprowski [Fri, 14 Dec 2018 10:00:49 +0000 (11:00 +0100)]
Revert "Bluetooth: hci_bcm: Treat Interrupt ACPI resources as always being active-low"

This reverts commit 9e483bc229f54ecfdd87f630d9b265c3223e3671.

6 years agoARM: configs: tizen_odroid: enable configs relevant to network feature
Jaehoon Chung [Wed, 5 Dec 2018 03:31:51 +0000 (12:31 +0900)]
ARM: configs: tizen_odroid: enable configs relevant to network feature

Eanble configs relevant to network feature.
In Tizen, stc-manager needs to enable these configurations to work fine.
This patch is form tizen branch commit 6b1405a4b2.

Change-Id: If34bce8b9b04ec6a2a50b05531475ce166085f7e
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
6 years agoARM: config: tizen_odroid: enable Atheros USB driver
Jaehoon Chung [Wed, 5 Dec 2018 03:26:03 +0000 (12:26 +0900)]
ARM: config: tizen_odroid: enable Atheros USB driver

Enable Atheros USB driver to test WiFi Mesh.
This patch is based on tizen branch commit fe53e6f56.

Change-Id: I7b242b1e3b7f703a4db1542745153f3bba5a4931
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
6 years agopackaging: use upstream tags with .gbs.conf
Inha Song [Tue, 4 Dec 2018 06:19:13 +0000 (15:19 +0900)]
packaging: use upstream tags with .gbs.conf

To build properly with upstream version tag in obs, add
.gbs.conf.

Change-Id: Ib6eaf6e12ecc8f065b085253dbcc0c538caff511
Signed-off-by: Inha Song <ideal.song@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
6 years agopackaging: change 4.14.y stable version as this tree
Seung-Woo Kim [Tue, 4 Dec 2018 06:20:55 +0000 (15:20 +0900)]
packaging: change 4.14.y stable version as this tree

Change 4.14.y stable version as this tree.

Change-Id: I2f235f16e6e20e224a5fc33c6ff19230e25eab15
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
6 years agoLOCAL / GPU: ARM: Add proper flag handle extended mmap offset operations
Marek Szyprowski [Mon, 3 Dec 2018 13:37:01 +0000 (14:37 +0100)]
LOCAL / GPU: ARM: Add proper flag handle extended mmap offset operations

Since stable commit 16d7ceb04b55 ("mmap: introduce sane default mmap
limits"), drivers, which use mmap offset needs to set additional flag
in ->open() call, so set this flag in MALI drivers too.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
6 years agopinctrl: samsung: add pin_dbg_show callback for debugfs
Chanho Park [Tue, 27 Mar 2018 13:58:01 +0000 (22:58 +0900)]
pinctrl: samsung: add pin_dbg_show callback for debugfs

This patch adds a samsung_pin_dbg_show function to implement the
pin_dbg_show callback function which can be used to show pin
confuration values. Basically, it can show pin setting values by
accessing the "pins" node like below:

$ cat pins
pin 0 (gpy7-0)  CON(0x0) DAT(0x1) PUD(0x1) DRV(0x0) CON_PDN(0x0) PUD_PDN(0x0)

Signed-off-by: Chanho Park <parkch98@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Tested-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I20bf8c3201e08e23a8ba360a215facd91310e987

6 years agoarm: dts: exynos5422: change mali node position in alphabet order
Inki Dae [Mon, 26 Nov 2018 00:33:42 +0000 (09:33 +0900)]
arm: dts: exynos5422: change mali node position in alphabet order

Change-Id: I8e0d490d51093488849f99f70d242f038863ba01
Signed-off-by: Inki Dae <inki.dae@samsung.com>
6 years agoarm: dts: exynos5422: change BPLL clock to 933MHz
Inki Dae [Fri, 23 Nov 2018 08:30:37 +0000 (17:30 +0900)]
arm: dts: exynos5422: change BPLL clock to 933MHz

This patch changes BPLL clock to 933MHz for DREX controller
can use maximum speed.

Change-Id: Ia06079c32ad532cb8a53d9dcae6a7fbacf80895a
Signed-off-by: Inki Dae <inki.dae@samsung.com>
6 years agoclk: samsung: add 933MHz clock to bpll
Inki Dae [Fri, 23 Nov 2018 08:29:31 +0000 (17:29 +0900)]
clk: samsung: add 933MHz clock to bpll

Change-Id: I9951d067e530e6bd9393cfe1fc7789be7ed06488
Signed-off-by: Inki Dae <inki.dae@samsung.com>
6 years agoARM: configs: tizen_odroid_defconfig: disable rotator IPP device
Marek Szyprowski [Mon, 26 Nov 2018 15:09:11 +0000 (16:09 +0100)]
ARM: configs: tizen_odroid_defconfig: disable rotator IPP device

Disable rotator IPP device, because it confuses ipptest tool.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Iabd6a1fd31e93e56aa25c3c4de3e0e6ef3d30a37

6 years agoARM: dts: exynos: Move some assigned-clock* properties to i2s0 node
Sylwester Nawrocki [Tue, 27 Nov 2018 16:44:24 +0000 (17:44 +0100)]
ARM: dts: exynos: Move some assigned-clock* properties to i2s0 node

Setting of an IP block clock parent clock should be in the IP's DT node,
this ensures respective driver sees correct parent clock right from the
beginning, i.e. right after registering clock provider in probe() callback.

Without this change wrong I2S function clock (op_clk) is being used by
the driver in runtime suspend/resume ops, i.e. i2s_bus is enabled/disabled
twice instead of having activated both i2s_bus and sclk_i2s when required.

Change-Id: I1b52e20ff3596dae7b09d6a65d8ac6da7b76fe7d
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agoASoC: samsung: i2s: Fix rclk_srcrate handling
Sylwester Nawrocki [Fri, 9 Mar 2018 17:48:55 +0000 (18:48 +0100)]
ASoC: samsung: i2s: Fix rclk_srcrate handling

As the RCLK clock may be updated through the common clk API before each
snd_soc_dai_ops::trigger call, it is not enough to update i2s->rclk_srcrate
only once after it has been initially set to 0. To avoid wrong PSR values
we always get RCLK frequency from the CLK_I2S_RCLK_SRC clock, when that
clock is available.

Fixes: e1417fdf3011 "ASoC: samsung: i2s: Ensure the RCLK rate is properly determined"
Change-Id: I81065cf4e7da3c159a1f91bb0df626cdc0356c23
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoarm: dts: exynos4: opp-suspend in DMC and leftbus
Lukasz Luba [Mon, 19 Nov 2018 13:46:07 +0000 (14:46 +0100)]
arm: dts: exynos4: opp-suspend in DMC and leftbus

Mark the state for devfreq device while entring suspend/resume process.

The patch is based on earlier work by Tobias Jakobi.

Change-Id: I2b82fcb2a405abd15bea1e480bca1a1328bd6ff9
Suggested-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Suggested-by: Chanwoo Choi <cw00.choi@samsung.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Lukasz Luba <l.luba@partner.samsung.com>
6 years agodrivers: power: suspend: call devfreq suspend/resume
Lukasz Luba [Fri, 16 Nov 2018 12:36:53 +0000 (13:36 +0100)]
drivers: power: suspend: call devfreq suspend/resume

Devfreq framework supports suspend of its devices.
Call the the devfreq interface and allow devfreq devices preserve/restore
their states during suspend/resume.

The patch is based on earlier work by Tobias Jakobi.

Change-Id: I1aa62a13466120ef6f88edec2637888d77edc981
Suggested-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Lukasz Luba <l.luba@partner.samsung.com>
6 years agodevfreq: add devfreq_suspend/resume() functions
Lukasz Luba [Fri, 16 Nov 2018 12:33:53 +0000 (13:33 +0100)]
devfreq: add devfreq_suspend/resume() functions

This patch adds implementation for global suspend/resume for
devfreq framework. System suspend will next use these functions.

The patch is based on earlier work by Tobias Jakobi.

Change-Id: Id48187e492eb11f532512ecdda736309bc094af4
Suggested-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Suggested-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Lukasz Luba <l.luba@partner.samsung.com>
6 years agodevfreq: add support for suspend/resume of a devfreq device
Lukasz Luba [Thu, 15 Nov 2018 14:26:10 +0000 (15:26 +0100)]
devfreq: add support for suspend/resume of a devfreq device

The patch prepares devfreq device for handling suspend/resume
functionality.  The new fields will store needed information during this
process.  Devfreq framework handles opp-suspend DT entry and there is no
need of modyfications in the drivers code.  It uses atomic variables to
make sure no race condition affects the process.

The patch is based on earlier work by Tobias Jakobi.

Change-Id: I55187da468966b11b27f7d90e1e59471fb602422
Suggested-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Suggested-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Lukasz Luba <l.luba@partner.samsung.com>
6 years agodevfreq: refactor set_target frequency function
Lukasz Luba [Thu, 15 Nov 2018 15:12:43 +0000 (16:12 +0100)]
devfreq: refactor set_target frequency function

The refactoring is needed for the new client in devfreq: suspend.
To avoid code duplication, move it to the new local function
devfreq_set_target.

The patch is based on earlier work by Tobias Jakobi.

Change-Id: I8515ba9cde9b957b47684ff36296bfeab54f76f6
Suggested-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Suggested-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Lukasz Luba <l.luba@partner.samsung.com>
6 years agoARM64: dts: exynos: Add clocks and pins needed for bluetooth chip
Marek Szyprowski [Mon, 26 Nov 2018 14:24:52 +0000 (15:24 +0100)]
ARM64: dts: exynos: Add clocks and pins needed for bluetooth chip

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I99cab815d6b756b4ea27f83286e8fe27ad1d08d9

6 years agomfd: exynos-lpass: Enable UART module support
Beomho Seo [Thu, 26 Feb 2015 08:54:50 +0000 (17:54 +0900)]
mfd: exynos-lpass: Enable UART module support

This patch enables support for UART module in AUD subsystem. There are
boards (for example TM2), which use it for communication with bluetooth
chip.

Signed-off-by: Beomho Seo <beomho.seo@samsung.com>
[mszyprow: rephrased commit message, added UART reset]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I4f189b64baca4865d119d7e931c1ce608a5908bd

6 years agotty: serial: samsung: Increase maximum baudrate
Seung-Woo Kim [Thu, 15 May 2014 03:35:50 +0000 (12:35 +0900)]
tty: serial: samsung: Increase maximum baudrate

This driver can be used to communicate with bluetooth chip in high-speed
UART mode, so increase maximum baudrate to 3Mbps.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
[mszyprow: rephrased commit message]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Ifd046553dfd9f4f469f58ded785844631c1ef08e

6 years agotty: serial: samsung: Properly set flags in autoCTS mode
Beomho Seo [Wed, 4 Mar 2015 06:34:47 +0000 (15:34 +0900)]
tty: serial: samsung: Properly set flags in autoCTS mode

Commit 391f93f2ec9f ("serial: core: Rework hw-assited flow control support")
has changed the way the autoCTS mode is handled.

Acordding to that change, serial drivers which enable H/W autoCTS mode must
set UPSTAT_AUTOCTS to prevent the serial core from inadvertently disabling
TX. This patch adds proper handling of UPSTAT_AUTOCTS flag.

Signed-off-by: Beomho Seo <beomho.seo@samsung.com>
[mszyprow: rephrased commit message]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I3e8aff35b048b4ece3dfa00e7347907e052e7e9a

6 years agoARM: dts: exynos: change vpll clock to 600MHz
Inki Dae [Fri, 23 Nov 2018 07:18:36 +0000 (16:18 +0900)]
ARM: dts: exynos: change vpll clock to 600MHz

This change enhances MALI inference(on-device deep leanring) performance.

Change-Id: I2a9341589873a049bd91ee6771c96d831768df3c
Signed-off-by: Inki Dae <inki.dae@samsung.com>
6 years agoclk: samsung: add vpll pms tables
Inki Dae [Fri, 23 Nov 2018 07:06:33 +0000 (16:06 +0900)]
clk: samsung: add vpll pms tables

This patch adds pms tables to generate various clock frequencies.
In default, VPLL generates 400MHz but it's not enough for MALI GPU
device so it allows to change vpll clock frequency through device tree.

Change-Id: Iae8c55d03a4efc40ecc7966c4591572f27e4a81a
Signed-off-by: Inki Dae <inki.dae@samsung.com>
6 years agoRevert "ARM: dts: exynos: set g3d parent clock to dpll"
Inki Dae [Fri, 23 Nov 2018 07:15:39 +0000 (16:15 +0900)]
Revert "ARM: dts: exynos: set g3d parent clock to dpll"

We don't need to change parent clock of mali gpu device.
Instead, we can change vpll clock frequency through device tree,
and it's a better way because vpll is dedicated to gpu device
in default.

This reverts commit d78913aca3abe06124e71b63f7171f83c666d85a.

Change-Id: Ib4770fba8df4a55d04ca8587af0458c9d3f8882c
Signed-off-by: Inki Dae <inki.dae@samsung.com>
6 years agoARM: dts: exynos: set g3d parent clock to dpll
Inki Dae [Fri, 23 Nov 2018 01:37:11 +0000 (10:37 +0900)]
ARM: dts: exynos: set g3d parent clock to dpll

 MALI GPU device uses VPLL as its parent clock which generates
 400MHz clock so it's not enough for MALI GPU device.
 This patch changes g3d parent clock to dpll which generates
 600MHz.

Change-Id: I42f0a8c13ec8eec8e91f73ba210e3c0cbcb596d0
Signed-off-by: Inki Dae <inki.dae@samsung.com>
6 years agoclk: samsung: exynos542x: add clock ID for G3D performance enhancement
Inki Dae [Fri, 23 Nov 2018 01:29:01 +0000 (10:29 +0900)]
clk: samsung: exynos542x: add clock ID for G3D performance enhancement

This patch adds clock IDs for CLKMUX_ACLK_G3D and DPLL_CTRL,
and these IDs will be used by device tree to change G3D's parent
clock to DPLL(600MHz) instead of VPLL(400MHz).

Change-Id: Ia2c11331d42a73e095fd4c9deb64e9fb162c511d
Signed-off-by: Inki Dae <inki.dae@samsung.com>
6 years agoARM: dts: exynos5420: add mali dt bindings
Inki Dae [Mon, 19 Nov 2018 01:52:54 +0000 (10:52 +0900)]
ARM: dts: exynos5420: add mali dt bindings

Change-Id: I850b32a6be2be6ada5344e26e4af636360e9cfbc
Signed-off-by: Inki Dae <inki.dae@samsung.com>
6 years agopackaging: packaging: Add spec file for TM2 and Odroid-XU3/4
Inki Dae [Mon, 19 Nov 2018 08:12:47 +0000 (17:12 +0900)]
packaging: packaging: Add spec file for TM2 and Odroid-XU3/4

Change-Id: Iefcde80b71ac44f5c3aff8206a61175e524b4e12
Signed-off-by: Inki Dae <inki.dae@samsung.com>
6 years agodrm/bridge/sii8620: fix HDMI cable connection to dongle
Maciej Purski [Tue, 23 Jan 2018 11:13:16 +0000 (12:13 +0100)]
drm/bridge/sii8620: fix HDMI cable connection to dongle

MHL bridge is usually connected to TV via MHL dongle. Currently plugging
HDMI cable to dongle is handled improperly.

Fix it by splitting connecting of a dongle and a HDMI cable. The driver
should now handle unplugging a sink from a dongle and plugging a
different sink with new edid.

Tested on MHL1, MHL2 and MHL3 using various vendors' dongles both in
DVI and HDMI mode.

Signed-off-by: Maciej Purski <m.purski@samsung.com>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1516705996-8928-1-git-send-email-m.purski@samsung.com
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I74dcc6ff2cec4c926ad3107a99d6987aabeebf09

6 years agodrm/bridge/sii8620: remove HSIC initialization
Maciej Purski [Wed, 29 Nov 2017 15:12:47 +0000 (16:12 +0100)]
drm/bridge/sii8620: remove HSIC initialization

HSIC initialization was taken from the vendor code. HSIC in MHL circuit
is not connected, so it is not possible to test it. Tests prove that
without HSIC the device works well. Therefore it can be removed.

Signed-off-by: Maciej Purski <m.purski@samsung.com>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1511968368-30884-1-git-send-email-m.purski@samsung.com
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I619d5eabbc04fa4d9134378cabd529682c9d114a

6 years agodrm/bridge/sii8620: start MHL transmission after HDMI signal detection
Maciej Purski [Wed, 29 Nov 2017 11:48:50 +0000 (12:48 +0100)]
drm/bridge/sii8620: start MHL transmission after HDMI signal detection

The vendor code waits for infoframe to detect video mode set by source.
We do not need to follow this pattern, because video mode information is
provided by drm core. As a result most of the infoframe handling
code can be removed.

Start transmission immediately after detecting stream on HDMI lines
in irq_scdt() function without waiting for infoframe interrupt.

Signed-off-by: Maciej Purski <m.purski@samsung.com>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1511956130-24482-1-git-send-email-m.purski@samsung.com
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I4c437ae8340f0a896429c752a2e9c5a210a6f6f8

6 years agodrm/bridge/sii8620: fix display modes validation
Maciej Purski [Fri, 2 Feb 2018 10:54:25 +0000 (11:54 +0100)]
drm/bridge/sii8620: fix display modes validation

Current implementation of mode_valid() and mode_fixup() callbacks
handle packed pixel modes improperly.

Fix it by using proper maximum clock values from the documentation.

Signed-off-by: Maciej Purski <m.purski@samsung.com>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1517568865-25219-1-git-send-email-m.purski@samsung.com
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Ia6782c6302a1d75e3970fba420a0fed2a13a6530

6 years agodrm/bridge/sii8620: simplify hardware reset procedure
Andrzej Hajda [Fri, 8 Jun 2018 06:04:57 +0000 (08:04 +0200)]
drm/bridge/sii8620: simplify hardware reset procedure

There is no need to flip reset pin twice. Also delays can be changed to
values present in vendor's code.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Maciej Purski <m.purski@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180608060457.18357-1-a.hajda@samsung.com
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Ib7710bedc9f5dbdd448262d44f83c2c80c208ac5

6 years agodrm/exynos: scaler: Fix support for YUV420, YUV422 and YUV444 modes
Marek Szyprowski [Tue, 29 May 2018 08:18:47 +0000 (10:18 +0200)]
drm/exynos: scaler: Fix support for YUV420, YUV422 and YUV444 modes

Fix Cb/CR components order in two-planar YUV420, YUV422 and YUV444 modes.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Ib71dd82d3a0cd9e742d97a18b4999f8d22a0c544

6 years agodrm/exynos: gsc: Increase Exynos5433 buffer width alignment to 16 pixels
Marek Szyprowski [Mon, 28 May 2018 12:34:39 +0000 (14:34 +0200)]
drm/exynos: gsc: Increase Exynos5433 buffer width alignment to 16 pixels

Investigation revealed that GScaler hardware requires the real buffer width
(pitch) to be aligned to 16 pixels.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I27ddbdb73fdcdfbfc4b90e76242196f72be91c98

6 years agodrm/exynos: gsc: Use real buffer width for configuring the hardware
Marek Szyprowski [Mon, 28 May 2018 12:10:14 +0000 (14:10 +0200)]
drm/exynos: gsc: Use real buffer width for configuring the hardware

DMA hardware should respect buffer pitch, so use the width calculated from
the buffer pitch instead of the virtual one.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Id35299775cb6064e4c0af4542c34061223ff9d16

6 years agodrm/exynos: ipp: Rework checking for the correct buffer formats
Marek Szyprowski [Mon, 28 May 2018 12:03:20 +0000 (14:03 +0200)]
drm/exynos: ipp: Rework checking for the correct buffer formats

Prepare a common function for size and scale checks and call it for
source and destination buffers. Then also move there the state-less checks
from exynos_drm_ipp_task_setup_buffer, so the format information is already
available in limits processing. Finally perform the IPP_LIMIT_BUFFER check
on the real width of the buffer (the width calculated from the provided
buffer pitch).

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I7bd24c4448f27abf5dcbcf19045d30bbcdd4ee87

6 years agodrm/exynos: rotator: Fix DRM_MODE_REFLECT_{X,Y} interpretation
Marek Szyprowski [Fri, 25 May 2018 11:02:55 +0000 (13:02 +0200)]
drm/exynos: rotator: Fix DRM_MODE_REFLECT_{X,Y} interpretation

Horizontal (DRM_MODE_REFLECT_Y) and vertical (DMR_MODE_REFLECT_Y) flip
were swapped in Rotator driver. Fix this by swapping code for interpreting
them.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Ic6aef7b463ebb89fd217092f129427303102641b

6 years agodrm/exynos: gsc: Fix DRM_MODE_REFLECT_{X,Y} interpretation
Marek Szyprowski [Fri, 25 May 2018 11:02:26 +0000 (13:02 +0200)]
drm/exynos: gsc: Fix DRM_MODE_REFLECT_{X,Y} interpretation

Horizontal (DRM_MODE_REFLECT_Y) and vertical (DMR_MODE_REFLECT_Y) flip
were swapped in GScaler driver. Fix this by swapping code for interpreting
them.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Ie442b31ef85f698e163af1a4c745311c9074ceb3

6 years agodrm/exynos: scaler: Reset hardware before starting the operation
Andrzej Pietrasiewicz [Mon, 5 Feb 2018 15:41:54 +0000 (16:41 +0100)]
drm/exynos: scaler: Reset hardware before starting the operation

Ensure that Scaler hardware is properly reset and interrupts are cleared
before processing next image.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I036118b95bdf37e1c6dd133606746f2d6fce4758

6 years agodrm/exynos: decon: Add support for hardware windows no 4 and 5
Marek Szyprowski [Wed, 23 May 2018 09:21:19 +0000 (11:21 +0200)]
drm/exynos: decon: Add support for hardware windows no 4 and 5

Enable support for 2 more hardware windows. This require enabling a few
more clocks and set proper plane type for all windows. In the new
configuration primary plane uses hardware window no 3 and cursor uses
window no 5. The remaining hardware windows are used for overlays. This
gives us an overlay plane both below and above primary plane for both
Decon and DeconTV (which uses hardware window nr 0 for background).

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I1c9947d040cb9af24dd7b7ec5ce7aa80845d3c9b

6 years agodrm/exynos: Fix default value for zpos plane property
Marek Szyprowski [Wed, 23 May 2018 09:14:53 +0000 (11:14 +0200)]
drm/exynos: Fix default value for zpos plane property

The default zpos property for all planes in Exynos DRM was fixed as zero.
Fix this by providing proper value provided by hardware drivers, which
typically matches hardware window number.

Reported-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Ie7caf48e2560d05338778a2d71f1d7f0016a9950

6 years agoarm64: dts: exynos: Add more clocks to Exynos5433 Decon and DeconTV
Marek Szyprowski [Wed, 23 May 2018 09:12:27 +0000 (11:12 +0200)]
arm64: dts: exynos: Add more clocks to Exynos5433 Decon and DeconTV

Add all '1x' clocks to decon and decontv devices. Enabling those clocks
is needed to get proper display on hardware windows no 4 and 5.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I47043438d55591f0202e8ddf3cf4cf86bfa4a9f3

6 years agoarm64: dts: exynos: Remove duplicated entries from exynos5433-tm2e.dts
Sylwester Nawrocki [Thu, 26 Apr 2018 12:03:25 +0000 (14:03 +0200)]
arm64: dts: exynos: Remove duplicated entries from exynos5433-tm2e.dts

There are already proper dts entries in exynos5433-tm2-common.dtsi
which can be reused also for TM2e.

Change-Id: I269bef96efa8dc68f9ca9d59e07a9bd862a9d46a
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agoarm64: dts: exynos: Fix ldo25_reg regulator name for tm2e
Sylwester Nawrocki [Thu, 26 Apr 2018 12:00:30 +0000 (14:00 +0200)]
arm64: dts: exynos: Fix ldo25_reg regulator name for tm2e

The S2MPS13 LDO25 regulator is needed for camera sensor on TM2e
boards, without this change both cameras fail on TM2e.
The fimc-is driver handles regulators in a non-standard way and
it expects specific regulator device name.

Change-Id: Ie8b0200fac333fa1c1851549de834051144b926a
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agospi: spi-s3c64xx: Decrease autosuspend timeout for FIMC-IS
Sylwester Nawrocki [Thu, 19 Apr 2018 13:37:52 +0000 (15:37 +0200)]
spi: spi-s3c64xx: Decrease autosuspend timeout for FIMC-IS

This a workaround to avoid errors in SPI transfer when camera devices
are closed and shortly after re-opened.

Change-Id: I239463f6eefe56a644ec63c42daedb455cf91202
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agofimc-is: Remove dubious spin_(un)lock_irq() use
Sylwester Nawrocki [Thu, 19 Apr 2018 12:09:33 +0000 (14:09 +0200)]
fimc-is: Remove dubious spin_(un)lock_irq() use

There should not be a need to use spin_lock_irq/spin_unlock_irq
in those critical sections. spin_unlock_irq() enables interrupts
unconditionally which can be harmful.

Change-Id: I29df4e56475a56a94762bb1585a6ba3d55c45259
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agofimc-is: Suppress warning generated in fimc_is_group_buffer_finish()
Sylwester Nawrocki [Thu, 19 Apr 2018 12:04:41 +0000 (14:04 +0200)]
fimc-is: Suppress warning generated in fimc_is_group_buffer_finish()

Due to videobuf2 queue cancel call fimc_is_group_buffer_finish() function
may be called with invalid group->id. Just return EINVAL instead of WARN_ON()
when group->id has GROUP_ID_INVALID value so as to avoid unneeded stack dumps
in kernel log while closing video device nodes.

Change-Id: I3c5d6fec997ceaf5ae28e2537cfbca9405040bb0
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agofimc-is: Release all buffers in sensor video node stop_streaming() callback
Sylwester Nawrocki [Fri, 20 Apr 2018 10:32:08 +0000 (12:32 +0200)]
fimc-is: Release all buffers in sensor video node stop_streaming() callback

Any buffer owned by a driver should be released in videobuf2 stop_streaming()
callback. This change allows to avoid warnings from videobuf2 when closing
video device nodes.

Change-Id: Ib7f8b0b8fffe50f387827929829e3e87c0f1bf38
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agofimc-is: Release all buffers in fimc_is_queue_stop_streaming()
Sylwester Nawrocki [Thu, 19 Apr 2018 11:58:43 +0000 (13:58 +0200)]
fimc-is: Release all buffers in fimc_is_queue_stop_streaming()

Any buffer owned by the driver should be released in videobuf2 stop_streaming()
callback. This change allows to avoid warnings from videobuf2 when closing
video device nodes.

Change-Id: Idd2f3157ab5c0326c39e8d9160514ad6102301b6
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agoarm64: configs: tizen_tm2_defconfig update camera driver
Sylwester Nawrocki [Thu, 29 Mar 2018 09:16:59 +0000 (11:16 +0200)]
arm64: configs: tizen_tm2_defconfig update camera driver

Enable camera driver.

Change-Id: I17644b593b9bd59b1055309633900240c2a30e50
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agofimc-is: Convert bool to unsigned int to fix bool-operation
Seung-Woo Kim [Thu, 22 Mar 2018 06:36:31 +0000 (15:36 +0900)]
fimc-is: Convert bool to unsigned int to fix bool-operation

Convert bool to unsigned in to fix bool-operation warnings with gcc7.

Change-Id: I04147f628198204e2b1ecc3b3f04a63a61f62c7b
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agofimc-is: SPI related functions clean up
Sylwester Nawrocki [Thu, 12 Apr 2018 15:17:25 +0000 (17:17 +0200)]
fimc-is: SPI related functions clean up

Replace explicit memset() calls with initialization to 0 at declaration time.

Change-Id: I56068b22577494c59d85e94af439234f56ed1fdd
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agofimc-is: Fix cs_change flags in SPI transfers
Sylwester Nawrocki [Thu, 12 Apr 2018 15:10:10 +0000 (17:10 +0200)]
fimc-is: Fix cs_change flags in SPI transfers

The cs_change flags need to be adjusted so SPI communications works
properly with the spi-s3c64xx driver.

Change-Id: I73ae345670e9ac79d8b8b576dc25078ece6167e7
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agofimc-is: Remove redundant "fimc_is_spi1" driver
Sylwester Nawrocki [Mon, 9 Apr 2018 16:35:51 +0000 (18:35 +0200)]
fimc-is: Remove redundant "fimc_is_spi1" driver

Change-Id: I0e372c47298d4869e0d5041a968e8ef84429d1da
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agofimc-is: Remove unused SPI driver code
Sylwester Nawrocki [Fri, 6 Apr 2018 10:02:31 +0000 (12:02 +0200)]
fimc-is: Remove unused SPI driver code

This patch removes empty/unused SPI related functions and unneeded
devinit/devexit attribute definitions.

Change-Id: I98055d7947c15d0c6692d8714469f48ed9aeffb0
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agophy: exynos-mipi-video: Simplify code by using regmap_update_bits()
Sylwester Nawrocki [Fri, 6 Apr 2018 14:27:05 +0000 (16:27 +0200)]
phy: exynos-mipi-video: Simplify code by using regmap_update_bits()

Change-Id: I89144594f128b73a3c0c38ab7fd2536b34ef9768
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agofimc-is: Fix memory leak in clock operations
Sylwester Nawrocki [Thu, 5 Apr 2018 15:04:55 +0000 (17:04 +0200)]
fimc-is: Fix memory leak in clock operations

devm_clk_get() allocates new struct clk which will be freed only during
the driver's deinitialization which actually never happens.

Change-Id: I94c1d42f3c1b053406437b4baf6c81577b53416b
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agodts: arm64: exynos5433-tm2: Use only I2C child node for companion device
Sylwester Nawrocki [Thu, 5 Apr 2018 16:08:42 +0000 (18:08 +0200)]
dts: arm64: exynos5433-tm2: Use only I2C child node for companion device

Change-Id: Id75be47aa2d4012e7acd263f9059dfce775ff8c5
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agofimc-is: Get rid of companion platform driver
Sylwester Nawrocki [Thu, 5 Apr 2018 15:04:55 +0000 (17:04 +0200)]
fimc-is: Get rid of companion platform driver

Change-Id: I2d9d6c690b867234ec8918747eec88d8593e44f1
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agofimc-is: Use struct device * for companion device
Sylwester Nawrocki [Thu, 5 Apr 2018 14:35:44 +0000 (16:35 +0200)]
fimc-is: Use struct device * for companion device

Change-Id: I365f652a10d62b4949561b673de93774fbae77a6
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agofimc-is: Use common struct v4l2_device for the companion device
Sylwester Nawrocki [Thu, 5 Apr 2018 14:12:38 +0000 (16:12 +0200)]
fimc-is: Use common struct v4l2_device for the companion device

Change-Id: Ia72b932676281dd972312e89d663ab096b4dbf79
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agofimc-is: Use struct device rather than struct platform_device
Sylwester Nawrocki [Thu, 5 Apr 2018 13:46:28 +0000 (15:46 +0200)]
fimc-is: Use struct device rather than struct platform_device

Change-Id: Ief3d4c4356b66e900bd76dc1bdecca02420916ae
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agoarm64: dts: exynos5433-tm2: Add camera device nodes
Sylwester Nawrocki [Mon, 16 Apr 2018 13:24:55 +0000 (15:24 +0200)]
arm64: dts: exynos5433-tm2: Add camera device nodes

Change-Id: I003c2a2ddeeea63168a4ff382eea783edd808937
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agoarm64: dts: exynos5433-tm2: Correct s2mps13 LDO23 regulator definition
Sylwester Nawrocki [Mon, 26 Mar 2018 15:58:02 +0000 (17:58 +0200)]
arm64: dts: exynos5433-tm2: Correct s2mps13 LDO23 regulator definition

Change-Id: I276496ef0223be2adc9aafefa86d790485042844
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agoarm64: dts: exynos5433: Add FIMC-IS subsystem nodes
Sylwester Nawrocki [Fri, 23 Mar 2018 16:53:48 +0000 (17:53 +0100)]
arm64: dts: exynos5433: Add FIMC-IS subsystem nodes

Change-Id: I489d4000217c1780cd7caac7469eb93345adb1fb
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agofimc-is: Set all buffer queues as bidirectional
Sylwester Nawrocki [Tue, 3 Apr 2018 13:34:36 +0000 (15:34 +0200)]
fimc-is: Set all buffer queues as bidirectional

This prevent SYSMMU fault from FIMC-IS CPU access:

[   42.220252] exynos-sysmmu 142d0000.sysmmu: 14180000.fimc_is: AW ACCESS PROTECTION FAULT occurred at 0x7ff98af0
[   42.220634] ------------[ cut here ]------------
[   42.222578] kernel BUG at drivers/iommu/exynos-iommu.c:449!
[   42.228136] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
[   42.233602] Modules linked in:
[   42.236641] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G        W       4.14.24+ #154
[   42.244105] Hardware name: Samsung TM2 board (DT)
[   42.248790] task: ffffff800905eb80 task.stack: ffffff8009040000
[   42.254699] PC is at exynos_sysmmu_irq+0x17c/0x188
[   42.259468] LR is at exynos_sysmmu_irq+0x108/0x188
[   42.264241] pc : [<ffffff80084d68b4>] lr : [<ffffff80084d6840>] pstate: 600001c5
[   42.271620] sp : ffffff8008003e00
[   42.274915] x29: ffffff8008003e00 x28: ffffff8009031010
[   42.280211] x27: ffffff8009043db0 x26: ffffff8009031000
[   42.285506] x25: ffffff800913c000 x24: 000000007ff98af0
[   42.290800] x23: ffffffc0c9c4a918 x22: 0000000000000064
[   42.296095] x21: ffffffc0c9c4a958 x20: 0000000000000013
[   42.301390] x19: ffffff8008ad87c8 x18: 0000000000000010
[   42.306685] x17: 0000000000000000 x16: fffffffffffffffe
[   42.311980] x15: ffffff8089180f9f x14: 0720072007200720
[   42.317275] x13: 0720072007200720 x12: 0720072007200720
[   42.322569] x11: 0720072007200720 x10: 0720072007200720
[   42.327864] x9 : 0720072007200720 x8 : 0720072007200720
[   42.333159] x7 : 0720072007200720 x6 : 00000000000003cb
[   42.338454] x5 : 0000000000000000 x4 : 0000000000000000
[   42.343748] x3 : 0000000000000001 x2 : 000000007ff98af0
[   42.349044] x1 : ffffff8009140c80 x0 : 00000000ffffffda
[   42.354340] Process swapper/0 (pid: 0, stack limit = 0xffffff8009040000)
[   42.361024] Call trace:
[   42.363451] Exception stack(0xffffff8008003cc0 to 0xffffff8008003e00)
[   42.369879] 3cc0: 00000000ffffffda ffffff8009140c80 000000007ff98af0 0000000000000001
[   42.377692] 3ce0: 0000000000000000 0000000000000000 00000000000003cb 0720072007200720
[   42.385504] 3d00: 0720072007200720 0720072007200720 0720072007200720 0720072007200720
[   42.393317] 3d20: 0720072007200720 0720072007200720 0720072007200720 ffffff8089180f9f
[   42.401128] 3d40: fffffffffffffffe 0000000000000000 0000000000000010 ffffff8008ad87c8
[   42.408940] 3d60: 0000000000000013 ffffffc0c9c4a958 0000000000000064 ffffffc0c9c4a918
[   42.416753] 3d80: 000000007ff98af0 ffffff800913c000 ffffff8009031000 ffffff8009043db0
[   42.424564] 3da0: ffffff8009031010 ffffff8008003e00 ffffff80084d6840 ffffff8008003e00
[   42.432376] 3dc0: ffffff80084d68b4 00000000600001c5 ffffff8008ad87c8 0000000000000013
[   42.440189] 3de0: 0000007fffffffff 0000000000000064 ffffff8008003e00 ffffff80084d68b4
[   42.448001] [<ffffff80084d68b4>] exynos_sysmmu_irq+0x17c/0x188
[   42.453817] [<ffffff80080f4b14>] __handle_irq_event_percpu+0x64/0x280
[   42.460238] [<ffffff80080f4d4c>] handle_irq_event_percpu+0x1c/0x58
[   42.466400] [<ffffff80080f4dd0>] handle_irq_event+0x48/0x78
[   42.471956] [<ffffff80080f8a34>] handle_fasteoi_irq+0xbc/0x1b0
[   42.477772] [<ffffff80080f3bac>] generic_handle_irq+0x24/0x38
[   42.483499] [<ffffff80080f426c>] __handle_domain_irq+0x84/0xf8
[   42.489315] [<ffffff80080817c8>] gic_handle_irq+0x68/0xc8
[   42.494695] Exception stack(0xffffff8009043db0 to 0xffffff8009043ef0)
[   42.501119] 3da0:                                   0000000000000000 ffffff8008e3c628
[   42.508934] 3dc0: ffffff8009031010 0000000000000001 00000040d657b000 0000000000005dc0
[   42.516746] 3de0: 0000000000000008 0000000000000000 0000000000000002 ffffff8009043e70
[   42.524558] 3e00: 0000000000000980 000000000011fa88 0000000000000000 0000000000000001
[   42.532370] 3e20: 0000000000000000 ffffff8089180f9f fffffffffffffffe 0000000000000000
[   42.540183] 3e40: 0000000000000010 ffffff800913c000 ffffff800913ce78 0000000000000000
[   42.547993] 3e60: ffffff8008e1ee50 0000000000000000 0000000000000000 ffffff800905eb80
[   42.555806] 3e80: 00000000df6e4808 0000000000000000 0000000020f80018 ffffff8009043ef0
[   42.563618] 3ea0: ffffff8008085de0 ffffff8009043ef0 ffffff8008085de4 0000000060000145
[   42.571430] 3ec0: ffffff800903b048 ffffff8008e1ee50 ffffffffffffffff ffffff8009052000
[   42.579241] 3ee0: ffffff8009043ef0 ffffff8008085de4
[   42.584100] [<ffffff8008083130>] el1_irq+0xb0/0x124
[   42.588962] [<ffffff8008085de4>] arch_cpu_idle+0x34/0x1c8
[   42.594344] [<ffffff80080e2b1c>] do_idle+0x114/0x1e0
[   42.599289] [<ffffff80080e2d84>] cpu_startup_entry+0x24/0x28
[   42.604935] [<ffffff8008a390c8>] rest_init+0xc8/0xd8
[   42.609883] [<ffffff8008f80b94>] start_kernel+0x39c/0x3b0
[   42.615264] Code: 2a1803e4 9401e0bc f94032e0 b5fffbe0 (d4210000)
[   42.621339] ---[ end trace f42ebbac31eb0484 ]---

Change-Id: I2467a1646a6c6cdcb6898fd4911cb64f9f0d658e
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agofimc-is: Drop code for old kernel versions
Sylwester Nawrocki [Thu, 29 Mar 2018 13:57:30 +0000 (15:57 +0200)]
fimc-is: Drop code for old kernel versions

Change-Id: If303fd1f7546df825b6c9399791d1044ec92630a
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agofimc: Add missing memory allocator initialization for companion video node
Sylwester Nawrocki [Thu, 29 Mar 2018 13:56:06 +0000 (15:56 +0200)]
fimc: Add missing memory allocator initialization for companion video node

Change-Id: Ib8b910a54d024609a1c8e4dc675b2d61976531c0
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agofimc-is: Enable build
Marek Szyprowski [Thu, 6 Aug 2015 13:39:42 +0000 (15:39 +0200)]
fimc-is: Enable build

Change-Id: I58682e769f517bb32d9a1a65b024a548ce20884a
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
6 years agofimc-is: Remove unused Kconfig entry
Sylwester Nawrocki [Thu, 29 Mar 2018 10:35:50 +0000 (12:35 +0200)]
fimc-is: Remove unused Kconfig entry

CONFIG_OIS_FW_UPDATE_THREAD_USE is not used anywhere in the driver code.

Change-Id: I548a1793ccd9605fec24556cfbd1be36d5856827
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agofimc-is: Enable required components in Kconfig by default
Sylwester Nawrocki [Tue, 27 Mar 2018 12:43:34 +0000 (14:43 +0200)]
fimc-is: Enable required components in Kconfig by default

Change-Id: Ia2d71205a997e551724ada9009aaf88dd9500669
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agofimc-is: Adapt to latest changes DMA-mapping/IOMMU frameworks
Marek Szyprowski [Thu, 6 Aug 2015 08:03:46 +0000 (10:03 +0200)]
fimc-is: Adapt to latest changes DMA-mapping/IOMMU frameworks

This patch is a temporary workaround.

31-bit DMA mask is used to prevent overlapping with the Cortex-A5
reserved range. FIMC-IS CPU uses 0xe0000000-0xffffffff address
range for mapping peripheral devices, so those addresses must not
be used for memory buffers.

Change-Id: I74599b8037644bf7582043ac17a098d49b11193c
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
6 years agofimc-is: Remove redundant memory allocation error log
Sylwester Nawrocki [Fri, 23 Mar 2018 17:14:09 +0000 (18:14 +0100)]
fimc-is: Remove redundant memory allocation error log

kzalloc() generates stack trace on errors.

Change-Id: I73a530a18a20e7e6d9aa73daec3e89357b1c1570
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agofimc-is: Adaptation to kthread API changes
Sylwester Nawrocki [Wed, 21 Mar 2018 16:53:04 +0000 (17:53 +0100)]
fimc-is: Adaptation to kthread API changes

Change-Id: I0ef434f7c5a9a18348feaa391bb6a601d107e028
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agofimc-is: Use ktime_get_ts() instead of do_posix_clock_monotonic_gettime
Sylwester Nawrocki [Wed, 21 Mar 2018 16:25:43 +0000 (17:25 +0100)]
fimc-is: Use ktime_get_ts() instead of do_posix_clock_monotonic_gettime

do_posix_clock_monotonic_gettime() is not available any more in kernel v4.14.

Change-Id: Ib9a5a1d1069e6ad7d593f8eddc0801f418163a16
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agofimc-is: Adaptation to V4L2 API changes
Sylwester Nawrocki [Wed, 21 Mar 2018 16:24:35 +0000 (17:24 +0100)]
fimc-is: Adaptation to V4L2 API changes

Change-Id: Ia944801f9bd161bb4381b679a0d0b6920bb3d35d
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agofimc-is: Remove BUG() from fimc_is_itf_s_param()
Sylwester Nawrocki [Mon, 21 Aug 2017 16:19:50 +0000 (18:19 +0200)]
fimc-is: Remove BUG() from fimc_is_itf_s_param()

The condition being tested for that BUG() invocation is often
recoverable, so replace BUG() with a WARN_ON() and return EINVAL.
This prevents specific user space call sequences crashing the kernel,
which should never happen.
The callers of fimc_is_itf_s_param() function will be updated in
subsequent patches if necessary, to prevent any further possible
crashes.

Change-Id: I90a08278baa0cee85a4a69fa1b278e28e5c6764a
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agofimc-is: change metadata header as uapi header
Seung-Woo Kim [Thu, 22 Jun 2017 09:41:20 +0000 (18:41 +0900)]
fimc-is: change metadata header as uapi header

The header fimc-is-metadata.h is required from user, so it should
be a uapi header. So this patch moves the header to uapi header.

Change-Id: I5618889c806d4463da0bf0ea947bf5d1b667d5e3
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
6 years agofimc-is: Rename "is fail" to "failed"
Sylwester Nawrocki [Thu, 3 Mar 2016 15:27:59 +0000 (16:27 +0100)]
fimc-is: Rename "is fail" to "failed"

Change-Id: Ifd587dd48cf28d91250814499b881198cc039229
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agofimc-is: Add proper implementation of fimc_is_ischain_forcedown()
Sylwester Nawrocki [Fri, 11 Mar 2016 15:08:37 +0000 (16:08 +0100)]
fimc-is: Add proper implementation of fimc_is_ischain_forcedown()

Change-Id: I1f9314050dd9ca52623dd1770ccef3fa8b3755d6
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>