Commit 04477e5e authored by Patrik Jakobsson's avatar Patrik Jakobsson
Browse files

drm/gma500: Use gma_ prefix for our i2c abstraction

parent 01ece651
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;
+3 −3
Original line number Diff line number Diff line
@@ -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");
+5 −9
Original line number Diff line number Diff line
@@ -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 @@ void cdv_intel_lvds_init(struct drm_device *dev,
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);
+11 −11
Original line number Diff line number Diff line
@@ -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 @@ struct psb_intel_i2c_chan *psb_intel_i2c_create(struct drm_device *dev,
}

/**
 * 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;
+1 −1
Original line number Diff line number Diff line
@@ -408,7 +408,7 @@ void oaktrail_lvds_init(struct drm_device *dev,

	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;
	}

Loading