The current touch panel driver uses bit 5 in major hardware version to
decide panel used between 800S and 800H.
By setting the bit to 1 means 800S used while to 0 means 800H.
Change-Id: Ibec2678a985b1db385c648884377a7b2ef6df795
Signed-off-by: Jiangen Jiao <jiangenj@codeaurora.org>
pm660_ldo10 supplies power for multiple consumers including UFS.
The load from UFS is invisible for the regulator before the driver
voted it. Any other light load consumers would vote its load and
force the regulator entering into LPM mode which cause OCP triggered.
Add proxy voter for pm660_ldo10 to track this existing UFS load.
Change-Id: I32759025e0349858eaafb6a3b062a6c64314ccfe
Signed-off-by: Yingwei Zhao <cyizhao@codeaurora.org>
Currently the interrupt trigger type is configured as NONE. This
causes a level handler to be assigned to these interrupts.
However, all of them are edge triggered interrupts with varying
falling/rising/both edge flavors. Update the device tree to
use their correct trigger types thereby preventing missed interrupt
storms because of incorrect handler types.
CRs-Fixed: 2005675
Change-Id: Ic50aeecda34d671e84bdfd7868aad050feb2ea3c
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
Make HDMI device as the interrupt parent of CEC device, so add
the new IRQ domain in HDMI driver dealing with the necessary
IRQ mapping.
Change-Id: Id935da1d1e488ccee01b831b9f085a83d67268f2
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
On some ADP board, after writing CCI command to sensor, msm_cci_wait
timeout issue happens sometimes during b2b stress testing.
All the error cases indicate needing 510 msec to get completion from irq,
so change the timeout value from 500 msec to 600 msec.
CRs-fixed: 2052210
Change-Id: Ie70a86de6b2d7eab823ad700be5ee748a3f5e800
Signed-off-by: Andy Sun <bins@codeaurora.org>
Update QoS settings for A508 VBIF based on recommendation.
VBIF_GATE_OFF_WRREQ_EN register needs to be programmed by SW.
Change-Id: I7d41c8350ad09c595f288bd2a2b45fc2abef15f8
Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org>
Without clock-cntl-support setting, some of ispif clocks will be
enabled without set rate.
Have to add clock-cntl-support to let clock-control setting in device
node to take care of which ones should init rate.
Change-Id: I836cf1578f198d7370e347336f334e9929b57994
Signed-off-by: Andy Sun <bins@codeaurora.org>
The digital and analogue voltages could vary on different platforms
and update the same for automotive ADP board.
Change-Id: I2b6874f8bcc5c6e780cece82014a969812b683fa
Signed-off-by: Terence Ho <terenceh@codeaurora.org>
Signed-off-by: Andy Sun <bins@codeaurora.org>
Poll messages that are used to allocate a logical address should
use the same initiator as the destination. Instead, it expected that
the initiator was 0xf which is not according to the standard.
This also had consequences for the message checks in cec_transmit_msg_fh
that incorrectly rejected poll messages with the same initiator and
destination.
Change-Id: I01b5d4fef7caa370b0f4fb154360495a7dce5332
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: 42980da2eb7eb9695d8efc0c0ef145cbbb993b2c
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
Due to an incorrect condition the last_la used for the initial attempt at
claiming a logical address could be wrong.
The last_la wasn't converted to a mask when ANDing with type2mask, so that
test was broken.
Change-Id: I3d0f3f6bea3045808333cfde55ecd677e7799ce2
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: f9f96fc10c09ca16e336854c08bc1563eed97985
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
This race was discovered by running cec-compliance -A with the cec module debug
parameter set to 2: suddenly the test would fail.
It turns out that this happens when the test configures the adapter in
non-blocking mode, then it waits for the CEC_EVENT_STATE_CHANGE event and once
the event is received it unconfigures the adapter.
What happened was that the unconfigure was executed while the configure was
still transmitting the Report Features and Report Physical Address messages.
This messed up the internal state of the cec_adapter.
The fix is to transmit those messages with the adap->lock mutex held (this will
just queue them up in the internal transmit queue, and not actually transmit
anything yet). Only unlock the mutex once everything is done. The main thread
will dequeue the messages from the internal transmit queue and transmit them
one by one, unless an unconfigure was done, and in that case any messages are
just dropped.
Change-Id: I554811aa51e6781e6f9141d59f38d7c540ed5b10
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: f60f35609f89ef4fee73776bc1ef697923251995
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
It's only a small function and this makes it easier to switch to
transmitting the message with adap->lock held in the next patch.
Change-Id: Ic5c134e40abbb7d3b4d008c4dcf703852c2d7b0f
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: d3d64bc7408f1ff0b0ff8354056e2a48eda5886d
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
The fill function just fills in the cec_msg struct, it doesn't transmit
the message. This is now done explicitly.
This makes it possible to switch to transmitting this message with adap->lock
held.
Change-Id: I161f021c2a2959bdafac38f54e5b232ae4e57188
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: 52bc30fda9622f492427d484bd4dd8ee42cc4667
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
The loop that sets the unused logical addresses to INVALID should be
done before 'configured' is set to true. This ensures that cec_log_addrs
is consistent before it will be used.
Change-Id: I90608740aa37869dadcb068c93896be2cb77697e
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: 7af26f889eb67db272021a939f7d4a57e96dd961
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
This is a 2.0 only message, so it should return Feature Abort if the
adapter is configured for CEC version 1.4.
Right now it does nothing, which means that the sender will time out.
Change-Id: I6bdf5e08e075cf071b7f5e0b3996bc111d1f89a7
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: a24f56d47930492c94ef6875bf45adf7607ca1a4
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 pending message was canceled (e.g. due to a timeout), then the
old tx_status info was overwritten instead of ORed. The same happened
with the tx_error_cnt field. So just modify them instead of overwriting
them.
Change-Id: Id1c8a7910e6a9966f8a9ffc679845005f78e0e30
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: 120476123646ba3619c90db7bcbc6f8eea53c990
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
In the (very) small print of the REPORT_CURRENT_LATENCY message there is a
line that says that the last byte of the message (audio out delay) is only
present if the 'audio out compensated' value is 3.
I missed this, and so if this message was sent with a total length of 6 (i.e.
without the audio out delay byte), then it was rejected by the framework
since a minimum length of 7 was expected.
Fix this minimum length check and update the wrappers in cec-funcs.h to do
the right thing based on the message length.
Change-Id: I123cc5fc2b6baca8cb2910bc687489329e81ca73
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: f3854973f196baad5be6b62d8f5ea24b0346b63f
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_allocate_adapter function doesn't need the parent device, only the
cec_register_adapter function needs it.
Drop the cec_devnode parent field, since devnode.dev.parent can be used
instead.
This change makes the framework consistent with other frameworks where the
parent device is not used until the device is registered.
Conflicts:
Documentation/media/kapi/cec-core.rst
drivers/media/i2c/adv7511.c
drivers/media/i2c/adv7604.c
drivers/media/i2c/adv7842.c
drivers/media/platform/vivid/vivid-cec.c
drivers/media/platform/vivid/vivid-cec.h
drivers/media/platform/vivid/vivid-core.c
drivers/media/usb/pulse8-cec/pulse8-cec.c
drivers/staging/media/s5p-cec/s5p_cec.c
drivers/staging/media/st-cec/stih-cec.c
Change-Id: Id7a687308c4d3f2bc63ed2e8a55229b4e71fd8ed
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: f51e80804f084de269954d875c0892b081b7df3c
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
[rayz@codeaurora.org: make some changes to fix the cherry-pick conflicts: (1)
discard the CEC documentation change. (2) discard the CEC adapter driver
changes for other vendors.]
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
Some CEC adapters will receive messages that they initiated. Add a
check that will ignore such messages.
Most hardware behaves correctly in this respect, but I have seen
adapters that don't, so just filter this out in the framework.
Change-Id: I5f5f361ef9135445382764659280583fa1cbe10c
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: 3f98da9636029486b86eb63f0b57b91dcbd880b0
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
Make sure the TX counters are zeroed in the cec_msg struct.
Non-zero TX counters make no sense when a message is received,
and applications should not see non-zero values here.
Change-Id: I36309acfe19b42b672d7b2051adf5cf514123cba
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: 8991a63d1a8a01938932319c8b98f5a3420a0bb2
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
An inner for-loop reused the outer loop variable. This was
only noticeable with CEC adapters supporting more than one
logical address.
Change-Id: Ib5cd7c3130b544a991bbc188a762e330ddee2eba
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: a161bef04286e1344cd469098213a972af8fa7d6
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_FL_REPLY_TO_FOLLOWERS message flag only makes sense for transmitted
messages where you want to wait for the reply.
Clear the flag in all other cases.
Change-Id: Icb52984770fe442416a8e46dff717b0849a7bdb4
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: 7ae2a888eedd5a6b03849614eddd55f31793eeae
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
The last open issues have been addressed, so it is time to move
this out of staging and into the mainline and to move the public
cec headers to include/uapi/linux.
Conflicts:
Documentation/media/Makefile
drivers/media/i2c/Kconfig
drivers/media/platform/vivid/Kconfig
drivers/staging/media/Makefile
drivers/staging/media/pulse8-cec/Kconfig
drivers/staging/media/s5p-cec/Kconfig
drivers/staging/media/st-cec/Kconfig
Change-Id: Ie46e780a7d29d773dbb9bd642059695eb580e8ad
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: 0dbacebede1e4e44bf500f94d692fad05eb2c293
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
[rayz@codeaurora.org: make some modifications to the original patch to fix
the cherry-pick conflicts. (1) discard the changes in Documentation. (2)
discard the CEC adapter driver changes for other vendors because they are
not needed.]
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
CDC-Only CEC devices are CEC devices that can only handle CDC messages,
all other messages are ignored.
Add a flag to signal that this is a CDC-Only device and act accordingly.
Also add helper functions to identify if a CEC device is configured as a
CDC-Only device, a second TV, a switch or a processor, since these variations
cannot be determined by the logical address alone.
Change-Id: I9b814a5da3bca913d784bfe5fc508cdf06a5fea4
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: a69a168a1bd470cb8a8c5f2ff4b54463de615226
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_INITIATE_ARC message is special since it is the ONLY
CEC message that accepts two possible valid replies:
CEC_MSG_REPORT_ARC_INITIATED and CEC_MSG_REPORT_ARC_TERMINATED.
So if the transmitted message is CEC_MSG_INITIATE_ARC and the remote
side replied with CEC_MSG_REPORT_ARC_INITIATED or CEC_MSG_REPORT_ARC_TERMINATED,
then a msg->reply value of CEC_MSG_REPORT_ARC_INITIATED or
CEC_MSG_REPORT_ARC_TERMINATED will match either reply.
I thought about either adding a second reply2 field, but that's ugly
for all other messages that have only one reply, and what if in the
future a new message is added that can have three replies?
Another option would be to add a cec_msg flag, but really, the combination
of CEC_MSG_REPORT_ARC_INITIATED and a reply value of one of the two
possible replies already functions as a flag.
Another advantage of this approach is that it is safe to re-use a
cec_msg struct. No need to zero a flags field or a reply2 field.
So since this really is an exception in the CEC specification, I
decided to implement it as an exception as well.
Change-Id: I844a263703d2d2e56dd1922579910ba35c2d70bf
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: f5580d8d6fd07a569e468fca51f435aa5b122fc4
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
[rayz@codeaurora.org: remove documents in the original patch to fix conflicts]
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
As per the CEC specification:
- CEC messages with a too-small payload should be ignored.
- Broadcast messages that are only allowed as directed messages
should be ignored.
- Directed messages that are only allowed as broadcast messages
should be ignored.
Implement this in the core CEC framework.
Change-Id: Ia4507d7bded5857fa0c110bca64349cf5955f8bb
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: 3074fe4a7da5775bcf31675d6d9e2687c434fef2
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
Give the caller more control over how replies to a transmit are
handled. By default the reply will only go to the filehandle that
called CEC_TRANSMIT. If this new flag is set, then the reply will
also go to all followers.
Change-Id: I3464ff0980bf5625ebd869eeeafced07c760f741
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: adc0c622783978ab0c740af77f98fc8f65c87d66
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
[rayz@codeaurora.org: remove documents in the original patch to fix conflicts]
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
By default the CEC_MSG_USER_CONTROL_PRESSED/RELEASED messages
are passed on to the follower(s) only. If the new
CEC_LOG_ADDRS_FL_ALLOW_RC_PASSTHRU flag is set in the
flags field of struct cec_log_addrs then these messages are also
passed on to the remote control input subsystem and they will appear
as keystrokes.
This used to be the default behavior, but now you have to explicitly
enable it. This is done to force the caller to think about possible
security issues (e.g. if these messages are used to enter passwords).
Change-Id: I349b67e4456cefa604c58c3cb2d94f004d206e00
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: f4062625ede8f0280d8246437f4070c8eb7fe9f3
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
[rayz@codeaurora.org: remove documents in the original patch to fix conflicts]
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
MEDIA_CEC is no longer a tristate option, so the user can't actually
choose M. Whether the code is built-in or built as a module is
decided somewhere else.
Fixes: 5bb2399a4fe4 ("[media] cec: fix Kconfig dependency problems")
Change-Id: Ib996ee20c4063e01658fc8f842319bb703d855db
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: 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: a58d1191ca04ffa8b14dcda5df0c87a2a642d3c7
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
Don't return the confusing -EIO error code when the device is not registered,
instead return -ENODEV which is the proper thing to do in this situation.
Change-Id: Iaf12028cfe4d8b58d4fb09ff06ce680769188d16
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: 60815d4a78204915f5cdf79a536bc96d5d23ae5f
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
If the adapter is configured as 'Unregistered', then cec_receive_notify
incorrectly thinks that broadcast messages are directed messages. The
destination for broadcast messages is 0xf, and the logical address
assigned to Unregistered devices is also 0xf and the logic didn't handle
that correctly.
Change-Id: Idaedf31ec471b5d4bbc982b714e1c08e4935ec6c
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: a179b69359feb26ddb148bb6a2c0c53a8d1dc5be
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>