Before transmitting a message clear all status fields and always fill
in the sequence number. Make sure the sequence number is never 0.
Change-Id: Ia8ad9b79935cad0e88371f00137a59326a336ffc
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: 40df3a7e586df59190547fe0e7d9928da735eada
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
When CEC_RECEIVE returns a message the original timeout field
was overwritten. Restore the timeout field.
Change-Id: Ida65e37e1424745e3e4cf9d0108e10dc75e642ed
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: e883b4d02670ae83ab24e9af969de1af756959f8
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
The CEC documentation has been converted to sphinx, so this
TODO item can be dropped.
Change-Id: I7a0fa38382a5533fd9e3643613d63595881b2b78
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: bddb4952506d0e84c443a04840143ea98b610557
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
Attempts to send CEC messages to yourself are detected in the framework and
returned with a NACK error. However, the tx_ts was never filled in that case.
So just set it.
Change-Id: Ifd8be78030778d3d99b88b353905879c2079c2c5
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: 9a3f14ea802fd0d8848d8e16566b769e4ce09d68
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
There is really no reason to zero the reply and timeout fields if an
error occurs. This is a left-over from earlier versions where that
was used to signal errors, but this is now handled by the rx/tx_status
fields.
Change-Id: I2064f6b2dcb3affe4097ebdf7270eb8c6bc7e21d
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: 86e3577f11d0aa8a5d3c6199f9e3f23cdbd0c0ac
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
When transmitting a message and waiting for a reply it would be good
to know the time between when the message was transmitted and when
the reply arrived. With only one timestamp field it was set to when
the reply arrived and the original transmit time was overwritten.
Just taking the timestamp in userspace right before CEC_TRANSMIT is
called is not reliable, since the actual transmit can be delayed if
the CEC bus is busy. Only the driver can fill this in accurately.
So split up the ts field into an rx_ts and a tx_ts. Also move the
status fields to after the 'reply' field: they were placed in a
strange position and make much more sense when grouped with the
other status-related fields.
This patch also makes sure that the timestamp is taken as soon as
possible.
Change-Id: I643006cc32cbc6073b6ce8fa7ae03b63b3b0e266
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: 980e0b36b55985dd0a37acd25d29c8f21482db32
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
Check (and warn) if the msg->len is too long or if it is 0.
Should never happen, but just in case...
Change-Id: I784aca0acdc74511b42b51ae01e57be0c04799b1
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: 52d802d65b56a399aa67a9d3f26f232116d3e256
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
When the device is in monitor mode, then you should always be able to
call CEC_RECEIVE, even it the device is unconfigured.
Change-Id: I1d11a8cbb26d19197b7f3a4a77ed8d6ce00f1853
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: ca00033c9fc8b5f178573a76887c89296ed5b398
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
CEC USB dongles can be unplugged at any time, and at that point they will
be unregistered. Make sure that any attempt afterwards to set the physical
or logical addresses will be ignored.
Change-Id: If15d1e3f3447c6a844eaee27cfdfd65a3341062e
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: c000e5dad17d20c644bbf3ead52c334025d11ada
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
The cec_msg_request_short_audio_descriptor function was missing the reply
argument. That's needed if you want the framework to wait for the reply
message.
Change-Id: Id099aa3ec932beb7d49af56cd9f761ee66b2727e
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: 9ad52b4db79d168867a2ca105eca00fb9cb28fe5
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
The cec_ops_* functions never touch cec_msg, so mark it as const.
This was done for some of the cec_ops_ functions, but not all.
Change-Id: Ibf4c85faac86588e937107bd1bc7648841060bab
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: 0c1f8569942695b7a2735301efe45ecd69e2a41f
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
- Use IS_REACHABLE(RC_CORE) instead of IS_ENABLED: if cec is built-in and
RC_CORE is a module, then CEC can't reach the RC symbols.
- Both cec and cec-edid should be bool and use the same build 'mode' as
MEDIA_SUPPORT (just as is done for the media controller code).
- Add a note to staging that this should be changed once the cec framework
is moved out of staging.
Change-Id: If084eab2c2bbca7b9fa5b8959b27b1894b8ec2b7
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: 5bb2399a4fe4a1703c1497b4838c5e8e869d0822
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
The MEDIA_CEC_EDID option is guarded by MEDIA_SUPPORT, so selecting
it from MEDIA_CEC produces a warning:
warning: (MEDIA_CEC) selects MEDIA_CEC_EDID which has unmet direct dependencies (MEDIA_SUPPORT)
The warning is harmless, but it's better to add an explicit
dependency to shut it up, to reduce the noise during randconfig
builds.
Fixes: ca684386e6e2 ("[media] cec: add HDMI CEC framework (api)")
Change-Id: I637ceabfcc8f311f8ca723671f954e1db060c965
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: ea8c535e30c1066a0bf8acb2d39bb3c4e643a034
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
CEC_MSG_REPORT_PHYSICAL_ADDR can theoretically be received from
an unregistered device, but in that case the code should not attempt
to write the received physical address to the phys_addrs array.
That would be pointless since there can be multiple unregistered
devices that report a physical address. We just ignore those.
While at it, improve the dprintk since it would attempt to read
from that array as well with the same out-of-bounds problem.
Change-Id: Ic4e969669cadd3e9f59a587d7d075e130f5cd869
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: f8db65fe4336baf818dde5d226eb3d35773e2371
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
Like the videodev2.h and other headers, explicitly allow these headers
to be used with the BSD license.
Change-Id: I8f9ae52ed90337ca1f697dbf310a774f50eb154d
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: 12655445a2adc292db3352bbe80e43bd243517aa
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
When a reply to an earlier transmit is received, the tx_status of that
transmit needs to be restored. Otherwise the status that the transmit
was successful would be lost.
Change-Id: I53fac6d2346a88a8f93503952bd9e2c3c9bae5e6
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: 7b12b47f78e458ea90cc350bc7a4b9385eef897a
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
The added HDMI CEC framework provides a generic kernel interface for
HDMI CEC devices.
Note that the CEC framework is added to staging/media and that the
cec.h and cec-funcs.h headers are not exported yet. While the kABI
is mature, I would prefer to allow the uABI some more time before
it is mainlined in case it needs more tweaks.
This adds the cec-api.c source that deals with the public CEC API
and the Kconfig/Makefile plumbing.
The MAINTAINERS file is also updated.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
[k.debski@samsung.com: code cleanup and fixes]
Signed-off-by: Kamil Debski <kamil@wypas.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: ca684386e6e21ba1511061f71577cdb6c3f2b3d3
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Change-Id: Ie0ac63f18e51cab0e920f9c6c618563faf57a83c
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
Specify short circuit (SC) interrupts for LAB/IBB so that the driver can
attempt re-enabling the module after PBS disables it for SC protection.
Interrupts are disabled by the driver if SC happens frequently so that
the module is kept disabled.
CRs-Fixed: 2002373
Change-Id: Idb6fdc4845aebb7133c210dd03ff77a167de5d69
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
Free already allocated buffer before allocating new one
to avoid memory leak when someone keep writing to this file
but never read it.
CRs-Fixed: 2051862
Change-Id: I29784fb30ea8eed315b7d073d35480972642bc55
Signed-off-by: Yuanyuan Liu <yuanliu@codeaurora.org>
Other than stats every debugfs entry should be under
CONFIG_ICNSS_DEBUG so that we don't enable these on
build which doesn't have debugging support.
CRs-Fixed: 2051871
Change-Id: I336f449313bb1f0f8af4e82f40869f65f58d9f4e
Signed-off-by: Yuanyuan Liu <yuanliu@codeaurora.org>
Currently vconn is getting disabled late after disabling vbus.
This is causing failure if type-C compliance TD.4.8.3(DRP Connect
Alternate Mode), as delay is disabling vconn goes above 35ms.
Fix the issue by moving vconn disable as first step upon receiving
disconnect notification. Also, making policy engine workqueue as high
priority workqueue to be able to run state machine work with lower
latency.
Change-Id: If9a979b4cc5bab3aa2ebf42397c36e5b434b50b9
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Change debugfs permission to allow root only access to those files.
CRs-Fixed: 2051867
Change-Id: I4bef907f8cbe39169b38e4f19072a0628e199691
Signed-off-by: Yuanyuan Liu <yuanliu@codeaurora.org>
Fix a potential buffer overflow that could occur
during firmware download by storing buffer address
locally instead of inside MHI context.
CRs-Fixed: 1109397
Change-Id: If27ba602cdafdc8d25a94fdc0d74e8970bf0b0f4
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
Hardened user copy provides an extra layer of security checks when
copy_to_user/copy_from_user APIs are used to ensure data accesses are
valid. When invalid accesses are detected the kernel will forcibly
crash.
Change-Id: Ia0529c67da84017ea91a72427db008737d3c5dbd
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
In transcode loopback session open, ALSA to ASM format conversion is
incorrect. Update the format based on ASM defined formats.
CRs-Fixed: 2049714
Change-Id: Ie5ddb6a58a30b0d6b78bfc68cbbbcd3d92f28fb1
Signed-off-by: Siddartha Shaik <sshaik@codeaurora.org>
Set voc path type according to stream type during routing
preparation for voice session to fix uninitialized voc
path type causing voc device port configuration failure.
CRs-fixed: 2045461
Change-Id: I4983ba55b1854879680b6d13c33904a522092eb0
Signed-off-by: Derek Chen <chenche@codeaurora.org>
There is a design limitation in host driver. Driver
sends regulatory_hint_user for both user-space and
11d country to kernel. So when wiphy re-registration
happens, kernel tells the source as USER even for 11d.
And per driver logic the 11d needs to be disabled
if INI gCountryCodePriority is set.
To mitigate this issue, storing the country source
in the platform driver.
CRs-Fixed: 2051651
Change-Id: I335a046a886ac3ce35cf96eb71231bfe75d33c60
Signed-off-by: Paul Zhang <paulz@codeaurora.org>
In 32 bit system mapping len should be 128M aligned.
Change-Id: I41550e65ebd6c4cde7a4c5f7144ce57b7b8cdb91
Signed-off-by: Trishansh Bhardwaj <tbhardwa@codeaurora.org>
UHS-I SD cards support SDR104 mode which runs the SD card interface
clock upto 208 MHz. But we may see repeated CRC errors in SDR104
with some SDCC controllers. If this happens, commit <aafc430b36f3>
("mmc: sd: reduce the bus speed in case of multiple CRC errors") would
reinit the card to lower speed (SDR50) hoping that CRC error
rate would reduce at lower clock speed (100MHz for SDR50). As the error
may happen for any cmd, this change tries to fix several other paths -
clock scaling, mmc_rescan, non-data commands error path.
Change-Id: I8ccbbf7e330cde3862d9660d3be4d67fb00d97ca
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
This reverts commit e6855ed3fe ("arm: cpu: read all
address cells in dt for cpuid"). The address cells read
issue is fixed in upstream commit c84cc7b906 ("ARM:
8616/1: dt: Respect property size when parsing CPUs"),
and both changes conflict and break the parsing of address
cells.
Change-Id: Iafd918ce8623ceb0c701df15bbdbccba165c89dd
Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>
Add support for required node for audio of HDK660/630 boards
with tasha codec.
Change-Id: I1b5acb70d4fb8e8e4958ffafb2b83c16df1d933c
CRs-Fixed: 2047107
Signed-off-by: Walter Yang <yandongy@codeaurora.org>
Before clock enable, should always set rate firstly for safety,
in case the value after get rate changes.
Change-Id: I6985d9ab413012e988434ee3a8ea78b0beb803d2
Signed-off-by: Andy Sun <bins@codeaurora.org>
Currently unmap of buffers is done in destroy.
But we need to unmap buffers before we detach.
Change-Id: I46fc31c688f7024a0fe772048b3a0da820369273
Signed-off-by: Shilpa Mamidi <shilpam@codeaurora.org>
Currently PM QoS is not getting notifications if irq affinity
is changed by core isolation with irq_do_set_affinity.
Use irq_set_affinity_locked instead to get notifications when
updating affinity.
Change-Id: Iab745a23637d9353f730ca77ac7e92cf61b1bf67
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
ICL recovery mechanism is used by user space daemon
to recover from adapter collapse during voltage increment
event by reducing the USB ICL. There could be a situation
where nobody votes on usb_icl_votable and this could lead
to a negative ICL value.
Fix this by reading "HW_CURRENT_MAX" property to get ICL in
situations where usb_icl_votable is not voted by any client,
this ensures ICL reduction will always vote a valid ICL.
CRs-Fixed: 2048330
Change-Id: I8e53a945530c1685aaaba0537d16ac5fb11858df
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
Current AICL re-run design for PM660 uses AICL restart mechanism
which starts AICL algorithm from Min ICL value to the configure ICL
value one step (25mA) at a time, this adds considerable amount of
delay for algorithm to reach a settled ICL value. Fix this by using
PMI8998 based AICL re-run design.
Change-Id: I84f612c275fa0d9785a6688a56c9da90df1b86d4
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
Regulator enable and disable of CSIPHY depends on the CSID module.
Make the enable and disable of clk regulator independent of CSIPHY.
Change-Id: Id635b0dfd04a79bac580689a0da8592c6ff87661
CRs-Fixed: 1107702
Signed-off-by: Terence Ho <terenceh@codeaurora.org>
Signed-off-by: Andy Sun <bins@codeaurora.org>
Define ops_keep_radio_on_during_sleep as static as it is used
only in msm_11ad context.
Change-Id: Id95579961ce5cdd3fbdf063578bd4d9144f8a725
Signed-off-by: Maya Erez <merez@codeaurora.org>
Low latency use cases are failing because glink RX thread to handle
the TX Done command is not being scheduled during high system load.
These new APIs allow clients to specify if they need the RX glink
thread to be Realtime
CRs-Fixed: 2050701
Change-Id: I6bd4023394e9ee617797826687f34abaee3fe65d
Signed-off-by: Chris Lew <clew@codeaurora.org>
When pixel transfer is going on, there is a race condition during
which pixel clock can get turned off due to early clock gating
before CMD_MDP interrupt is triggered which can cause interrupt
storm. This change ensures CMD_MDP interrupt is received before
turning off clocks.
Change-Id: I33b664334912584170c12733329051b067c3f1da
Signed-off-by: Ashish Garg <ashigarg@codeaurora.org>
There is ref count mismatch in number of enable/disable calls for
regulators with low power mode allowed flag which is resulting in
random system crashes. This change makes sure number of enable/disable
calls are same.
Change-Id: I0c1906df8c3a83e8740412c272179d3d9c514c0e
Signed-off-by: Rashi Bindra <rbindra@codeaurora.org>
Configure quat mi2s in slave mode. Create quat mi2s node and
add the pincontrols to be used for data lines.
Change-Id: Ib0a06389941f09014c0f872d3643251859eb6a6b
Signed-off-by: Varun Balaraj <varunb@codeaurora.org>
keep_radio_on_during_sleep allows reserving the 11AD connections
during suspend.
In such a case PCIe will suspend to D3hot and the device power
will not be turned off.
Change-Id: I04eed7802256c48ef9f39e7dc4e3b1a5386eb3c7
Signed-off-by: Maya Erez <merez@codeaurora.org>
Return mementry from kgsl_sharedmem_find only if pending_free
is not set for that mementry. This is necessary to avoid use
of a mementry after it is already marked for free.
Change-Id: I23111e9c82a88ccbda2ab259074c38d91f9ff5cb
Signed-off-by: Deepak Kumar <dkumar@codeaurora.org>
PBS will be triggered in PMIC hardware to disable LAB/IBB regulators
when a SC(short circuit) error is happened. The regulators won't be
restart in hardware and they will be kept disabled always after that.
Restart LAB/IBB regulator in the software if SC IRQ is detected, but
stop doing this if the SC IRQ had fired frequently.
CRs-Fixed: 2002373
Change-Id: I5db2b70999d043395e070bc9d61015477455cce9
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
Changing REFGEN for DPHY CLK/DATA to internal bias as suggested
by hardware team for a rarely seen line noise issue on msm8998
platform.
CRs-Fixed: 2037215
Change-Id: I37a40db8b3d2abba934c049f8ab49e0b977877f2
Signed-off-by: Tanvi Aggarwal <tanvia@codeaurora.org>