Background:
- EDP software register bank is on the EDP 24m clock domain;
- CPU access EDP software register bank, need to go through EDP APB
read/write bus and EDP internal read/write bus;
- EDP APB read/write bus is on the EDP pclk clock domain;
- EDP internal read/write bus is on the EDP 24m clock domain;
- Asynchronous logic circuit is added between APB read/write bus and
Internal read/write bus;
Issue:
There is a bug on the Asynchronous logic circuit between APB read/write
bus and Internal read/write bus; This bug will be random to cause the
following wrong control/address signals sequence happen;
- For write, maybe wrong register address is wrote in;
- For read, maybe wrong register address is read out;
Workaround:
- For CPU write EDP register operation, write any register need
following three steps,
1): Read EDP_BASE+0x00 dummy register firstly, latch the dummy
register address on Reg_Address bus, to avoid next step write to
wrong register to cause function register overrun;
2): 1st time to write the EDP register you want to operate,
to latch the real write address on Reg_Address bus;
3): 2nd time to write the EDP register you want to operate,
to make sure the data is write on the real write address;
- For CPU read EDP register operation, read any register need following
two steps,
1): 1st time to read the EDP register you want to operate, to latch
the real read address on Reg_Address bus;
2): 2nd time to read the EDP register you want to operate, to make
sure the data is read out from the real read address;
Change-Id: I4a87d3883efe94d32ccf8809edb5b9d869670d2d
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
This adds clk_get_optional() and devm_clk_get_optional() functions to get
optional clocks.
They behave the same as (devm_)clk_get() except where there is no clock
producer. In this case, instead of returning -ENOENT, the function
returns NULL. This makes error checking simpler and allows
clk_prepare_enable, etc to be called on the returned reference
without additional checks.
Change-Id: I3d4fa031f94c313f836712d8c3d8177c9eb3f06a
Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Russell King <linux@armlinux.org.uk>
[sboyd@kernel.org: Document in devres.txt]
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
(cherry picked from commit 60b8f0ddf1)
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
The adreno driver expects the "id" field of the returned clk_bulk_data
to be filled in with strings from the clock-names property.
But due to the use of kmalloc_array() in of_clk_bulk_get_all() it
receives a list of bogus pointers instead.
Zero-initialize the "id" field and attempt to populate with strings from
the clock-names property to resolve both these issues.
Change-Id: I6d32388f8cd61b02b99f3c5a4aebb866958415eb
Fixes: 616e45df7c ("clk: add new APIs to operate on all available clocks")
Fixes: 8e3e791d20 ("drm/msm: Use generic bulk clock function")
Cc: Dong Aisheng <aisheng.dong@nxp.com>
Cc: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lkml.kernel.org/r/20190913024029.2640-1-bjorn.andersson@linaro.org
Reviewed-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
(cherry picked from commit 7f81c24265)
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
clk_bulk_get_optional() allows to get a group of clocks where one
or more is optional. For a not available clock, e.g. not specifed
in the clock consumer node in DT, its respective struct clk pointer
will be NULL. This allows for operating on a group of returned
clocks (struct clk_bulk_data array) with existing clk_bulk* APIs.
Change-Id: Ia706f1a64515e1c4c6fcbba992da7cee4ed8fe9c
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
(cherry picked from commit 2f25528e4e)
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
This patch introduces of_clk_bulk_get_all and clk_bulk_x_all APIs
to users who just want to handle all available clocks from device tree
without need to know the detailed clock information likes clock numbers
and names. This is useful in writing some generic drivers to handle clock
part.
Change-Id: I5838d4a3ca806ef487a4d8a7d5bab60018e219a2
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Tested-by: Thor Thayer <thor.thayer@linux.intel.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
(cherry picked from commit 616e45df7c)
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
'clock-names' property is optional in DT, so of_clk_bulk_get() is
introduced here to handle this for DT users without 'clock-names'
specified. Later clk_bulk_get_all() will be implemented on top of
it and this API will be kept private until someone proves they need
it because they don't have a struct device pointer.
Change-Id: I2f34ce58a0bc6d70305121dea308f4f34ce0fc2f
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Russell King <linux@arm.linux.org.uk>
Reported-by: Shawn Guo <shawnguo@kernel.org>
Tested-by: Thor Thayer <thor.thayer@linux.intel.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
(cherry picked from commit cfdc0411cf)
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Since the rk3288 used the v2 in pwm-rockchip.c that supported the pwm's
polarity.
So the pwm-cells should be 3.
Change-Id: I68c70bdeefd03ce11559abbd597c5b466a20a8c1
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
This patch drops the rockchip specific glue layer which
was used for RK3399 and RK1808. Because the DWC3 Core
has supported the drd perfectly, so we just used the
generic glue layer for most of Rockchip SoCs integrated
DWC3 controller except RK3328/RK3228H.
Change-Id: Ie88f3c06bd8fec5bb7137581519c3a2cbc40e040
Signed-off-by: William Wu <william.wu@rock-chips.com>
RK3399 EVB-IND Android10 SDK does not need usbnet, so we should close the
regulator of usbnet. However, regulator-always-off is not a correct
property of dts which can lead to xhci die and PM suspend fail.
Change-Id: I8e0ceafd8ee92d78724f423aecb769591716c017
Signed-off-by: Jianing Ren <jianing.ren@rock-chips.com>
To prevent re-enumeration, we should let PD of dwc3 always on and avoid
reset of dwc3.
However, if we run phy_power_on for u3phy without reset of dwc3, the
operation will failed with error code -110. Therefore, we add another
phy_power_on operation for u3phy when current_dr_mode is host mode.
Change-Id: I92f31de170c7d3d1d8da1d196103763b0cade05b
Signed-off-by: Jianing Ren <jianing.ren@rock-chips.com>
The dwc3 reset operation has been moved to the dwc3/core.c, so we apply
this patch to make the reset operation effective.
Change-Id: I0eb8fb7b4cd1c167fa4c69b177b4a8b6dfe26ef8
Signed-off-by: Jianing Ren <jianing.ren@rock-chips.com>
In kernel 4.4, we use the extcon notification function in dwc3-rockchip.c
to perform the drd mode switch. Kernel 4.19 implements the same
functionality in drd.c and writes the extcon notification function in
core.c. We use the upstream code implementation process and add runtime
suspend and resume.
Change-Id: I934559f77d2d6b0d3e7a7c09b829d679e7b3dc27
Signed-off-by: Jianing Ren <jianing.ren@rock-chips.com>
Speedchange_task will access pcpu->policy randomly, and the policy
will never be free, so just keep pcpu->policy will be ok even the
governor is stopped.
Fixes: a4524d29de ("cpufreq: interactive: fix race between input event and governor exit")
Change-Id: Icac24a866c6f1aa57fe147396729b02c80798f2e
Signed-off-by: Liang Chen <cl@rock-chips.com>
Cause the name of struct mpp_dma_session *session and
the name of struct mpp_session *session, have the same pointer
name, and will be easily mistaken.
Change-Id: I0c50bd1834bcb7c0a59ab6e6fc4bc1136f8a42b7
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
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>