Commit Graph

19 Commits

Author SHA1 Message Date
raghavendra ambadas 121fb2acfb msm: mhl: sii8334: Add mutex lock to avoid race condition
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>
2014-09-18 13:31:19 +05:30
Ajay Singh Parmar 5a9c62f814 mhl: sii8334: Proper header file inclusion
Include proper header files for sleep and OF APIs

Change-Id: I710ae1bb5148f713b874c0d77c31f8ccf8514bdf
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2014-02-17 18:06:58 +05:30
Ajay Singh Parmar 956b33bb22 msm: mhl: sii8334: handle MHL discovery failure cases
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>
2014-01-08 12:27:12 -08:00
Manoj Rao f14dc8391c msm8974: mhl_sii8334: init chip on discovery
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>
2013-09-04 17:22:22 -07:00
Ajay Singh Parmar dee6e29312 msm8974: mhl: Add support for sinks with non std DCAP INT STAT
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>
2013-09-04 17:14:25 -07:00
Abhishek Kharbanda 57e97fc584 msm8974: mhl: set hpd, tmds based on path_en bit
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>
2013-09-04 17:13:40 -07:00
Jack Pham d064b41719 usb: dwc3-msm: remove use of global context variable (MHL)
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>
2013-09-04 17:09:31 -07:00
Manoj Rao 3ed5be6d95 msm8974: mhl_sii8334: disable intrs in low-pwr
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>
2013-09-04 16:47:15 -07:00
Mukesh Jha 563702992a mdss: mhl: Fix MHL peer status register handling.
Fix handling of MHL peer device status registers for MHL
Compliance case 3.1.1.13.

Change-Id: I404f44d635ad9d3571d5b54bd9c161846c775838
Signed-off-by: Abhishek Kharbanda <akharban@codeaurora.org>
Signed-off-by: Mukesh Jha <cmjha@codeaurora.org>
2013-09-04 16:39:17 -07:00
Manoj Rao 68ae8a72dd msm8974: mhl_sii8334: power down in D3
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>
2013-09-04 16:29:46 -07:00
Manoj Rao 4ac6fd1654 msm: mhl: wait for scrpd write permission
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>
2013-09-04 16:13:09 -07:00
Manoj Rao 005b96a0d8 msm: mhl: hdmi: MHL-HDMI handshake implementation
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>
2013-09-04 16:01:44 -07:00
Manoj Rao fa2500d5a3 msm: 8974: MHL Scratchpad interface implementation
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>
2013-09-04 15:53:39 -07:00
Manoj Rao 5f9ba939bd msm: 8974: MHL MSC/RCP/RAP feature implementation
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>
2013-09-04 15:48:03 -07:00
Manoj Rao 2f6991d113 msm: 8974: MHL-USB handshake API implementation
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>
2013-09-04 15:45:06 -07:00
Manoj Rao 7978105320 msm: 8974: MHL Driver for SI-8334 Tx
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>
2013-09-04 15:37:20 -07:00
Manoj Rao 368bef806c msm_fb: MHL: MSC cmd schedule to prevent overload
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>
2013-09-04 15:14:09 -07:00
Manoj Rao 845ff91e50 msm_fb: MHL: MSC, RCP/RAP feature implementation
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>
2013-09-04 15:14:08 -07:00
Abhishek Kharbanda ad94068423 msm_fb: MHL: Adding MHL api's for USB interaction.
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>
2013-09-04 15:02:34 -07:00