tips:
1. If fd has imported, then just copy mem_regiony struct.
2. Task is the unit for running, and mem_region is the
internal element of task.
3. In mem_regions, it can only kref_get once with the same fd,
instead of all fds which the same fd.
Change-Id: I7236803a5a263d6e79256036caf580b5ac2c35e9
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
The cpll clk gate bits had an ordering issue. This led to the loss of
the boot sdmmc controller when the gmac was shut down with:
`ip link set eth0 down`
as the cpll_100m was shut off instead of the cpll_62p5.
cpll_62p5, cpll_50m, cpll_25m were all off by one with cpll_100m
misplaced.
Fixes: e9ac850b88 ("clk: rockchip: add clock controller for rk3568")
Signed-off-by: Peter Geis <pgwipeout@gmail.com>
Link: https://patchwork.kernel.org/project/linux-clk/patch/20210519174149.3691335-1-pgwipeout@gmail.com/
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Change-Id: I012bdbdc44c4e8de1b42a00c2a9bffb7bd66faef
Many TCON devices include an embedded LCD panel self-test mode.
This mode is designed to help system integrators identify
the root cause of abnormal display operation, without the use of
complicated debug tools.
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Change-Id: I19770c7488d43e2486c5fde5cc0a5b345e5be0eb
reason: mem_regions are within a task, and the differ time between
mem_region can be ignore. Thus, it can be remove when attach task fds.
Change-Id: I5986d2dca6eff41d6c6a8fa3f037e183b102e63c
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
1.add debug ioctl
2.EPD_A2 mode no need to do part count
Signed-off-by: Zorro Liu <lyx@rock-chips.com>
Change-Id: I6ddfbc5683743759cb2f7be96265df06d3db7de9
if rcb_info not change, then the infos will not ioctl from userspace.
thus, it needs to restore infos in session.
Change-Id: I4ff3b5bcc22b033b1d7549866af7c253bf46945c
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
By making the Y channel and the UV channel's access address equal,
the function of RGA input grayscale image is realized, without
need to allocate extra UV channel memory.
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I0110ec6935c7233905e724be3df9f4fba9ef8cf0
win_mask is more safe than plane_mask on crtc_state,
because crtc_state may changed by many interface.
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Change-Id: I886c8e1e1c0505e46292721de05d9be7c167d956
The f_uac1 use ep address 0x81 and 0x01 to get sample rate,
so it can only support uac1 ep1-in and ep1-out to get playback
and capture sample rate, it has limitation for USB composite
device (e.g. RNDIS & UAC1). This patch use in_ep->address and
out_ep->address instead of the fixed addresses.
Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: Ia1a454d9738324605c00c4889b3fe187fdfcdb7d
Because alt settings in an interface are supported only
for ISOC endpoints, so do not handle alt 0 for bulk
streaming interface.
Change-Id: Iadcf6c058023d5a3d6caa353cd783752f84a77a9
Signed-off-by: William Wu <william.wu@rock-chips.com>
when pixels less then default-max-load, use normal-rates,
otherwise, use advanced-rates instead.
Change-Id: Ie2d58c05a2e8d2f5e5f9d932b3e51024b48b91d2
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
According to USB Audio Device 1.0 Spec, Ch4.6.1.1:
The wMaxPacketSize of endpoint is defined as follows:
Maximum packet size of endpoint is capable of sending
or receiving when this configuration is selected. This
is determined by the audio bandwidth constraints of
the endpoint.
In current code, the wMaxPacketSize is limited to 200,
and the bInterval is set to 4 (1ms). That is, the maximum
bandwidth over USB bus is 200 * 1000 = 200000 bytes.
We find an issue about bandwidth limitation when we try to
support UAC1 with 8ch * 16bit * 16KHz on RK3308 platform,
which needs more bandwidth than it can support.
This patch sets the wMaxPacketSize dynamically according
to the parameters of UAC1. It is similar to the same thing
done earlier for f_uac2.
Change-Id: I9af3fd7665a80b5eb0cfb5dc91ebe2c20df1dd46
Signed-off-by: William Wu <william.wu@rock-chips.com>
As per UAC2 Audio Data Formats spec (2.3.1.1 USB Packets),
if the sampling rate is a constant, the allowable variation
of number of audio slots per virtual frame is +/- 1 audio slot.
It means that endpoint should be able to accept/send +1 audio
slot.
Previous endpoint max_packet_size calculation code
was adding sometimes +1 audio slot due to DIV_ROUND_UP
behaviour which was rounding up to closest integer.
However this doesn't work if the numbers are divisible.
It had no any impact with Linux hosts which ignore
this issue, but in case of more strict Windows it
caused rejected enumeration
Thus always add +1 audio slot to endpoint's max packet size
Change-Id: I3bef24e77d5d9dfc11438da24664192753e2cac4
Fixes: 913e4a90b6 ("usb: gadget: f_uac2: finalize wMaxPacketSize according to bandwidth")
Cc: Peter Chen <peter.chen@freescale.com>
Cc: <stable@vger.kernel.org> #v4.3+
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Link: https://lore.kernel.org/r/1614599375-8803-2-git-send-email-ruslan.bilovol@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit 789ea77310)
RGA need to access CMA buffer at kernel space, so add this flag to keep kernel
line mapping for RGA.
Change-Id: Ia59acee3c904a495792229a80c42f74ae34200e3
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Static structures rk805_pinctrl_desc and rk805_gpio_chip, of types
gpio_chip and pinctrl_desc respectively, are not used except to be
copied into the fields of a different variable. Hence make
rk805_pinctrl_desc and rk805_gpio_chip both constant to protect them
from unintended modification.
Issue found with Coccinelle.
Change-Id: I63bf61b6aecaa095495157cd9eca6d8db5580fb8
Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190819075757.1753-1-nishkadg.linux@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 6e28aaab07)
Enable blending and intra interpolation by default.
Change-Id: I3f304714d630b4aab677ab6d09cfea514b03d7b1
Signed-off-by: Alpha Lin <alpha.lin@rock-chips.com>
Some sd cards violate the spec. They claim to support CMD23
but actually not. We don't have a good method to work around
them except for adding MMC_QUIRK_BLK_NO_CMD23 one by one. But
it's not a acceptable way for our custmors. So removing CMD23
support for all sd cards to solve it.
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Change-Id: I006ee5d6c0035aed114cbdaac36cc854b9135f60
Item size is calculated according to the actual space used
Change-Id: I7133368130689f792f05e82fea04ebf16a755a37
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
Item size is calculated according to the actual space used
Change-Id: I7e4ce774a16d665a33e411991dc6dc767e1aba93
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
1) Support the usb hub on evb ind v13 board
2) enable i2s1
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Change-Id: If3f394da18f79a7d4800eeef97377893af31357b
I test on RK3399 IND EVB running Android R system, and
set the USB gadget as UVC function via configfs, both
the USB 2.0 and 3.0 UVC have preview abnormal problems.
If the CPU enter deeper sleep, the USB DMA transfer gets
corrupted, and the UVC ISOC transmission lost data.
This patch puts in a "pm_qos_latency" requirement which
will keep the CPU out of the deeper sleep states when
UVC stream on. And allow the CPU to enter deeper sleep
state after UVC stream off.
Change-Id: I808290f124c6a32da3888819348093a205bfad61
Signed-off-by: William Wu <william.wu@rock-chips.com>
As per USB 3.1 spec "Table 9-26. SuperSpeed Endpoint Companion
Descriptor", the wBytesPerInterval must be set to zero for bulk
endpoints.
Change-Id: I2ec14ac0b0db1f4b5dc3bdbb61e3d2c02c63da23
Signed-off-by: William Wu <william.wu@rock-chips.com>
For Rockchip platforms, they may need to get the mult and
maxburst of endpoints for USB superspeed gadget when bind
USB functions (e.g. uvc_function_bind), then the USB DWC3
controller can do Tx fifos resize properly for each endpoints.
Change-Id: I7baddbc0dc515c91d82ca4bc1960531919ed6008
Signed-off-by: William Wu <william.wu@rock-chips.com>
This patch supports tx fifos resize for superspeed, if needed.
And it limits the maximum fifo size to six times of the endpoint
maxpacket because of the limited dwc3 hardware fifos.
Change-Id: I69af3419ecdc7f5d0869ba5d2dce041e4d90fae7
Signed-off-by: William Wu <william.wu@rock-chips.com>
When do USB 3.0 Receiver Jitter Tolerance Test, it fails at
Sj Frequency 2.0/4.9/10.0 [MHz]. This patch adjusts the PLL
parameters for USB to pass the Receiver Jitter Tolerance Test,
and it's helpful to improve the USB 3.0 signal compatibility.
Change-Id: I58eb687a4677fe22cf5bc324578b033526310859
Signed-off-by: William Wu <william.wu@rock-chips.com>