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> [cip@codeaurora.org: Moved mhl_sii8334.c file location] Signed-off-by: Clarence Ip <cip@codeaurora.org>
This commit is contained in:
parent
f7a7d9e6f4
commit
56f340e5b5
6 changed files with 1284 additions and 0 deletions
26
Documentation/devicetree/bindings/i2c/sii8334-i2c.txt
Normal file
26
Documentation/devicetree/bindings/i2c/sii8334-i2c.txt
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
* Silicon Image-8334 MHL Tx
|
||||||
|
|
||||||
|
Required properties:
|
||||||
|
- compatible: must be "qcom,mhl-sii8334"
|
||||||
|
- reg: i2c slave address
|
||||||
|
- mhl-intr-gpio: MHL interrupt gpio coming out of sii8334
|
||||||
|
- mhl-pwr-gpio: MHL power gpio required for power rails
|
||||||
|
- mhl-rst-gpio: MHL reset gpio going into sii8334 for toggling reset pin
|
||||||
|
- <supply-name>-supply: phandle to the regulator device tree node.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
i2c@f9967000 {
|
||||||
|
sii8334@72 {
|
||||||
|
compatible = "qcom,mhl-sii8334";
|
||||||
|
reg = <0x72>;
|
||||||
|
interrupt-parent = <&msmgpio>;
|
||||||
|
interrupts = <82 0x8>;
|
||||||
|
mhl-intr-gpio = <&msmgpio 82 0>;
|
||||||
|
mhl-pwr-gpio = <&msmgpio 12 0>;
|
||||||
|
mhl-rst-gpio = <&pm8941_mpps 8 0>;
|
||||||
|
avcc_18-supply = <&pm8941_l24>;
|
||||||
|
avcc_12-supply = <&pm8941_l2>;
|
||||||
|
smps3a-supply = <&pm8941_s3>;
|
||||||
|
vdda-supply = <&pm8941_l12>;
|
||||||
|
};
|
||||||
|
};
|
|
@ -947,4 +947,13 @@ config FB_MSM_MDSS_HDMI_PANEL
|
||||||
The MDSS HDMI Panel provides support for transmitting TMDS signals of
|
The MDSS HDMI Panel provides support for transmitting TMDS signals of
|
||||||
MDSS frame buffer data to connected hdmi compliant TVs, monitors etc.
|
MDSS frame buffer data to connected hdmi compliant TVs, monitors etc.
|
||||||
|
|
||||||
|
config FB_MSM_MDSS_HDMI_MHL_8334
|
||||||
|
depends on FB_MSM_MDSS_HDMI_PANEL
|
||||||
|
bool 'MHL SII8334 support '
|
||||||
|
default n
|
||||||
|
---help---
|
||||||
|
Support the HDMI to MHL conversion.
|
||||||
|
MHL (Mobile High-Definition Link) technology
|
||||||
|
uses USB connector to output HDMI content
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -18,5 +18,6 @@ obj-$(CONFIG_FB_MSM_MDSS) += mdss_io_util.o
|
||||||
obj-$(CONFIG_FB_MSM_MDSS_HDMI_PANEL) += mdss_hdmi_tx.o
|
obj-$(CONFIG_FB_MSM_MDSS_HDMI_PANEL) += mdss_hdmi_tx.o
|
||||||
obj-$(CONFIG_FB_MSM_MDSS_HDMI_PANEL) += mdss_hdmi_util.o
|
obj-$(CONFIG_FB_MSM_MDSS_HDMI_PANEL) += mdss_hdmi_util.o
|
||||||
obj-$(CONFIG_FB_MSM_MDSS_HDMI_PANEL) += mdss_hdmi_edid.o
|
obj-$(CONFIG_FB_MSM_MDSS_HDMI_PANEL) += mdss_hdmi_edid.o
|
||||||
|
obj-$(CONFIG_FB_MSM_MDSS_HDMI_MHL_8334) += mhl_sii8334.o
|
||||||
|
|
||||||
obj-$(CONFIG_FB_MSM_MDSS_WRITEBACK) += mdss_wb.o
|
obj-$(CONFIG_FB_MSM_MDSS_WRITEBACK) += mdss_wb.o
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include <linux/regulator/consumer.h>
|
#include <linux/regulator/consumer.h>
|
||||||
#include "mdss_io_util.h"
|
#include "mdss_io_util.h"
|
||||||
|
|
||||||
|
#define MAX_I2C_CMDS 16
|
||||||
void dss_reg_w(struct dss_io_data *io, u32 offset, u32 value, u32 debug)
|
void dss_reg_w(struct dss_io_data *io, u32 offset, u32 value, u32 debug)
|
||||||
{
|
{
|
||||||
u32 in_val;
|
u32 in_val;
|
||||||
|
@ -383,3 +384,59 @@ int msm_dss_enable_clk(struct dss_clk *clk_arry, int num_clk, int enable)
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
} /* msm_dss_enable_clk */
|
} /* msm_dss_enable_clk */
|
||||||
|
|
||||||
|
|
||||||
|
int mdss_i2c_byte_read(struct i2c_client *client, uint8_t slave_addr,
|
||||||
|
uint8_t reg_offset, uint8_t *read_buf)
|
||||||
|
{
|
||||||
|
struct i2c_msg msgs[2];
|
||||||
|
int ret = -1;
|
||||||
|
|
||||||
|
pr_debug("%s: reading from slave_addr=[%x] and offset=[%x]\n",
|
||||||
|
__func__, slave_addr, reg_offset);
|
||||||
|
|
||||||
|
msgs[0].addr = slave_addr >> 1;
|
||||||
|
msgs[0].flags = 0;
|
||||||
|
msgs[0].buf = ®_offset;
|
||||||
|
msgs[0].len = 1;
|
||||||
|
|
||||||
|
msgs[1].addr = slave_addr >> 1;
|
||||||
|
msgs[1].flags = I2C_M_RD;
|
||||||
|
msgs[1].buf = read_buf;
|
||||||
|
msgs[1].len = 1;
|
||||||
|
|
||||||
|
ret = i2c_transfer(client->adapter, msgs, 2);
|
||||||
|
if (ret < 1) {
|
||||||
|
pr_err("%s: I2C READ FAILED=[%d]\n", __func__, ret);
|
||||||
|
return -EACCES;
|
||||||
|
}
|
||||||
|
pr_debug("%s: i2c buf is [%x]\n", __func__, *read_buf);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int mdss_i2c_byte_write(struct i2c_client *client, uint8_t slave_addr,
|
||||||
|
uint8_t reg_offset, uint8_t *value)
|
||||||
|
{
|
||||||
|
struct i2c_msg msgs[1];
|
||||||
|
uint8_t data[2];
|
||||||
|
int status = -EACCES;
|
||||||
|
|
||||||
|
pr_debug("%s: writing from slave_addr=[%x] and offset=[%x]\n",
|
||||||
|
__func__, slave_addr, reg_offset);
|
||||||
|
|
||||||
|
data[0] = reg_offset;
|
||||||
|
data[1] = *value;
|
||||||
|
|
||||||
|
msgs[0].addr = slave_addr >> 1;
|
||||||
|
msgs[0].flags = 0;
|
||||||
|
msgs[0].len = 2;
|
||||||
|
msgs[0].buf = data;
|
||||||
|
|
||||||
|
status = i2c_transfer(client->adapter, msgs, 1);
|
||||||
|
if (status < 1) {
|
||||||
|
pr_err("I2C WRITE FAILED=[%d]\n", status);
|
||||||
|
return -EACCES;
|
||||||
|
}
|
||||||
|
pr_debug("%s: I2C write status=%x\n", __func__, status);
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
|
@ -16,6 +16,8 @@
|
||||||
#include <linux/gpio.h>
|
#include <linux/gpio.h>
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
#include <linux/regulator/consumer.h>
|
#include <linux/regulator/consumer.h>
|
||||||
|
#include <linux/i2c.h>
|
||||||
|
#include <linux/types.h>
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
#define DEV_DBG(fmt, args...) pr_err(fmt, ##args)
|
#define DEV_DBG(fmt, args...) pr_err(fmt, ##args)
|
||||||
|
@ -97,4 +99,9 @@ void msm_dss_put_clk(struct dss_clk *clk_arry, int num_clk);
|
||||||
int msm_dss_clk_set_rate(struct dss_clk *clk_arry, int num_clk);
|
int msm_dss_clk_set_rate(struct dss_clk *clk_arry, int num_clk);
|
||||||
int msm_dss_enable_clk(struct dss_clk *clk_arry, int num_clk, int enable);
|
int msm_dss_enable_clk(struct dss_clk *clk_arry, int num_clk, int enable);
|
||||||
|
|
||||||
|
int mdss_i2c_byte_read(struct i2c_client *client, uint8_t slave_addr,
|
||||||
|
uint8_t reg_offset, uint8_t *read_buf);
|
||||||
|
int mdss_i2c_byte_write(struct i2c_client *client, uint8_t slave_addr,
|
||||||
|
uint8_t reg_offset, uint8_t *value);
|
||||||
|
|
||||||
#endif /* __MDSS_IO_UTIL_H__ */
|
#endif /* __MDSS_IO_UTIL_H__ */
|
||||||
|
|
1184
drivers/video/fbdev/msm/mhl_sii8334.c
Normal file
1184
drivers/video/fbdev/msm/mhl_sii8334.c
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue