Commit Graph

854429 Commits

Author SHA1 Message Date
Sandy Huang
af3bfcd5cf drm/rockchip: add rockchip_drm_get_sub_dev_type
1. before this, the DMC driver use drm_device_get_by_name() to get drm
connector info, now we use rockchip_drm_get_sub_dev_type() to instead of
it.
2. export rockchip drm sub dev functions.

Change-Id: Ief6546d933fbb49e46e6e8d2a99464eb5951e069
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2020-07-13 20:47:09 +08:00
David Wu
42f500840d i2c: rk3x: Remove start state and irq
Let configuration start and count be performed at the
same time as much as possible, which can reduce the
interval between the start signal and the data signal,
and can also reduce a start irq.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I529300a083dcd264cc5f25a2069b88601cade83e
2020-07-13 20:28:00 +08:00
Jon Lin
ab08158001 spi: rockchip: Fix error in SPI slave pio read
Maybe RXFLR is larger than rx_left

Change-Id: Ic851d68250ba9cbe73c00ba40a925542e5505265
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-07-13 20:23:29 +08:00
Mark Brown
ce3a66e6df UPSTREAM: spi: Fix core transfer waits after slave support
The refactoring done as part of adding the core support for handling
waiting for slave transfer dropped a conditional which meant that we
started waiting for completion of all transfers, not just those that the
controller asked for.  This caused hangs and massive delays on platforms
that don't need the core delay.  Re-add the delay to fix this.

Fixes: 810923f3bf (spi: Deal with slaves that return from transfer_one() unfinished)
Change-Id: I8fe4c6d42bc7c64d9c9b6803d154ec169752283f
Reported-by: Tony Lindgren <tony@atomide.com>
Tested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit d57e79601b)
2020-07-13 20:22:07 +08:00
Lubomir Rintel
da31d8c6af UPSTREAM: spi: Deal with slaves that return from transfer_one() unfinished
Some drivers, such as spi-pxa2xx return from the transfer_one callback
immediately, idicating that the transfer will be finished asynchronously.

Normally, spi_transfer_one_message() synchronously waits for the
transfer to finish with wait_for_completion_timeout(). For slaves, we
don't want the transaction to time out as it can complete in a long time
in future. Use wait_for_completion_interruptible() instead.

Change-Id: I166415911f30fc821fca73b0250f6350b835e8c0
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Acked-by: Pavel Machek <pavel@ucw.cz>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 810923f3bf)
2020-07-13 20:22:07 +08:00
Phil Elwell
4c5472af2c UPSTREAM: spi: Make GPIO CSs honour the SPI_NO_CS flag
The SPI configuration state includes an SPI_NO_CS flag that disables
all CS line manipulation, for applications that want to manage their
own chip selects. However, this flag is ignored by the GPIO CS code
in the SPI framework.

Correct this omission with a trivial patch.

Change-Id: I75e69b1eb5068357d9abfe8236cfbd2188c626f1
Signed-off-by: Phil Elwell <phil@raspberrypi.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 25972d0c33)
2020-07-13 20:22:07 +08:00
Trent Piepho
93f999e60a UPSTREAM: spi: Add driver_override SPI device attribute
This attribute works the same was as the identically named attribute
for PCI, AMBA, and platform devices.  For reference, see:

commit 3cf3857134 ("ARM: 8256/1: driver coamba: add device binding
path 'driver_override'")
commit 3d713e0e38 ("driver core: platform: add device binding path
'driver_override'")
commit 782a985d7a ("PCI: Introduce new device binding path using
pci_dev.driver_override")

If the name of a driver is written to this attribute, then the device
will bind to the named driver and only the named driver.

The device will bind to the driver even if the driver does not list the
device in its id table.  This behavior is different than the driver's
bind attribute, which only allows binding to devices that are listed as
supported by the driver.

It can be used to bind a generic driver, like spidev, to a device.

Change-Id: Ieb82f7cf3c17b6b928588a5a17f35481ac6b3338
Signed-off-by: Trent Piepho <tpiepho@impinj.com>
Reviewed-by: Jan Kundrát <jan.kundrat@cesnet.cz>
Tested-by: Jan Kundrát <jan.kundrat@cesnet.cz>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 5039563e7c)
2020-07-13 20:22:07 +08:00
Marco Felsch
2cc2663961 UPSTREAM: spi: make OF helper available for others
The of_find_spi_device_by_node() helper function is useful for other
modules too. Export the funciton as GPL like all other spi helper
functions and make it available if CONFIG_OF is enabled, because it isn't
related to the CONFIG_OF_DYNAMIC context. Finally add a stub if
CONFIG_OF isn't enabled, so others must not care about it.

Change-Id: If74acbf7ccefa3cec88dfb8fa1d4f39b333c5c48
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 5f143af750)
2020-07-13 20:22:07 +08:00
Marco Felsch
f4364459a4 UPSTREAM: spi: switch to SPDX license identifier
Use the appropriate SPDX license identifier and drop the previous
license text.

Change-Id: Ie3b822af5c7ddc9ae515a36713d407fe4725e3dc
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit b445bfcb90)
2020-07-13 20:22:07 +08:00
David Lechner
361d08ea0f UPSTREAM: spi: always use software fallback for SPI_CS_WORD when using cs_gio
This modifies the condition for using the software fallback
implementation for SPI_CS_WORD when the SPI controller is using a GPIO
for the CS line. When using a GPIO for CS, the hardware implementation
won't work, so we just enable the software fallback globally in this
case.

Change-Id: I6d8320e51bd786ffa834f2ce8dd3a6799bec9b19
Signed-off-by: David Lechner <david@lechnology.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 71388b2156)
2020-07-13 20:22:07 +08:00
David Lechner
4353a70bdb UPSTREAM: spi: add software implementation for SPI_CS_WORD
This adds a default software implementation for the SPI_CS_WORD flag for
controllers that don't have such a feature.

The SPI_CS_WORD flag indicates that the CS line should be toggled
between each word sent, not just between each transfer. The
implementation works by using existing functions to split transfers into
one-word-sized transfers and sets the cs_change bit for each of the
new transfers.

Change-Id: Iaf210b28f14ae7319e689ef5c411d8a17fdd04ce
Signed-off-by: David Lechner <david@lechnology.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit cbaa62e009)
2020-07-13 20:22:07 +08:00
David Lechner
d41a1fe15e UPSTREAM: spi: add new SPI_CS_WORD flag
This adds a new SPI mode flag, SPI_CS_WORD, that is used to indicate
that a SPI device requires the chip select to be toggled after each
word that is transferred.

Change-Id: I967cbbef8f8c31bb40d52f74f9ae0b2297553819
Signed-off-by: David Lechner <david@lechnology.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 0baf9eb255)
2020-07-13 20:22:07 +08:00
Baolin Wang
cc62f47077 UPSTREAM: spi: Introduce one new field to set word delay
For some SPI controllers, after each word size (specified by bits_per_word)
transimission, the hardware need some delay to make sure the slave has enough
time to receive the whole data.

So introducing one new 'word_delay' field of struct spi_tansfer for slave
devices to set this inter word delay time.

Change-Id: I1329a3cfa3818d43bea7d316b452d6f2becae6f7
Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit eeaceb8b7d)
2020-07-13 20:22:07 +08:00
Chris Ruehl
a2149a6781 UPSTREAM: spi: spi-rockchip: add support for spi slave mode
Add support for spi slave mode in spi-rockchip. The register map has an entry
for it. If spi-slave is set in dts, set this corresponding bit and add to
mode_bits the SPI_NO_CS, allow slave mode without explicit CS use.
Slave abort function had been added.

Change-Id: I964fa2f1ada1bc5ad7e421d5ad617fa22a51128e
Signed-off-by: Chris Ruehl <chris.ruehl@gtsys.com.hk>
Link: https://lore.kernel.org/r/20200511083022.23678-3-chris.ruehl@gtsys.com.hk
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit d065f41a3f)
2020-07-13 20:11:19 +08:00
Chris Ruehl
ef5f97a27d UPSTREAM: spi: spi-rockchip: cleanup use struct spi_controller
Cleanup, move from the compatibily layer struct spi_master over
to struct spi_controller, and rename the related function calls.

Change-Id: I7b999ff4aa43ed30b892c93d318859f5ad1934bd
Signed-off-by: Chris Ruehl <chris.ruehl@gtsys.com.hk>
Link: https://lore.kernel.org/r/20200511083022.23678-2-chris.ruehl@gtsys.com.hk
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit d66571a20f)
2020-07-13 20:11:10 +08:00
Emil Renner Berthing
7d7c262975 UPSTREAM: spi: rockchip: turn down tx dma bursts
This fixes tx and bi-directional dma transfers on rk3399-gru-kevin.

It seems the SPI fifo must have room for 2 bursts when the dma_tx_req
signal is generated or it might skip some words. This in turn makes
the rx dma channel never complete for bi-directional transfers.

Fix it by setting tx burst length to fifo_len / 4 and the dma
watermark to fifo_len / 2.

However the rk3399 TRM says (sic):
"DMAC support incrementing-address burst and fixed-address burst. But in
the case of access SPI and UART at byte or halfword size, DMAC only
support fixed-address burst and the address must be aligned to word."

So this relies on fifo_len being a multiple of 16 such that the
burst length (= fifo_len / 4) is a multiple of 4 and the addresses
will be word-aligned.

Change-Id: I7dd843e85e4d888af79ec57a73d1561f8402635e
Fixes: dcfc861d24 ("spi: rockchip: adjust dma watermark and burstlen")
Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 47300728fb)
2020-07-13 20:10:45 +08:00
Emil Renner Berthing
891bf112bd UPSTREAM: spi: rockchip: support lsb-first mode
Add missing support for lsb-first mode.

Change-Id: Ifad8eca549ef0652303e98f1306a1e8a3c2fb6a3
Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 04290192f7)
2020-07-13 20:10:11 +08:00
Emil Renner Berthing
351b34607e UPSTREAM: spi: rockchip: support 4bit words
The hardware supports 4, 8 and 16bit spi words,
so add the missing support for 4bit words.

Change-Id: Iae796f362fa01bc20ae6cc7e2f1e87498b65db39
Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 65498c6ae2)
2020-07-13 20:10:03 +08:00
Emil Renner Berthing
bd3464ceb3 UPSTREAM: spi: rockchip: use irq rather than polling
Register an interrupt handler to fill/empty the
tx and rx fifos rather than busy-looping.

Change-Id: I7da7080a4e9c4d7d72c1d8ca43a3cf3b918cdd6a
Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 01b59ce5da)
2020-07-13 20:09:52 +08:00
Emil Renner Berthing
f6d739b0da UPSTREAM: spi: rockchip: precompute rx sample delay
Now that we no longer potentially change spi clock
at runtime we can precompute the rx sample delay
at probe time rather than for each transfer.

Change-Id: I96e98c97aa8791938689d09e84128617c0dd2b69
Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 74b7efa82b)
2020-07-13 20:09:40 +08:00
Emil Renner Berthing
39bce059c0 UPSTREAM: spi: rockchip: set min/max speed
The driver previously checked each transfer if the
requested speed was higher than possible with the
current spi clock rate and raised the clock rate
accordingly.

However, there is no check to see if the spi clock
was actually set that high and no way to dynamically
lower the spi clock rate again.

So it seems any potiential users of this functionality
are better off just setting the spi clock rate at init
using the assigned-clock-rates devicetree property.

Removing this dynamic spi clock rate raising allows
us let the spi framework handle min/max speeds
for us.

Change-Id: I26366d6149e4c3edaa4587088828e0eb49ff9f38
Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 420b82f842)
2020-07-13 20:09:30 +08:00
Emil Renner Berthing
5f8bf41df5 UPSTREAM: spi: rockchip: simplify use_dma logic
We only need to know if we're using dma when setting
up the transfer, so just use a local variable for
that.

Change-Id: Id5e755186278f8cf4aff6e0f175bd522aee324ae
Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit eff0275e52)
2020-07-13 20:09:20 +08:00
Emil Renner Berthing
9378f64680 UPSTREAM: spi: rockchip: remove master pointer from dev data
In almost all cases we already have a pointer to the
spi master structure where we have the driver data.

The only exceptions are the dma callbacks which are
easily fixed by passing them the master and using
spi_master_get_devdata to retrieve the driver data.

Change-Id: Ia821c4924ca243447c0aa6c1a61ea4ef6319ff0a
Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit d790c342e6)
2020-07-13 20:09:06 +08:00
Emil Renner Berthing
ea2f9daa4c UPSTREAM: spi: rockchip: don't store dma channels twice
The spi master (aka spi controller) structure already
has two fields for storing the rx and tx dma channels.
Just use them rather than duplicating them in driver data.

Change-Id: I077108d25ac09dd89c6c795df181fb499b7a1211
Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit eee06a9ee2)
2020-07-13 20:08:48 +08:00
Emil Renner Berthing
2f8a03b661 UPSTREAM: spi: rockchip: read transfer info directly
Just read transfer info directly from the spi device
and transfer structures rather than storing it in
driver data first.

Change-Id: I919be5488196e6ad5e2fbac211d64c9fb2a38ec7
Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit fc1ad8ee33)
2020-07-13 20:06:19 +08:00
Emil Renner Berthing
da6324822d UPSTREAM: spi: rockchip: disable spi on error
Successful transfers leave the spi disabled, so if
we just make sure to disable the spi on error
there should be no need to disable the spi from
master->unprepare_message.

This also flushes the tx and rx fifos,
so no need to do that manually.

Change-Id: I5e357ab8852d615fee5d4ec1bc94d6f4aa7add7d
Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit ce386100d9)
2020-07-13 20:06:06 +08:00
Emil Renner Berthing
9729a03ade UPSTREAM: spi: rockchip: use atomic_t state
The state field is currently only used to make sure
only the last of the tx and rx dma callbacks issue
an spi_finalize_current_transfer.
Rather than using a spinlock we can get away
with just turning the state field into an atomic_t.

Change-Id: Ic39ce28e8261a622dbd6e035bbc5c116efd433c9
Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit fab3e4871f)
2020-07-13 20:05:51 +08:00
Emil Renner Berthing
6097c07d90 UPSTREAM: spi: rockchip: always use SPI mode
The hardware supports 3 different variants of SPI
and there were some code around it, but nothing
to actually set it to anything but "Motorola SPI".
Just drop that code and always use that mode.

Change-Id: I53d65943b80abea21f3bf35b440d56dc8a1190de
Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 2410d6a3c3)
2020-07-13 20:05:02 +08:00
Emil Renner Berthing
116a5ae782 UPSTREAM: spi: rockchip: use designated init for dma config
Use C99 designated initializers for dma slave config
structures. This also makes sure uninitialized fields
are zeroed so we don't need an explicit memset.

Change-Id: I306513287454ca38db8dde680a57ebec82965395
Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 31bcb57be1)
2020-07-13 20:04:53 +08:00
Emil Renner Berthing
41b8d2add8 UPSTREAM: spi: rockchip: make spi_enable_chip take bool
The spi_enable_chip function takes a boolean
argument. Change the type to reflect that.

Change-Id: I71f016d0cbbb6a77cda3e10e8bb7da45b227b1c9
Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 30688e4e67)
2020-07-13 20:04:44 +08:00
Emil Renner Berthing
1e47621958 UPSTREAM: spi: rockchip: simplify spi enable logic
Let the dma/non-dma code paths handle the spi enable
flag themselves. This removes some logic to determine
if the flag should be turned on before or after dma
and also don't leave the spi enabled if the dma path
fails.

Change-Id: I406fc1726fa6e6f5a2e82f05e3313f0ee4dc415c
Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit a3c174021c)
2020-07-13 20:00:40 +08:00
Emil Renner Berthing
de8fee92e6 UPSTREAM: spi: rockchip: directly use direction constants
The dma direction for the tx and rx dma channels never
change, so just use the constants directly rather
than storing them in device data.

Change-Id: Ic6a45d38d076b6c73177dc6dde78e62b0de2ce42
Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit d9071b7e9f)
2020-07-13 19:58:27 +08:00
Emil Renner Berthing
7af023d231 UPSTREAM: spi: rockchip: mark use_dma as bool
The driver data has a u32 field use_dma which is
only ever used as a boolean, so change its type
to reflect that.

Change-Id: Icf9aa668cc86b9ea87e2eb6e2d7eef6fed530cda
Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit f340b92051)
2020-07-13 19:57:09 +08:00
Emil Renner Berthing
556a9b9e4d UPSTREAM: spi: rockchip: remove unneeded dma_caps
We no longer need the dma_caps since the dma driver
already clamps the burst length to the hardware limit,
so don't request and store dma_caps in device data.

Change-Id: I10782f7ffb700322929f819703c41e6c63ff8d78
Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 058f7c509e)
2020-07-13 19:53:45 +08:00
Jon Lin
31e34b5993 Revert "spi: rockchip: support to set lsb into ROCKCHIP_SPI_CTRLR0"
This reverts commit 2c2acee8f8 which is
commit 04290192f7.

Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
Change-Id: Idda76b569aefa82b5c5d98ad5c68ec39cc8bee5d
2020-07-13 19:51:56 +08:00
Jon Lin
38931aee2a Revert "spi: rockchip: add SPI slave support"
This reverts commit 87ec170ff7 which is
commit d065f41a3f upstream.

Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
Change-Id: If48d08ec8e51829bb6bf8050d377c7060b75e140
2020-07-13 19:51:56 +08:00
Jon Lin
3723e16304 Revert "spi: rockchip: transfer SPI slave by CPU loop"
This reverts commit 846019f5fa which is
commit 810923f3bf upstream.

Upstream add wait_for_completion_interruptible to hold SPI transfer
in SPI slave work, so it support SPI slave IRQ or DMA transfer.

Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
Change-Id: Ie0202b0d2d7b9ff7bfc462587c2fc643155549f1
2020-07-13 19:51:56 +08:00
Hu Kejun
f4aac81d8b media: rockchip: isp: fix can not run v4l2-ctl command first time after boot
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
Change-Id: I5579ac72aeb13e89c5a175870d9a5783f70f4ff0
2020-07-13 19:50:05 +08:00
Sugar Zhang
8c9c4eb70a ASoC: rockchip: spdif: Handle clk by pm runtime
This patch handle the clk by pm runtime mechanism to simplify
the clk management.

Change-Id: I38ddb6345599ab737b42d787209d01c2d3f82483
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2020-07-13 19:34:19 +08:00
Huang zhibao
805b0c749b ARM: dts: rockchip: add rv1109-ai-cam-ddr3-v1 dts for rv1109 ai cam ddr3 board
Signed-off-by: Huang zhibao <hzb@rock-chips.com>
Change-Id: I4b6b08a2f411ad0a6f89b770faf88d4a7e923325
2020-07-13 19:28:51 +08:00
Fenrir Lin
a7b1426159 ARM: dts: rockchip: Add rv1109-evb-ddr3-v12-tb-emmc
Signed-off-by: Fenrir Lin <fenrir.lin@rock-chips.com>
Change-Id: I1b3048a8b3da7d101af137ef74e7597c388cbc77
2020-07-13 15:38:00 +08:00
Tao Huang
69a06720c7 ARM: dts: rockchip: Add rv11xx thunder boot dtsi
Split rv1126-evb-ddr3-v12-tb-emmc.dts to inlcude
rv11xx-thunder-boot.dtsi
rv11xx-thunder-boot-emmc.dtsi
rv11xx-evb-thunder-boot.dtsi

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: Ie35a192ab1ae4b1b59cd7e70f7ed70b8f22a69c8
2020-07-13 15:34:10 +08:00
Ding Wei
b8b96e9a4f ARM: dts: rv1126: add clk info for rkvenc
Change-Id: I30763558bb3ced211bf932cc028ed0e7d657989e
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2020-07-13 14:31:01 +08:00
Ding Wei
1f32179cba video: rockchip: mpp: rkvenc: set clk_mode according to load
Change-Id: Idf7eebf96708d8c5c95c6169a80083952d324540
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2020-07-13 14:28:13 +08:00
William Wu
943b52284b usb: dwc3: gadget: fix NULL pointer dereference in dwc3_wIndex_to_dep
This patch fixes the kernel panic issue when do reboot test
on RV1126 USB AI Camera Board with the following error log:

[3.818529] android_work: did not send uevent (0 0   (null))
[3.890319] android_work: sent uevent USB_STATE=CONNECTED
[3.929523] configfs-gadget gadget: high-speed config #1: b
[3.929743] configfs-gadget gadget: uvc_function_set_alt(2, 0)
[3.929771] configfs-gadget gadget: reset UVC Control
[3.929806] configfs-gadget gadget: uvc_function_set_alt(3, 0)
[3.930243] android_work: sent uevent USB_STATE=CONFIGURED
[3.931423] dwc3 ffd00000.dwc3: unexpected direction for Data Phase
[3.931543] Unable to handle kernel NULL pointer dereference at virtual address 0000005c
[3.933344] pgd = 6319bbbb
[3.933600] [0000005c] *pgd=00000000
[3.933941] Internal error: Oops: 17 [#1] PREEMPT SMP ARM
[3.934433] Modules linked in: galcore(O)
[3.934832] CPU: 0 PID: 568 Comm: irq/61-dwc3 Tainted: G           O      4.19.111 #9
[3.935523] Hardware name: Generic DT based system
[3.935974] PC is at dwc3_ep0_interrupt+0x638/0x80c
[3.936417] LR is at dwc3_thread_interrupt+0x7d4/0xbfc
[3.936897] pc : [<b0521224>]    lr : [<b051ea4c>]    psr: 600d00d3
[3.937462] sp : e607fe88  ip : 00000003  fp : e837d040
[3.937925] r10: e830e640  r9 : 00000008  r8 : e8302900
[3.938386] r7 : 00000000  r6 : e607ff08  r5 : e837d040  r4 : b0c08c48
[3.938965] r3 : 00000050  r2 : 00000000  r1 : e9042000  r0 : 00000004
[3.939546] Flags: nZCv  IRQs off  FIQs off  Mode SVC_32  ISA ARM  Segment user
[3.940213] Control: 10c5387d  Table: 3671c06a  DAC: 00000055
...
[4.013246] [<b0521224>] (dwc3_ep0_interrupt) from [<b051ea4c>] (dwc3_thread_interrupt+0x7d4/0xbfc)
[4.014059] [<b051ea4c>] (dwc3_thread_interrupt) from [<b016ded0>] (irq_thread_fn+0x1c/0x7c)
[4.014835] [<b016ded0>] (irq_thread_fn) from [<b016e1d4>] (irq_thread+0x124/0x200)
[4.015520] [<b016e1d4>] (irq_thread) from [<b014290c>] (kthread+0x140/0x170)
[4.016175] [<b014290c>] (kthread) from [<b01010d8>] (ret_from_fork+0x14/0x3c)
[4.016831] Exception stack(0xe607ffb0 to 0xe607fff8)

Change-Id: I4191444b527eb03a5283f662b1ad4c9d9c08cd19
Signed-off-by: William Wu <william.wu@rock-chips.com>
2020-07-13 11:58:53 +08:00
Hu Kejun
ddb9e6d1ea media: rockchip: isp: fix warning on clk_core_disable_lock when system enter suspend state
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
Change-Id: I9a579396b6a93d6087e629e24369bdc48b417ad7
2020-07-13 10:59:56 +08:00
Cai YiWei
373af0e7a7 media: rockchip: ispp: fix null of work event buffer
Change-Id: I7a03942c696a5f180d51fc255eb39d704ce2ac97
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2020-07-13 10:59:56 +08:00
Wyon Bi
7bfad24204 drm/rockchip: Add PSR support
Fixes: a109506620 ("drm/rocckhip: driver: add support dmc and use rockchip atomic_commit")
Change-Id: I5c16f4bc6887910e2f752ba29c618d0e583f616f
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2020-07-13 10:42:41 +08:00
Ren Jianing
3e14a79373 ARM: dts: rockchip: add vup_gpios in u2phy0 for rv11xx-evb-v10
The USB2.0 OTG PHY of RV1126/1109 which is designed for lower power
consumption provides only 8.8mA current source on DM. Multiplied
by 45 Ohm host termination resistance, voltage is about 400mV.
If the threshold voltage of host is greater than 400mV, the high
speed handshake will fail and SoC communicate at full speed. So
swing calibration is necessary.

We use gpio to control the 220 Ohm pull-up resistor to provide additional
current. Experiments show that the voltage of chirpK can be increases
to about 600mV.

Signed-off-by: Ren Jianing <jianing.ren@rock-chips.com>
Change-Id: Ibb0cba2b166f0370d2822ca5a3a7277ffacde8c1
2020-07-10 18:11:50 +08:00
Nickey Yang
31a0f542e1 ARM: dts: rockchip: disable logo for rv1126-evb-ddr3-v12-tb-emmc
There is no uboot in the thunder boot flow,
So disable logo for kernel display drivers fully initialized

Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
Change-Id: Ib6d36fc606dd8a4170a0a12c0800768d4f2af64a
2020-07-10 15:12:10 +08:00