aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i2c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/i2c')
-rw-r--r--drivers/gpu/drm/i2c/ch7006_drv.c22
-rw-r--r--drivers/gpu/drm/i2c/ch7006_priv.h2
2 files changed, 21 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i2c/ch7006_drv.c b/drivers/gpu/drm/i2c/ch7006_drv.c
index 81681a07a80..833b35f44a7 100644
--- a/drivers/gpu/drm/i2c/ch7006_drv.c
+++ b/drivers/gpu/drm/i2c/ch7006_drv.c
@@ -33,7 +33,7 @@ static void ch7006_encoder_set_config(struct drm_encoder *encoder,
33{ 33{
34 struct ch7006_priv *priv = to_ch7006_priv(encoder); 34 struct ch7006_priv *priv = to_ch7006_priv(encoder);
35 35
36 priv->params = params; 36 priv->params = *(struct ch7006_encoder_params *)params;
37} 37}
38 38
39static void ch7006_encoder_destroy(struct drm_encoder *encoder) 39static void ch7006_encoder_destroy(struct drm_encoder *encoder)
@@ -114,7 +114,7 @@ static void ch7006_encoder_mode_set(struct drm_encoder *encoder,
114{ 114{
115 struct i2c_client *client = drm_i2c_encoder_get_client(encoder); 115 struct i2c_client *client = drm_i2c_encoder_get_client(encoder);
116 struct ch7006_priv *priv = to_ch7006_priv(encoder); 116 struct ch7006_priv *priv = to_ch7006_priv(encoder);
117 struct ch7006_encoder_params *params = priv->params; 117 struct ch7006_encoder_params *params = &priv->params;
118 struct ch7006_state *state = &priv->state; 118 struct ch7006_state *state = &priv->state;
119 uint8_t *regs = state->regs; 119 uint8_t *regs = state->regs;
120 struct ch7006_mode *mode = priv->mode; 120 struct ch7006_mode *mode = priv->mode;
@@ -428,6 +428,22 @@ static int ch7006_remove(struct i2c_client *client)
428 return 0; 428 return 0;
429} 429}
430 430
431static int ch7006_suspend(struct i2c_client *client, pm_message_t mesg)
432{
433 ch7006_dbg(client, "\n");
434
435 return 0;
436}
437
438static int ch7006_resume(struct i2c_client *client)
439{
440 ch7006_dbg(client, "\n");
441
442 ch7006_write(client, 0x3d, 0x0);
443
444 return 0;
445}
446
431static int ch7006_encoder_init(struct i2c_client *client, 447static int ch7006_encoder_init(struct i2c_client *client,
432 struct drm_device *dev, 448 struct drm_device *dev,
433 struct drm_encoder_slave *encoder) 449 struct drm_encoder_slave *encoder)
@@ -487,6 +503,8 @@ static struct drm_i2c_encoder_driver ch7006_driver = {
487 .i2c_driver = { 503 .i2c_driver = {
488 .probe = ch7006_probe, 504 .probe = ch7006_probe,
489 .remove = ch7006_remove, 505 .remove = ch7006_remove,
506 .suspend = ch7006_suspend,
507 .resume = ch7006_resume,
490 508
491 .driver = { 509 .driver = {
492 .name = "ch7006", 510 .name = "ch7006",
diff --git a/drivers/gpu/drm/i2c/ch7006_priv.h b/drivers/gpu/drm/i2c/ch7006_priv.h
index b06d3d93d8a..1c6d2e3bd96 100644
--- a/drivers/gpu/drm/i2c/ch7006_priv.h
+++ b/drivers/gpu/drm/i2c/ch7006_priv.h
@@ -77,7 +77,7 @@ struct ch7006_state {
77}; 77};
78 78
79struct ch7006_priv { 79struct ch7006_priv {
80 struct ch7006_encoder_params *params; 80 struct ch7006_encoder_params params;
81 struct ch7006_mode *mode; 81 struct ch7006_mode *mode;
82 82
83 struct ch7006_state state; 83 struct ch7006_state state;