drm/i915: Change I2C api to pass around i2c_adapters

The existing API passed around intel_i2c_chan pointers, which are dependent
on the i2c bit-banging algo. This precluded the driver from using outputs
which use a different algo. Switching to the more general i2c_adpater allows
the driver to support non bit-banging DDC.

This also required moving the slave address into the output private
structures.

Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Keith Packard
2009-05-30 12:16:25 -07:00
parent b99e228d35
commit f9c10a9b96
12 changed files with 118 additions and 113 deletions

View File

@ -53,10 +53,9 @@ bool intel_ddc_probe(struct intel_output *intel_output)
}
};
intel_i2c_quirk_set(intel_output->ddc_bus->drm_dev, true);
ret = i2c_transfer(&intel_output->ddc_bus->adapter, msgs, 2);
intel_i2c_quirk_set(intel_output->ddc_bus->drm_dev, false);
intel_i2c_quirk_set(intel_output->base.dev, true);
ret = i2c_transfer(intel_output->ddc_bus, msgs, 2);
intel_i2c_quirk_set(intel_output->base.dev, false);
if (ret == 2)
return true;
@ -74,10 +73,9 @@ int intel_ddc_get_modes(struct intel_output *intel_output)
struct edid *edid;
int ret = 0;
intel_i2c_quirk_set(intel_output->ddc_bus->drm_dev, true);
edid = drm_get_edid(&intel_output->base,
&intel_output->ddc_bus->adapter);
intel_i2c_quirk_set(intel_output->ddc_bus->drm_dev, false);
intel_i2c_quirk_set(intel_output->base.dev, true);
edid = drm_get_edid(&intel_output->base, intel_output->ddc_bus);
intel_i2c_quirk_set(intel_output->base.dev, false);
if (edid) {
drm_mode_connector_update_edid_property(&intel_output->base,
edid);