]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/gma500: Use gma_ prefix for our i2c abstraction
authorPatrik Jakobsson <patrik.r.jakobsson@gmail.com>
Wed, 1 Jun 2022 09:23:04 +0000 (11:23 +0200)
committerPatrik Jakobsson <patrik.r.jakobsson@gmail.com>
Thu, 2 Jun 2022 08:05:39 +0000 (10:05 +0200)
psb_intel_i2c_chan is used by all chips so use the correct prefix.

Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20220601092311.22648-2-patrik.r.jakobsson@gmail.com
drivers/gpu/drm/gma500/cdv_intel_crt.c
drivers/gpu/drm/gma500/cdv_intel_hdmi.c
drivers/gpu/drm/gma500/cdv_intel_lvds.c
drivers/gpu/drm/gma500/intel_i2c.c
drivers/gpu/drm/gma500/oaktrail_lvds.c
drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c
drivers/gpu/drm/gma500/psb_drv.h
drivers/gpu/drm/gma500/psb_intel_drv.h
drivers/gpu/drm/gma500/psb_intel_lvds.c

index 6bcd18c63c3129a196d71e5623c6f78208396d67..36c72a379d9f427eaf59816e51719f07dc62ec47 100644 (file)
@@ -194,7 +194,7 @@ static void cdv_intel_crt_destroy(struct drm_connector *connector)
        struct gma_connector *gma_connector = to_gma_connector(connector);
        struct gma_encoder *gma_encoder = gma_attached_encoder(connector);
 
-       psb_intel_i2c_destroy(gma_encoder->ddc_bus);
+       gma_i2c_destroy(gma_encoder->ddc_bus);
        drm_connector_cleanup(connector);
        kfree(gma_connector);
 }
@@ -267,7 +267,7 @@ void cdv_intel_crt_init(struct drm_device *dev,
        gma_connector_attach_encoder(gma_connector, gma_encoder);
 
        /* Set up the DDC bus. */
-       gma_encoder->ddc_bus = psb_intel_i2c_create(dev, GPIOA, "CRTDDC_A");
+       gma_encoder->ddc_bus = gma_i2c_create(dev, GPIOA, "CRTDDC_A");
        if (!gma_encoder->ddc_bus) {
                dev_printk(KERN_ERR, dev->dev, "DDC bus registration failed.\n");
                goto failed_ddc;
index 8987e555e1131e0e1bc4bdafcf6307d16f7ec960..e87272c9d35841a0a939ed9d71787e9018ff2104 100644 (file)
@@ -245,7 +245,7 @@ static void cdv_hdmi_destroy(struct drm_connector *connector)
        struct gma_connector *gma_connector = to_gma_connector(connector);
        struct gma_encoder *gma_encoder = gma_attached_encoder(connector);
 
-       psb_intel_i2c_destroy(gma_encoder->i2c_bus);
+       gma_i2c_destroy(gma_encoder->i2c_bus);
        drm_connector_cleanup(connector);
        kfree(gma_connector);
 }
@@ -342,8 +342,8 @@ void cdv_hdmi_init(struct drm_device *dev,
                break;
        }
 
-       gma_encoder->i2c_bus = psb_intel_i2c_create(dev,
-                               ddc_bus, (reg == SDVOB) ? "HDMIB" : "HDMIC");
+       gma_encoder->i2c_bus = gma_i2c_create(dev, ddc_bus,
+                                       (reg == SDVOB) ? "HDMIB" : "HDMIC");
 
        if (!gma_encoder->i2c_bus) {
                dev_err(dev->dev, "No ddc adapter available!\n");
index 98d9f5483a7c1f03faa5971380e01d589aee7337..02dedf5dfa62f4afed0fac4f9d8a6843fb831ca4 100644 (file)
@@ -329,7 +329,7 @@ static void cdv_intel_lvds_destroy(struct drm_connector *connector)
        struct gma_connector *gma_connector = to_gma_connector(connector);
        struct gma_encoder *gma_encoder = gma_attached_encoder(connector);
 
-       psb_intel_i2c_destroy(gma_encoder->i2c_bus);
+       gma_i2c_destroy(gma_encoder->i2c_bus);
        drm_connector_cleanup(connector);
        kfree(gma_connector);
 }
@@ -550,9 +550,7 @@ void cdv_intel_lvds_init(struct drm_device *dev,
         * Set up I2C bus
         * FIXME: distroy i2c_bus when exit
         */
-       gma_encoder->i2c_bus = psb_intel_i2c_create(dev,
-                                                        GPIOB,
-                                                        "LVDSBLC_B");
+       gma_encoder->i2c_bus = gma_i2c_create(dev, GPIOB, "LVDSBLC_B");
        if (!gma_encoder->i2c_bus) {
                dev_printk(KERN_ERR,
                        dev->dev, "I2C bus registration failed.\n");
@@ -572,9 +570,7 @@ void cdv_intel_lvds_init(struct drm_device *dev,
         */
 
        /* Set up the DDC bus. */
-       gma_encoder->ddc_bus = psb_intel_i2c_create(dev,
-                                                        GPIOC,
-                                                        "LVDSDDC_C");
+       gma_encoder->ddc_bus = gma_i2c_create(dev, GPIOC, "LVDSDDC_C");
        if (!gma_encoder->ddc_bus) {
                dev_printk(KERN_ERR, dev->dev,
                           "DDC bus registration " "failed.\n");
@@ -652,10 +648,10 @@ out:
 failed_find:
        mutex_unlock(&dev->mode_config.mutex);
        pr_err("Failed find\n");
-       psb_intel_i2c_destroy(gma_encoder->ddc_bus);
+       gma_i2c_destroy(gma_encoder->ddc_bus);
 failed_ddc:
        pr_err("Failed DDC\n");
-       psb_intel_i2c_destroy(gma_encoder->i2c_bus);
+       gma_i2c_destroy(gma_encoder->i2c_bus);
 failed_blc_i2c:
        pr_err("Failed BLC\n");
        drm_encoder_cleanup(encoder);
index 5e1b4d70c3171dbb2aa185fe28f4641594c50e65..6e9e2061ff3b19285fe9d0462b8f678d9e03f37f 100644 (file)
@@ -22,7 +22,7 @@
 
 static int get_clock(void *data)
 {
-       struct psb_intel_i2c_chan *chan = data;
+       struct gma_i2c_chan *chan = data;
        struct drm_device *dev = chan->drm_dev;
        u32 val;
 
@@ -32,7 +32,7 @@ static int get_clock(void *data)
 
 static int get_data(void *data)
 {
-       struct psb_intel_i2c_chan *chan = data;
+       struct gma_i2c_chan *chan = data;
        struct drm_device *dev = chan->drm_dev;
        u32 val;
 
@@ -42,7 +42,7 @@ static int get_data(void *data)
 
 static void set_clock(void *data, int state_high)
 {
-       struct psb_intel_i2c_chan *chan = data;
+       struct gma_i2c_chan *chan = data;
        struct drm_device *dev = chan->drm_dev;
        u32 reserved = 0, clock_bits;
 
@@ -62,7 +62,7 @@ static void set_clock(void *data, int state_high)
 
 static void set_data(void *data, int state_high)
 {
-       struct psb_intel_i2c_chan *chan = data;
+       struct gma_i2c_chan *chan = data;
        struct drm_device *dev = chan->drm_dev;
        u32 reserved = 0, data_bits;
 
@@ -83,7 +83,7 @@ static void set_data(void *data, int state_high)
 }
 
 /**
- * psb_intel_i2c_create - instantiate an Intel i2c bus using the specified GPIO reg
+ * gma_i2c_create - instantiate an Intel i2c bus using the specified GPIO reg
  * @dev: DRM device
  * @reg: GPIO reg to use
  * @name: name for this bus
@@ -102,12 +102,12 @@ static void set_data(void *data, int state_high)
  *   %GPIOH
  * see PRM for details on how these different busses are used.
  */
-struct psb_intel_i2c_chan *psb_intel_i2c_create(struct drm_device *dev,
-                                       const u32 reg, const char *name)
+struct gma_i2c_chan *gma_i2c_create(struct drm_device *dev, const u32 reg,
+                                   const char *name)
 {
-       struct psb_intel_i2c_chan *chan;
+       struct gma_i2c_chan *chan;
 
-       chan = kzalloc(sizeof(struct psb_intel_i2c_chan), GFP_KERNEL);
+       chan = kzalloc(sizeof(struct gma_i2c_chan), GFP_KERNEL);
        if (!chan)
                goto out_free;
 
@@ -143,12 +143,12 @@ out_free:
 }
 
 /**
- * psb_intel_i2c_destroy - unregister and free i2c bus resources
+ * gma_i2c_destroy - unregister and free i2c bus resources
  * @chan: channel to free
  *
  * Unregister the adapter from the i2c layer, then free the structure.
  */
-void psb_intel_i2c_destroy(struct psb_intel_i2c_chan *chan)
+void gma_i2c_destroy(struct gma_i2c_chan *chan)
 {
        if (!chan)
                return;
index aed5de8f824568c3d674cbed7e1d9982629ed074..58b38e35909852f875988389d35833202d00797a 100644 (file)
@@ -408,7 +408,7 @@ failed_find:
 
        dev_dbg(dev->dev, "No LVDS modes found, disabling.\n");
        if (gma_encoder->ddc_bus) {
-               psb_intel_i2c_destroy(gma_encoder->ddc_bus);
+               gma_i2c_destroy(gma_encoder->ddc_bus);
                gma_encoder->ddc_bus = NULL;
        }
 
index d1ae91fcd224a9ed444341b95069c3aed9c01ba7..9a6de6ff8b0c86b2748cf6ae2b1a49e946de4bfc 100644 (file)
@@ -65,7 +65,7 @@
 
 static int get_clock(void *data)
 {
-       struct psb_intel_i2c_chan *chan = data;
+       struct gma_i2c_chan *chan = data;
        u32 val;
 
        val = LPC_READ_REG(chan, RGIO);
@@ -79,7 +79,7 @@ static int get_clock(void *data)
 
 static int get_data(void *data)
 {
-       struct psb_intel_i2c_chan *chan = data;
+       struct gma_i2c_chan *chan = data;
        u32 val;
 
        val = LPC_READ_REG(chan, RGIO);
@@ -93,7 +93,7 @@ static int get_data(void *data)
 
 static void set_clock(void *data, int state_high)
 {
-       struct psb_intel_i2c_chan *chan = data;
+       struct gma_i2c_chan *chan = data;
        u32 val;
 
        if (state_high) {
@@ -112,7 +112,7 @@ static void set_clock(void *data, int state_high)
 
 static void set_data(void *data, int state_high)
 {
-       struct psb_intel_i2c_chan *chan = data;
+       struct gma_i2c_chan *chan = data;
        u32 val;
 
        if (state_high) {
@@ -134,9 +134,9 @@ void oaktrail_lvds_i2c_init(struct drm_encoder *encoder)
        struct drm_device *dev = encoder->dev;
        struct gma_encoder *gma_encoder = to_gma_encoder(encoder);
        struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
-       struct psb_intel_i2c_chan *chan;
+       struct gma_i2c_chan *chan;
 
-       chan = kzalloc(sizeof(struct psb_intel_i2c_chan), GFP_KERNEL);
+       chan = kzalloc(sizeof(struct gma_i2c_chan), GFP_KERNEL);
        if (!chan)
                return;
 
index 0ddfec1a0851d5a233d8ed2d18e78ce05411bd0b..0ea3d23575f3a638be95c723639938fdd7443492 100644 (file)
@@ -469,7 +469,7 @@ struct drm_psb_private {
        struct drm_display_mode *sdvo_lvds_vbt_mode;
 
        struct bdb_lvds_backlight *lvds_bl; /* LVDS backlight info from VBT */
-       struct psb_intel_i2c_chan *lvds_i2c_bus; /* FIXME: Remove this? */
+       struct gma_i2c_chan *lvds_i2c_bus; /* FIXME: Remove this? */
 
        /* Feature bits from the VBIOS */
        unsigned int int_tv_support:1;
index db3e757328feeb4389aee7eea261a7a200284d13..72585a3df25d3e91021fae9fcf896a35f1ca9a0d 100644 (file)
@@ -78,7 +78,7 @@ struct psb_intel_mode_device {
        uint32_t saveBLC_PWM_CTL;
 };
 
-struct psb_intel_i2c_chan {
+struct gma_i2c_chan {
        /* for getting at dev. private (mmio etc.) */
        struct drm_device *drm_dev;
        u32 reg;                /* GPIO reg */
@@ -103,8 +103,8 @@ struct gma_encoder {
 
        /* FIXME: Either make SDVO and LVDS store it's i2c here or give CDV it's
           own set of output privates */
-       struct psb_intel_i2c_chan *i2c_bus;
-       struct psb_intel_i2c_chan *ddc_bus;
+       struct gma_i2c_chan *i2c_bus;
+       struct gma_i2c_chan *ddc_bus;
 };
 
 struct gma_connector {
@@ -176,9 +176,9 @@ struct gma_crtc {
 #define to_psb_intel_framebuffer(x)    \
                container_of(x, struct psb_intel_framebuffer, base)
 
-struct psb_intel_i2c_chan *psb_intel_i2c_create(struct drm_device *dev,
-                                       const u32 reg, const char *name);
-void psb_intel_i2c_destroy(struct psb_intel_i2c_chan *chan);
+struct gma_i2c_chan *gma_i2c_create(struct drm_device *dev, const u32 reg,
+                                   const char *name);
+void gma_i2c_destroy(struct gma_i2c_chan *chan);
 int psb_intel_ddc_get_modes(struct drm_connector *connector,
                            struct i2c_adapter *adapter);
 extern bool psb_intel_ddc_probe(struct i2c_adapter *adapter);
index cad00380b3866b144ae7a48a9d43be007d12f383..07631891531aba59ad931f7d7090ebbda7f8c5d4 100644 (file)
@@ -49,8 +49,8 @@ struct psb_intel_lvds_priv {
        uint32_t savePFIT_PGM_RATIOS;
        uint32_t saveBLC_PWM_CTL;
 
-       struct psb_intel_i2c_chan *i2c_bus;
-       struct psb_intel_i2c_chan *ddc_bus;
+       struct gma_i2c_chan *i2c_bus;
+       struct gma_i2c_chan *ddc_bus;
 };
 
 
@@ -90,7 +90,7 @@ static int psb_lvds_i2c_set_brightness(struct drm_device *dev,
 {
        struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
 
-       struct psb_intel_i2c_chan *lvds_i2c_bus = dev_priv->lvds_i2c_bus;
+       struct gma_i2c_chan *lvds_i2c_bus = dev_priv->lvds_i2c_bus;
        u8 out_buf[2];
        unsigned int blc_i2c_brightness;
 
@@ -525,7 +525,7 @@ void psb_intel_lvds_destroy(struct drm_connector *connector)
        struct gma_encoder *gma_encoder = gma_attached_encoder(connector);
        struct psb_intel_lvds_priv *lvds_priv = gma_encoder->dev_priv;
 
-       psb_intel_i2c_destroy(lvds_priv->ddc_bus);
+       gma_i2c_destroy(lvds_priv->ddc_bus);
        drm_connector_cleanup(connector);
        kfree(gma_connector);
 }
@@ -695,7 +695,7 @@ void psb_intel_lvds_init(struct drm_device *dev,
         * Set up I2C bus
         * FIXME: distroy i2c_bus when exit
         */
-       lvds_priv->i2c_bus = psb_intel_i2c_create(dev, GPIOB, "LVDSBLC_B");
+       lvds_priv->i2c_bus = gma_i2c_create(dev, GPIOB, "LVDSBLC_B");
        if (!lvds_priv->i2c_bus) {
                dev_printk(KERN_ERR,
                        dev->dev, "I2C bus registration failed.\n");
@@ -715,7 +715,7 @@ void psb_intel_lvds_init(struct drm_device *dev,
         */
 
        /* Set up the DDC bus. */
-       lvds_priv->ddc_bus = psb_intel_i2c_create(dev, GPIOC, "LVDSDDC_C");
+       lvds_priv->ddc_bus = gma_i2c_create(dev, GPIOC, "LVDSDDC_C");
        if (!lvds_priv->ddc_bus) {
                dev_printk(KERN_ERR, dev->dev,
                           "DDC bus registration " "failed.\n");
@@ -786,9 +786,9 @@ out:
 
 failed_find:
        mutex_unlock(&dev->mode_config.mutex);
-       psb_intel_i2c_destroy(lvds_priv->ddc_bus);
+       gma_i2c_destroy(lvds_priv->ddc_bus);
 failed_ddc:
-       psb_intel_i2c_destroy(lvds_priv->i2c_bus);
+       gma_i2c_destroy(lvds_priv->i2c_bus);
 failed_blc_i2c:
        drm_encoder_cleanup(encoder);
        drm_connector_cleanup(connector);