Commit Graph

854438 Commits

Author SHA1 Message Date
Ren Jianing
55c7a54911 usb: gadget: u_audio: add uevent for set_alt and set_srate
This patch add uevent to notify the application layer when it should
playback or capture and setting the accuration sample rate.

The event consists of three parts, namely USB_STATE, STREAM_DIRECTION
and STREAM_STATE. For example:

g_audio_work: sent uac uevent USB_STATE=SET_INTERFACE STREAM_DIRECTION=IN STREAM_STATE=OFF
g_audio_work: sent uac uevent USB_STATE=SET_INTERFACE STREAM_DIRECTION=OUT STREAM_STATE=ON
g_audio_work: sent uac uevent USB_STATE=SET_SAMPLE_RATE STREAM_DIRECTION=OUT SAMPLE_RATE=44100

Signed-off-by: Ren Jianing <jianing.ren@rock-chips.com>
Change-Id: Ia01572d92d0c3ae40b19e772571282b8806da9e5
2020-07-15 09:31:34 +08:00
Ren Jianing
a322b6c50d FROMLIST: usb: gadget: f_uac*: Support multiple sampling rates
Implement support for multiple sampling rates in the USB Audio gadgets.
A list of sampling rates can be specified via configfs. All enabled
sampling rates are sent to the USB host on request. When the host
selects a sampling rate the internal active rate is updated. The
currently configured rates are exposed through amixer controls. Also on
pcm open from userspace the requested rated is checked against the
currently configured rate of the host.

Link: https://lore.kernel.org/patchwork/patch/805286/
Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Ren Jianing <jianing.ren@rock-chips.com>
Change-Id: I43dc28462062c9aa179c2b9c8e7e50c307137874
2020-07-15 09:31:34 +08:00
Ren Jianing
9de5fa6df1 FROMLIST: usb: gadget: f_uac*: Reduce code duplication
This replaces the dedicated headers for uac1 and uac2 functions with a
shared header for both of them. Apart from unifying the struct names,
further duplicated code for configfs setup is moved out of the function
files into the shared header.

Link: https://lore.kernel.org/patchwork/patch/805285/
Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Ren Jianing <jianing.ren@rock-chips.com>
Change-Id: Ie866bd02f174dc91168fe0bc49b571a77d849a42
2020-07-15 09:31:34 +08:00
Julian Scheel
9cc791ff36 FROMLIST: usb: gadget: f_uac1: Fix endpoint reading
The endpoint is stored in the lower byte of wIndex, according to USB
Audio 1.0 specification, section 5.2.1.1.

Link: https://lore.kernel.org/patchwork/patch/805284/
Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Ren Jianing <jianing.ren@rock-chips.com>
Change-Id: I16634151e98cfb0f7107e96463a20b8fa8d7072f
2020-07-15 09:31:34 +08:00
William Wu
10e9abc766 ARM: dts: rockchip: enable txfifo resize for rv1126 usb
RV1126 EVB USB gadget maybe used as UVC function which
needs to resize txfifo to improve isoc ep throughput,
so this patch adds "snps,tx-fifo-resize" property to
enable txfifo resize.

Change-Id: I00447fb252a093acb24525b12479f67662d9dfe3
Signed-off-by: William Wu <william.wu@rock-chips.com>
2020-07-14 19:25:26 +08:00
William Wu
5d4fc6626d usb: dwc3: gadget: fix the txfifo resize for isoc ep
The dwc3 driver sets the mult to 6 and alloc 0x307 * 8 Bytes
for each isoc ep txfifo. It aims to improve isoc ep throughput,
but it's wasteful.

This patch sets the mult to dep->endpoint.mult * 2 for each isoc
ep, it's enough to improve isoc ep throughput, and it can avoid
exceeding the total size of txfifo if multiple isoc eps are used
at the same time.

Change-Id: I01d77d19b85e5f5930ff94ef40714129afe10b54
Signed-off-by: William Wu <william.wu@rock-chips.com>
2020-07-14 19:18:03 +08:00
XiaoDong Huang
50151fc7a3 regulator: tps549b22: add TI TPS549b22 support
Change-Id: I7550fc9f78a30b5d8ff705403ad91cfd8727fad6
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2020-07-14 16:17:40 +08:00
William Wu
432a0d89dd usb: dwc3: core: reset the whole controller during probe
This patch reset the dwc3 controller at the beginning of
probe. Without this patch, it may fail in enumeration phase
if the dwc3 has been initialized and used before kernel.

Typically, we use usb to download image and boot directly
on RV1126 board, it will fail to connect to host with the
following error log:

[2.029506] read descriptors
[2.029597] read strings
[3.038749] dwc3 ffd00000.dwc3: unexpected direction for Data Phase
[3.077445] android_work: did not send uevent (0 0   (null))
[3.282586] vendor storage:20190527 ret = -1
[3.335505] usb0: HOST MAC 16:ba:52:5a:90:28
[3.335566] usb0: MAC 6a:73:d9:da:da:ce
[3.335597] configfs-gadget gadget: uvc_function_bind
[5.052086] dwc3 ffd00000.dwc3: unexpected direction for Data Phase
[5.052431] dwc3 ffd00000.dwc3: unexpected direction for Data Phase

Change-Id: I7eede4685a26cff5fc9460233291757edf18e430
Signed-off-by: William Wu <william.wu@rock-chips.com>
2020-07-14 16:16:34 +08:00
Yiqing Zeng
82f893648d media: i2c: os04a10 changed supported mode to 10bit@30fps by default
Signed-off-by: Yiqing Zeng <zack.zeng@rock-chips.com>
Change-Id: I1a6e94bd36ff09c2964251d1c0ad83ed7f577c47
2020-07-14 14:28:13 +08:00
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