Enable TPS65132 regulator driver to support dual output power
supply used in LCD panels for RK3399 M series tablet board.
Change-Id: I8f1c03cc8c99423216da79efdaed23d96ab4c0c2
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
In case of a missing (optional) gpio don't fall through up to
"ti,active-discharge-time-us" due to
devm_fwnode_get_index_gpiod_from_child() returning NULL (since
gpiod_get_from_of_node() returned NULL) but rather indicate success as
intended.
This makes the driver probe correctly when e.g. only the enable gpio is
given.
Change-Id: Ic01e5b2ab058d9b34b4ffabb22d494a608847b3d
Signed-off-by: Guido Günther <agx@sigxcpu.org>
Link: https://lore.kernel.org/r/363bd50cc7c60daa57d614a341d1fd649f05194c.1567625660.git.agx@sigxcpu.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
(cherry picked from a957446706)
The tps65132_regulator_ops and tps_regs_desc never need to be modified,
make them const so compiler can put them to .rodata.
Change-Id: I2731779813a11b589410d0020165c44fbb1b1778
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
(cherry picked from 4e105e3b4b)
1. command to reset all fd in session, used when user space info change
2. command to translate fd into iova
3. command for release fd
Change-Id: I8b9faf1d549901517563b14aaec5c178fdfc4037
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
some pcb layout dual mipi/lvds channel maybe mistake. we can set
rockchip,dual-channel-swap = <1> to swap the dual channel at dts
file.
Change-Id: I940e1cd6ed006d07d9ba2e629c15472402a0d8e2
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Newer high definition cameras, and cameras with multiple lenses such as
the range of stereo-vision cameras now available have ever increasing
data rates.
The inclusion of a variable length packet header in URB packets mean
that we must memcpy the frame data out to our destination 'manually'.
This can result in data rates of up to 2 gigabits per second being
processed.
To improve efficiency, and maximise throughput, handle the URB decode
processing through a work queue to move it from interrupt context, and
allow multiple processors to work on URBs in parallel.
Change-Id: I825a107e706a964525dcabba4faa9434f499fd96
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit b012186ace)
The streaming object is a key part of handling the UVC device. Although
not critical, we are currently missing a call to destroy the mutex on
clean up paths, and we are due to extend the objects complexity in the
near future.
Facilitate easy management of a stream object by creating a pair of
functions to handle creating and destroying the allocation. The new
uvc_stream_delete() function also performs the missing mutex_destroy()
operation.
Previously a failed streaming object allocation would cause
uvc_parse_streaming() to return -EINVAL, which is inappropriate. If the
constructor failes, we will instead return -ENOMEM.
While we're here, fix the trivial spelling error in the function banner
of uvc_delete().
Change-Id: I695d511a6e20b908f5f49da5cdd0833ee3641b92
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit ece41454c6)
The buffer queue interface currently operates sequentially, processing
buffers after they have fully completed.
In preparation for supporting parallel tasks operating on the buffers,
we will need to support buffers being processed on multiple CPUs.
Adapt the uvc_queue_next_buffer() such that a reference count tracks the
active use of the buffer, returning the buffer to the VB2 stack at
completion.
Change-Id: Ia42cca9bed7852175202017b042590d844e8c6b0
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 01e90464e4)
Both uvc_start_streaming(), and uvc_stop_streaming() are called from
userspace context, with interrupts enabled. As such, they do not need to
save the IRQ state, and can use spin_lock_irq() and spin_unlock_irq()
respectively.
Change-Id: I1cde5a8d9a8890cc2b671d1e32d3b6b4b0eac635
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit c50c9c1e65)
The URB completion operation obtains the current buffer by reading
directly into the queue internal interface.
Protect this queue abstraction by providing a helper
uvc_queue_get_current_buffer() which can be used by both the decode
task, and the uvc_queue_next_buffer() functions.
Change-Id: Ic5401fe9afec00b87bb075f99addae8591de6890
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit e829b262a6)
The URB completion handlers currently reference the stream context.
Now that each URB has its own context structure, convert the decode (and
one encode) functions to utilise this context for URB management.
Change-Id: Ib56b25ca4ec049c5eb75ffceda9c2d8a0c1a96cf
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit c6d664fe8a)
We currently store three separate arrays for each URB reference we hold.
Objectify the data needed to track URBs into a single uvc_urb structure,
allowing better object management and tracking of the URB.
All accesses to the data pointers through stream, are converted to use a
uvc_urb pointer for consistency.
Change-Id: I03320cff8ec5cb268b62610b9852b32505f136aa
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 811496c967)
The device information structure is currently copied field by field in
the uvc_device structure. As we only have two fields at the moment this
isn't much of an issue, but it prevents easy addition of new info
fields.
Fix this by storing the uvc_device_info pointer in the uvc_device
structure. As a result the uvc_device meta_format field can be removed.
The quirks field, however, needs to stay as it can be modified through a
module parameter.
As not all device have an information structure, we declare a global
"NULL" info instance that is used as a fallback when the driver_info is
empty.
Change-Id: I648490fb775891687b6eededafd270dafe50641f
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 3a03284dd4)
The input event callback does not check the governor_enabled state on
affected CPUS, which will cause kernel panic because the governor_data
will be NULL when governor exit.
Change-Id: Ic2e5cdaefa519701b23203bb77804ce850a5d349
Signed-off-by: Liang Chen <cl@rock-chips.com>
No android board use hid-over-i2c.
before:
text data bss dec hex filename
12536545 4902620 2158240 19597405 12b085d vmlinux
after:
text data bss dec hex filename
12530111 4902420 2158240 19590771 12aee73 vmlinux
Save about 6K.
Change-Id: Idc64bafe267d614041faf7ac0355fffabba8fc36
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
before:
text data bss dec hex filename
12756996 5025528 2158624 19941148 130471c vmlinux
after:
text data bss dec hex filename
12536545 4902620 2158240 19597405 12b085d vmlinux
Save about 336K.
Change-Id: Ie50e85bd2673fa6ec355e79627ee0ccb166921b7
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
before:
text data bss dec hex filename
12231986 4559104 2146976 18938066 120f8d2 vmlinux
after:
text data bss dec hex filename
12232306 3698944 2146976 18078226 113da12 vmlinux
Save about 840K.
Change-Id: I4472a77bdd2533516dd9bf5007d9507939647562
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
The legacy node "dwc_control_usb" and related properties
is used for dwc_otg_310 driver which has been deprecated,
so remove these unused nodes and properties for rk3288 usb.
Change-Id: I38004b84fb03e879d8910bc125090c3f8197afd1
Signed-off-by: William Wu <william.wu@rock-chips.com>
This patch removes the legacy dwc_otg_310 drivers which are
used for RK3288/RK3368 SoCs, and use dwc2 drivers instead
of it.
Change-Id: I281a02f335fe64fd20d3cdb301d41eda74ea1b63
Signed-off-by: William Wu <william.wu@rock-chips.com>
If the Type-C PHY works as DP 4 lanes, the Tx/Rx lanes
of Type-C USB 3.0 PHY is used for DP lanes, so it needs
to force the USB 3.0 to USB 2.0 only, and make sure USB
3.0 xHCI controller doesn't support USB 3.0 port.
With this patch, an ASUS Type-C to HDMI dongle which
supports DP 4 lanes and USB 2.0 simultaneously can
suspend/resume successfully.
Change-Id: I77049702c768bd56d638d11c29aae07eeb608282
Signed-off-by: William Wu <william.wu@rock-chips.com>
Free g_vendor when init failed or module exit.
Alloc g_vendor once because g_vendor size is large.
Change-Id: Ia4909ba86f010c59fc2821dd0732b698b188bbcc
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
for some scene we need to alloc continue buffer from dma buffer,
but vop iommu is still enable, so we add iommu map for dma buffer.
Change-Id: I4749eac53609f865d0d4230364b1cbaf39ee095a
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
the previous practice will set the reg of i2s_select to select spdif when
audio shutdown and playing spdif at this point will cause the audio to
come out of hdmi as well
Change-Id: I8f9f53ea71ce83b33e32b575bacd2249da3b7d8f
Signed-off-by: Xinhuang Li <buluess.li@rock-chips.com>
support camera gc2355 default for rk3399_tve1030g board
Change-Id: Ib90711a7ade38228ad5d3e6568777b39cfd932a2
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>