Signed-off-by: Francisco Jerez <[email protected]>
---
 drivers/gpu/drm/i2c/ch7006_drv.c  |   30 ++++++++++++++++++++++++++++++
 drivers/gpu/drm/i2c/ch7006_priv.h |    2 ++
 2 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/i2c/ch7006_drv.c b/drivers/gpu/drm/i2c/ch7006_drv.c
index a890652..47421ba 100644
--- a/drivers/gpu/drm/i2c/ch7006_drv.c
+++ b/drivers/gpu/drm/i2c/ch7006_drv.c
@@ -429,6 +429,7 @@ static int ch7006_encoder_init(struct i2c_client *client,
                               struct drm_encoder_slave *encoder)
 {
        struct ch7006_priv *priv;
+       int i;
 
        ch7006_dbg(client, "\n");
 
@@ -450,6 +451,27 @@ static int ch7006_encoder_init(struct i2c_client *client,
        priv->vmargin = 50;
        priv->last_dpms = -1;
 
+       if (ch7006_tv_norm) {
+               for (i = 0; i < NUM_TV_NORMS; i++) {
+                       if (!strcmp(ch7006_tv_norm_names[i], ch7006_tv_norm)) {
+                               priv->norm = i;
+                               break;
+                       }
+               }
+
+               if (i == NUM_TV_NORMS)
+                       ch7006_err(client, "Invalid TV norm setting \"%s\".\n",
+                                  ch7006_tv_norm);
+       }
+
+       if (ch7006_scale) {
+               if (ch7006_scale >= 0 && ch7006_scale <= 2)
+                       priv->scale = ch7006_scale;
+               else
+                       ch7006_err(client, "Invalid scale setting \"%d\".\n",
+                                  ch7006_scale);
+       }
+
        return 0;
 }
 
@@ -491,6 +513,14 @@ int ch7006_debug = 0;
 module_param_named(debug, ch7006_debug, int, 0600);
 MODULE_PARM_DESC(debug, "Enable debug output.");
 
+char *ch7006_tv_norm = NULL;
+module_param_named(tv_norm, ch7006_tv_norm, charp, 0600);
+MODULE_PARM_DESC(tv_norm, "Default TV norm.");
+
+int ch7006_scale = 0;
+module_param_named(scale, ch7006_scale, int, 0600);
+MODULE_PARM_DESC(scale, "Default scale.");
+
 MODULE_AUTHOR("Francisco Jerez <[email protected]>");
 MODULE_DESCRIPTION("Chrontel ch7006 TV encoder driver");
 MODULE_LICENSE("GPL and additional rights");
diff --git a/drivers/gpu/drm/i2c/ch7006_priv.h 
b/drivers/gpu/drm/i2c/ch7006_priv.h
index 7ebb073..576bbea 100644
--- a/drivers/gpu/drm/i2c/ch7006_priv.h
+++ b/drivers/gpu/drm/i2c/ch7006_priv.h
@@ -101,6 +101,8 @@ struct ch7006_priv {
 #define to_ch7006_priv(x) ((struct ch7006_priv 
*)to_encoder_slave(x)->slave_priv)
 
 extern int ch7006_debug;
+extern char *ch7006_tv_norm;
+extern int ch7006_scale;
 
 extern char *ch7006_tv_norm_names[];
 extern struct ch7006_tv_norm_info ch7006_tv_norms[];
-- 
1.6.3.3

_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

Reply via email to