Add mutex lock betweeen mhl_sii_config and mhl_sii_device_discovery
functions to avoid accesing the variable flag before it is updated.
This will avoid accessing the mhl init settings i2c register
before turning on the mhl regulator's and gpio's.
Change-Id: If3f7fbe3d6ab84f101c407c43ac8b410e6df38fe
Signed-off-by: Raghavendra Ambadas <rambad@codeaurora.org>
Include proper header files for sleep and OF APIs
Change-Id: I710ae1bb5148f713b874c0d77c31f8ccf8514bdf
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Reset mhl mode on disconnect and suspend to avoid discovery wait
timeout in case connect interrupt is received before start of wait.
Free IRQ on suspend and reconfigure in discovery to avoid unnecessary
wakups and suspends during PM shutdown.
Notify USB in case discovery is failed and on suspend to take over
the control.
CRs-Fixed: 579997
Change-Id: If0747b067d53563c3eb380e80be1254d38b140d6
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
MHL driver initializes the chip in probe and enables
irq. These operations are postponed until they're
required. This prevents any interrupts from
being triggered even when there is no real
communication from hardware. Do not enable
irq wake in suspend before the first discovery
has completed. This ensures wake irq occurs only on
an irq that has been previously allocated.
CRs-Fixed: 509337
Change-Id: Ifa5c66cfe2fb732d2f8e34b7473ab9ae07937dc7
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
This change enables pass-through of TMDS signals through
MHL Tx for sinks that have non-standard DCAP INT STAT SIZE
in the devcap bytes. This facilitates MHL display on certain
non-standard MHL sinks.
CRs-Fixed: 504730
Change-Id: Id847cd25642e9eac8d559cc5dd3e1ab1046ebcce
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Set HPD and TMDS pass-through only after receiving
PATH_EN from the sink and reading all device
capability bytes from the sink.
Making MHL wait until the PATH_EN bit has been set by the
sink/dongle is in conformance with the MHL spec.
This change prevents incorrect behavior in usecases
such as meeting timing requirements in test 1A-02 HDCP
compliance test suite, disabling hpd when TV is powered off
with MHL cable connected to the TX.
CRs-Fixed: 504737
CRs-Fixed: 481930
Change-Id: Id2c1fb9d2dbe10b1310958021cca3533790e7394
Signed-off-by: Abhishek Kharbanda <akharban@codeaurora.org>
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
Remove usage of the global context variable in the MHL functions by
adding an additional parameter to the callback function signature.
This will allow the driver to eventually support multiple instances.
Change-Id: I9e01838f6c0d51b5cd210e46d151b2ed9179d087
Signed-off-by: Jack Pham <jackp@codeaurora.org>
Set appropriate interrupt mask to disable interrupts
in low power to prevent possible interrupt triggers
in low power mode. Enable interrupts appropriately when
chipset is brought out of low power state.
Change-Id: I267c41fd953e8afde3f157ee58228f26ee1ac20d
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
MHL Tx chipset should be set to low power
when switching to D3 mode. Set the appropriate
register in PAGE1 of 8334 to put the chip in
low power mode. In open-drain mode, mhl tx
releases the upstream HPD line which can trigger
unnecessary interrupts in HDMI Tx. Disable HPD
in D3 mode and enable it back on RGND interrupt.
Change-Id: Ibe3e699a5f1ae0c0cfc2d196eb7fd5b8e2ef60b5
CRs-Fixed: 459094
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
Busy flag needs to be reset appropriately for the
subsequent scratchpad write burst operations to
be carried out without using stale value of
this flag. Clear busy flag while the scratchpad is not
running the burst write operation and
indicate when MHL peer grants write permission
onto its scratchpad or retry request permission
before indicating timeout.
Change-Id: Idda463077636b603b8620f620d8e074a6b8cd709
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
By default, HDMI driver adds entries for
all the formats that it supports into an internal table.
However, when MHL Tx is present, the max format
supported should be limited based on the maximum bandwidth
supported by the MHL Tx. We implement a handshake between
HDMI and MHL drivers to exchange callback function which
returns the status of HDMI's TMDS lines that is used by MHL
driver before sending RAP messages.
Change-Id: I53b6541307f54309fd53f0062d9be3ef1e15c495
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
MHL Scratchpad provides an interface for
the MHL peer devices to communicate with each other
Each device shall provide a sixteen
byte writeable memory space to its peer.
This change implements the scratchpad read and write
interfaces for MHL Tx chipset.
Change-Id: Ifaaa2e799424514ec68c8e4c7434f95a68261fe1
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
MHL implementation in 8974 for handling CBUS interrupts to
enable and handle MSC translation control packets.
This change also includes implementation of RCP/RAP
protocols by registering MHL driver as input device
and building key code mapping.
Change-Id: I73e399bbbf9b2f53974225aaa8697fce2057d017
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
This change adds the implementation of mhl discovery
detection procedure, USB hand-off function. Three APIs
are exposed from MHL driver to USB driver: for
register/unregistering callbacks from USB and triggering
device discovery detection in MHL hardware. By default, all
the USB interrupts are directed to the USB hardware which is
detected by USB driver and at appropriate points the USB
driver triggers the MHL device discovery and uses the results
to either hand control to MHL driver or continue with it's own
detection mechanism.
Change-Id: Ic1e22bc4c446de209f2e72d5dda8b823bfd398c8
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
The B-family device driver for SI8334 Silicon Image's
Mobile High-definition Link (MHL) Transmitter implements
wake-up, discovery and communication with MHL sink.
The MHL-8334 Tx is attached to MSM as an I2C-client.
Change-Id: I33f6c6f00011b590f9913cdbbe44544472b60982
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
MSC commands to be sent over the CBUS line need to
be scheduled appropriately from the ISR. Reduce delay
in any processing within the ISR. Schedule each command over
a queue and handle them with a worker thread.
Change-Id: I6cbde8ce9e4f8c69b7f0a40bcf12c5d3930d0b8b
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
MHL implementation of handling CBUS interrupts to
enable and handle MSC translation control packets.
This change also includes implementation of RCP/RAP
protocols with place holders in MHL driver.
Change-Id: Icfc31ee1cf71a57cb9b3733d068ea4478b6c4e90
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
Signed-off-by: Abhishek Kharbanda <akharban@codeaurora.org>
Adding MHL api's for device discovery and registering
callback mechanism.USB driver use these API's for
synchronization with MHL driver.
Change-Id: I0846951302e3b5f5d20d566c92c2f224528ca455
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
Signed-off-by: Abhishek Kharbanda <akharban@codeaurora.org>