- reg-io-width: the width of the reg:1,4, default set to 1 if not present
- ddc-i2c-bus: phandle of an I2C controller used for DDC EDID probing
- clocks, clock-names: phandle to the HDMI CEC clock, name should be "cec"
+- hdcp1x-enable: enable hdcp1.x, enable if defined, disable if not defined
Example:
hdmi: hdmi@0120000 {
}
if (hdcp_int & 0x40) {
hdcp->status = DW_HDCP_AUTH_FAIL;
- if (hdcp->enable != 2)
- return;
-
if (hdcp->remaining_times > 1)
hdcp->remaining_times--;
else if (hdcp->remaining_times == 1)
static ssize_t hdcp_enable_read(struct device *device,
struct device_attribute *attr, char *buf)
{
- int enable = 0;
+ bool enable = 0;
struct dw_hdcp *hdcp = g_hdcp;
if (hdcp)
struct device_attribute *attr,
const char *buf, size_t count)
{
- int enable;
+ bool enable;
struct dw_hdcp *hdcp = g_hdcp;
if (!hdcp)
return -EINVAL;
- if (kstrtoint(buf, 0, &enable))
+ if (kstrtobool(buf, &enable))
return -EINVAL;
- if ((enable >= 0) && (hdcp->enable != enable)) {
+ if (hdcp->enable != enable) {
if (enable) {
hdcp->enable = enable;
if (hdcp->read(hdcp->hdmi, HDMI_PHY_STAT0) &
goto error2;
}
- if (!(hdcp->read(hdcp->hdmi, HDMI_MC_CLKDIS) &
- HDMI_MC_CLKDIS_HDCPCLK_MASK))
- hdcp->enable = 1;
-
+ /* retry time if hdcp auth fail. unlimited time if set 0 */
+ hdcp->retry_times = 0;
hdcp->dev = &pdev->dev;
hdcp->hdcp_start = dw_hdmi_hdcp_start;
hdcp->hdcp_stop = dw_hdmi_hdcp_stop;
hdcp->hdcp_isr = dw_hdmi_hdcp_isr;
- hdcp->retry_times = 3;
dev_dbg(hdcp->dev, "%s success\n", __func__);
return 0;
}
static void dw_hdmi_register_hdcp(struct device *dev, struct dw_hdmi *hdmi,
- u32 val)
+ u32 val, bool hdcp1x_enable)
{
struct dw_hdcp hdmi_hdcp = {
.hdmi = hdmi,
.read = hdmi_readb,
.regs = hdmi->regs,
.reg_io_width = val,
- .enable = 0,
+ .enable = hdcp1x_enable,
};
struct platform_device_info hdcp_device_info = {
.parent = dev,
u32 val = 1;
u8 config0;
u8 config3;
+ bool hdcp1x_enable = 0;
hdmi = devm_kzalloc(dev, sizeof(*hdmi), GFP_KERNEL);
if (!hdmi)
dev_set_drvdata(dev, hdmi);
dw_hdmi_register_debugfs(dev, hdmi);
- dw_hdmi_register_hdcp(dev, hdmi, val);
+
+ if (of_property_read_bool(np, "hdcp1x-enable"))
+ hdcp1x_enable = 1;
+ dw_hdmi_register_hdcp(dev, hdmi, val, hdcp1x_enable);
return 0;