the numbers and rate of Main Link lanes depend on
the panel display resolution and corlor depth, it
is recommended that the minimum number of lanes be
used, using the minimum link rate allowed for that
lane configuration.
Change-Id: Id207410589e1f77ebff79615f3367f153a9b2755
Signed-off-by: Guochun Huang <hero.huang@rock-chips.com>
Some times, we need to enable/disable ADC grps or DAC
directly to debug.
Change-Id: I53b9fa94733d84f7101e299d3fcb6f9160e36112
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
If there is no codec instance or headphone jack, we
should not request headphone jack from machine driver.
Change-Id: If05ac2f4bbfd3fc495a75c0701a44a325e5010cd
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
From the suggest of IP vendor, we need more delays to
adapt to the playing scene in different temperature
environments.
Change-Id: I95abe2bac43de19241092d6e785f28960760dacd
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
To avoid bring some noise dues to unstable micbias.
Change-Id: I0127505f0adeacda5d852ae3cefae2fb5f4ee9d2
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
DSP_A: PCM delay 1 bit mode,L data MSB after FRM LRC
DSP_B: PCM no delay mode,L data MSB during FRM LRC
Change-Id: I198519c431815de3ca1fc154da78773ca705f0e0
Signed-off-by: Xiaotan Luo <lxt@rock-chips.com>
There is playback's sound L/R channel conversion problem when recording is opened
Change-Id: Iae7160e25bdd834df9904fbd34fe964449c93560
Signed-off-by: Binyuan Lan <lby@rock-chips.com>
Switch is no longer available in kernel 4.19, so
we use extcon instead.
the hdmi connect status node:
/sys/class/extcon/extconX/state
HDMI=0:
hdmi is disconnected
HDMI=1:
hdmi is connected
Change-Id: I806d8fd5b9b4b36f15aa6aec275fad2ecf122e91
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
In deed, Zhixiong Lin missed these codes when he picking source codes
from DDK r9 to port utgard device driver of r7 to kernel 4.19.
Change-Id: If140b478b4ea8a4f72d532b8e8216ab53856be08
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
When different devices are running, there will be use wrong
device to deal with task.The reasion is that the true device
is task->queue->mpp.
Change-Id: I8fe4dd59d2525f02d010b32299ee0b82815d210a
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
Memory allocated for initrd would not be reclaimed if initializing ramfs
was skipped.
Bug: 69901741
Test: "grep MemTotal /proc/meminfo" increases by a few MB on an Android
device with a/b boot.
Change-Id: Ifbe094d303ed12cfd6de6aa004a8a19137a2f58a
Signed-off-by: Nick Bray <ncbray@google.com>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Add a skip_initramfs option to allow choosing whether to boot using
the initramfs or not at runtime.
Change-Id: If30428fa748c1d4d3d7b9d97c1f781de5e4558c3
Signed-off-by: Rom Lemarchand <romlem@google.com>
Signed-off-by: Dayao Ji <jdy@rock-chips.com>
before this commit, the plane number to dmc is error, this
will lead to DDR freq is too low and lead to display splash.
Change-Id: Iaa285b36d41b6e86c97260ac83c5d9a21ef62a05
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
When test uvc hotplug, it may caused a dead lock in the
following case:
1. Test on Rockchip platforms used USB DWC2 controller.
2. Set USB as UVC gadget and connect to PC.
3. Open UVC to preview picture, and then disconnect USB.
Then a dead lock happens.
1. usb_function_deactivate() hold the cdev->lock;
2. usb_function_deactivate() --> usb_gadget_deactivate()
--> usb_gadget_disconnect() --> dwc2_hsotg_disconnect()
--> composite_disconnect() try to get the cdev->lock again.
According to the comment for cdev->lock, it's used to protect
deactivations and delayed_status count, so we can drop the
spinlock safely before do usb_gadget_deactivate(), and hold
the spinlock again after usb_gadget_deactivate() done to
protect the deactivations.
Change-Id: I24310434f0a11f9e981817de5e31b36cdbad7344
Signed-off-by: William Wu <william.wu@rock-chips.com>
Some chips like rk3328 not support wakeup-config in dts,
So we should set wakeup IRQ enable in driver if we need
new wakeup source.
Change-Id: I735eee54bb4943b8c85a9a477f1cf9d255fc4312
Signed-off-by: Zain Wang <wzz@rock-chips.com>
According to the spec "USB Interface Association Descriptor Device
Class Code and Use Model"[1], the Interface Association Descriptor
(IAD) is needed for composite device which has multiple interfaces
controlled independently of each other. Without the IAD, the device
may not work as expected because the USB system software will not
properly bind the interfaces with drivers (e.g UAC1 && UVC composite
device not recognized in Win10).
[1] https://www.usb.org/sites/default/files/iadclasscode_r10.pdf
Change-Id: I446c771fe182bd556a054d9ae0ada1374442d1d0
Signed-off-by: William Wu <william.wu@rock-chips.com>
We need to dynamically resize the TxFIFOs for some cases
where the default values don't match.
Test on RK1808-stick board, configurate the usb with four
functions "rndis, ntb, mass_storage, acm", the default
values of TxFIFOs is:
GTXFIFOSIZ(0) = 0x00000042
GTXFIFOSIZ(1) = 0x00420184
GTXFIFOSIZ(2) = 0x01c60184
GTXFIFOSIZ(3) = 0x034a0184
GTXFIFOSIZ(4) = 0x04ce0184
GTXFIFOSIZ(5) = 0x06520184
GTXFIFOSIZ(6) = 0x07d6002a
The ep6-in is used for acm ep-in which maxpacket is 1024B,
but the default fifo size of ep6-in is only 336B, less than
the length of the ep maxpacket, it cause acm works abnormally.
This patch creates a simple function to allocate enough TxFIFO
space for each of the enabled endpoints.
Change-Id: I389ffdba4f3721ed6ef192f0c85f41fdeff645ce
Signed-off-by: William Wu <william.wu@rock-chips.com>
This patch adds a new property "snps,tx-fifo-resize" to
enable resize the TxFIFOs dynamically.
Change-Id: I0714b8a5b3a7f461ae0527c99729db8cf202e066
Signed-off-by: William Wu <william.wu@rock-chips.com>
When we use /sys/class/udc/<udc>/soft_connect to do
a logical disconnection from the USB Host on RK3399
Excavator Board, it dumps the warning log:
Trying to free already-free IRQ 231
WARNING: CPU: 2 PID: 1308 at kernel/irq/manage.c:1628 __free_irq+0xa0/0x2e0
Modules linked in:
CPU: 2 PID: 1308 Comm: adbd Not tainted 4.19.80 #49
Hardware name: Rockchip RK3399 Excavator Board edp avb (Android) (DT)
pstate: 40400085 (nZcv daIf +PAN -UAO)
pc : __free_irq+0xa0/0x2e0
lr : __free_irq+0xa0/0x2e0
...
Call trace:
__free_irq+0xa0/0x2e0
free_irq+0x38/0x90
dwc3_gadget_stop+0x58/0x80
usb_gadget_remove_driver+0x50/0x70
usb_gadget_unregister_driver+0xc0/0x110
unregister_gadget+0x20/0x50
unregister_gadget_item+0x24/0x38
ffs_data_clear+0x120/0x130
ffs_data_reset+0x14/0x50
ffs_data_closed+0x88/0xd8
ffs_epfile_release+0x20/0x30
To solve the problem, don't call free_irq() in
dwc3_gadget_stop() if dwc->gadget_driver is NULL.
Change-Id: I9d5b5b354612c3ce3677b3d15cf6af1fcbf3f399
Signed-off-by: William Wu <william.wu@rock-chips.com>
This patch adds bulk endpoint for uvc to be used as
video streaming transfer. By default, the uvc gadget
still uses isoc endpoint for video streaming.
The important difference between the bulk and isoc
method is that, alt-settings in a video streaming
interface are supported only for isoc endpoints as
there are different alt-settings for zero-bandwidth
and full-bandwidth use-cases, but the same is not
true for bulk endpoints, as they support only a single
alt-setting.
How to use:
1. Enable the bulk transfer:
echo 1 > /config/usb-gadget/g1/functions/uvc.name/streaming_bulk
2. Disable the bulk transfer:
echo 0 > /config/usb-gadget/g1/functions/uvc.name/streaming_bulk
3. Testing the uvc bulk function transfer:
device: run the uvc-gadget program
# uvc-gadget -b -u /dev/video<uvc video node #> -v /dev/video<vivid video node #>
where uvc-gadget is this program:
http://git.ideasonboard.org/uvc-gadget.git
with these patches:
http://www.spinics.net/lists/linux-usb/msg99220.html
Change-Id: Ifedfe3f5c4354dd2bdf07382290107e9bcc89f59
Signed-off-by: William Wu <william.wu@rock-chips.com>
We find that the UAC2 gadget can't be recognized on Windows 10.
It's because that the descriptors of UAC2 doesn't meet the
requirements of Windows.
According to the USB Audio 2.0 Drivers of Windows [1], if the
bmAttributes of OUT-EP in the audio stream interface is set
to asynchronous (use USB_ENDPOINT_SYNC_ASYNC), then a feedback
endpoint must be implemented in the respective alternate setting
of the AS interface. The Windows driver does not support implicit
feedback.
However, it's difficult to implement the feedback endpoint now.
So the patch changes the bmAttributes of OUT-EP to adaptive, and
changes the bmAttributes of IN-EP to synchronous at the same time.
This patch also sets the wTerminalType of terminal descriptor to
microphone and speaker by default.
With this patch, we also fix the wTotalLength of the ac_hdr_desc.
[1] https://docs.microsoft.com/en-us/windows-hardware/drivers/audio/usb-2-0-audio-drivers
Change-Id: I3597d5f321235fcbce56dbfbfe95172d02e58892
Signed-off-by: William Wu <william.wu@rock-chips.com>
Via p_chmask/c_chmask the user can define whether uac2 shall support
playback and/or capture. This has only effect on the created ALSA device,
but not on the USB descriptor. This patch adds playback/capture descriptors
dependent on that parameter.
Change-Id: I396b4238e6a8f2b4a32a57780acea4f23dc0c081
Signed-off-by: Andreas Pape <apape@de.adit-jv.com>
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit 3fa4eaa6c0)
The Seagate Expansion Portable Drive HDD (idVendor=0bc2, idProduct=2321) is reported to fail to work on rockchip platforms
with the following error message when do read/write operation by dd command:
xhci-hcd xhci-hcd.11.auto: Ring expansion failed
According to tkaiser's suggestion[1], we can try to increase the kernel's
coherent-pool memory size to fix this issue. The kernel coherent-pool memory
size was limited at 256KB by default. When set the DEFAULT_DMA_COHERENT_POOL_SIZE
to 1MB, the error "Ring expansion failed" can be fixed, but it still not
work with the other error message:
xhci-hcd xhci-hcd.12.auto: ERROR Unknown event condition 34 for slot 1 ep 3 , HC probably busted
sd 0:0:0:0: [sda] tag#16 uas_eh_abort_handler 0 uas-tag 17 inflight: CMD OUT
...
scsi host0: uas_eh_bus_reset_handler start
xhci-hcd xhci-hcd.12.auto: ERROR Transfer event for disabled endpoint slot 1 ep 6 or incorrect stream ring
Falling back to USB mass storage can solve this problem, so ignore UAS
function of this HDD.
[1] https://forum.armbian.com/topic/4811-uas-mainline-kernel-coherent-pool-memory-size/
Change-Id: I0d817cc3aaea548c2060b323c3077c6cbbd3bb6e
Signed-off-by: William Wu <william.wu@rock-chips.com>
Add compat_ioctl for accessory to work on 64-bit platforms.
Change-Id: I805395c35017111bf0c462847f11765c7088d266
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
This allows 32 bit owners of uvc video to make ioctls
into a 64 bit kernel.
All of the current uvc ioctls can be handled with the
same struct definitions as regular ioctl.
Change-Id: Ia31b26147ab619f0673f94b6662eaf181a9eb5dd
Signed-off-by: William Wu <william.wu@rock-chips.com>
When the combphy work as USB3 PHY (e.g. RK1808 EVB USB3 port),
the PHY init and exit ops are called dynamically in the runtime
process of USB3 controller driver.
Because it only needs to init the USB3 PHY once in the PHY init,
and reinit the USB3 PHY in the runtime process may cause USB3 work
abnormally, so this patch doesn't clear the phy_initialized flag
for USB3 in the PHY exit ops.
Change-Id: Ifc2eb3edac25bd10db6d47b4c9e197cc15c4aef7
Signed-off-by: William Wu <william.wu@rock-chips.com>