Permalink
Browse files

tda998x: Power on the HDMI block

Add CEC registers, bit fields
Add code to power on NXP HDMI

Signed-off-by: Joel A Fernandes <joelagnel@ti.com>
  • Loading branch information...
1 parent 8b3e456 commit 406cbdf60588ec0a570cbd1bec13586361dfa829 Joel A Fernandes committed Nov 2, 2012
Showing with 20 additions and 4 deletions.
  1. +9 −3 drivers/video/nxp-hdmi/tda998x.c
  2. +11 −1 drivers/video/nxp-hdmi/tda998x.h
View
12 drivers/video/nxp-hdmi/tda998x.c
@@ -20,9 +20,10 @@
#include <linux/i2c.h>
#include <linux/err.h>
#include <linux/regmap.h>
-// #include "tda998x.h"
+#include "tda998x.h"
-#define TDA998X_I2C_ADDRESS 0x77
+#define TDA998X_I2C_ADDRESS 0x77
+#define TDA998X_CEC_ADDR 0x34
struct regmap_config tda998x_regmap_config = {
.reg_bits = 8,
@@ -38,13 +39,18 @@ static int __devinit tda998x_i2c_probe(struct i2c_client *client,
int err;
struct regmap *regmap = devm_regmap_init_i2c(client,
&tda998x_regmap_config);
-
if (IS_ERR(regmap)) {
err = PTR_ERR(regmap);
dev_err(&client->dev, "Failed to init regmap: %d\n", err);
return err;
}
+ /* Enable rxsense and hdmi */
+ err = regmap_write(regmap, E_REG_CEC_ENAMODS_RW,
+ E_MASKREG_CEC_ENAMODS_ena_hdmi | E_MASKREG_CEC_ENAMODS_ena_rxs);
+ if(IS_ERR(err)) {
+ return err;
+ }
return 0; // tda998x_probe(&client->dev, regmap);
}
View
12 drivers/video/nxp-hdmi/tda998x.h
@@ -1,5 +1,8 @@
#define E_REG_CURPAGE_ADR_W 0xFF /* Address register on all pages */
-
+ #define BINARY(d7,d6,d5,d4,d3,d2,d1,d0) \
+ (((d7)<<7)|((d6)<<6)|((d5)<<5)|((d4)<<4)|((d3)<<3)|((d2)<<2)|((d1)<<1)|(d0))
+
+
/* CEC Registers */
#define E_REG_CEC_INTERRUPTSTATUS_R 0xEE
@@ -8,3 +11,10 @@
#define E_REG_CEC_RXSHPDLEV_R 0xFE
#define E_REG_CEC_ENAMODS_RW 0xFF
#define E_REG_CEC_FRO_IM_CLK_CTRL_RW 0xFB
+
+#define E_MASKREG_CEC_ENAMODS_dis_fro BINARY(0,1,0,0, 0,0,0,0)
+#define E_MASKREG_CEC_ENAMODS_dis_cclk BINARY(0,0,1,0, 0,0,0,0)
+#define E_MASKREG_CEC_ENAMODS_ena_rxs BINARY(0,0,0,0, 0,1,0,0)
+#define E_MASKREG_CEC_ENAMODS_ena_hdmi BINARY(0,0,0,0, 0,0,1,0)
+#define E_MASKREG_CEC_ENAMODS_ena_cec BINARY(0,0,0,0, 0,0,0,1)
+

0 comments on commit 406cbdf

Please sign in to comment.