Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5b6345be authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge remote branch 'origin/drm-intel-next' of ../drm-intel into drm-fixes

parents 176f613e b5aa8a0f
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -81,6 +81,7 @@ config DRM_I830


config DRM_I915
config DRM_I915
	tristate "i915 driver"
	tristate "i915 driver"
	depends on AGP_INTEL
	select FB_CFB_FILLRECT
	select FB_CFB_FILLRECT
	select FB_CFB_COPYAREA
	select FB_CFB_COPYAREA
	select FB_CFB_IMAGEBLIT
	select FB_CFB_IMAGEBLIT
+2 −0
Original line number Original line Diff line number Diff line
@@ -13,6 +13,8 @@ i915-y := i915_drv.o i915_dma.o i915_irq.o i915_mem.o \
	  intel_crt.o \
	  intel_crt.o \
	  intel_lvds.o \
	  intel_lvds.o \
	  intel_bios.o \
	  intel_bios.o \
	  intel_dp.o \
	  intel_dp_i2c.o \
	  intel_hdmi.o \
	  intel_hdmi.o \
	  intel_sdvo.o \
	  intel_sdvo.o \
	  intel_modes.o \
	  intel_modes.o \
+2 −2
Original line number Original line Diff line number Diff line
@@ -37,7 +37,7 @@ struct intel_dvo_device {
	/* GPIO register used for i2c bus to control this device */
	/* GPIO register used for i2c bus to control this device */
	u32 gpio;
	u32 gpio;
	int slave_addr;
	int slave_addr;
	struct intel_i2c_chan *i2c_bus;
	struct i2c_adapter *i2c_bus;


	const struct intel_dvo_dev_ops *dev_ops;
	const struct intel_dvo_dev_ops *dev_ops;
	void *dev_priv;
	void *dev_priv;
@@ -52,7 +52,7 @@ struct intel_dvo_dev_ops {
	 * Returns NULL if the device does not exist.
	 * Returns NULL if the device does not exist.
	 */
	 */
	bool (*init)(struct intel_dvo_device *dvo,
	bool (*init)(struct intel_dvo_device *dvo,
		     struct intel_i2c_chan *i2cbus);
		     struct i2c_adapter *i2cbus);


	/*
	/*
	 * Called to allow the output a chance to create properties after the
	 * Called to allow the output a chance to create properties after the
+11 −9
Original line number Original line Diff line number Diff line
@@ -176,19 +176,20 @@ static void ch7017_dpms(struct intel_dvo_device *dvo, int mode);


static bool ch7017_read(struct intel_dvo_device *dvo, int addr, uint8_t *val)
static bool ch7017_read(struct intel_dvo_device *dvo, int addr, uint8_t *val)
{
{
	struct intel_i2c_chan *i2cbus = dvo->i2c_bus;
	struct i2c_adapter *adapter = dvo->i2c_bus;
	struct intel_i2c_chan *i2cbus = container_of(adapter, struct intel_i2c_chan, adapter);
	u8 out_buf[2];
	u8 out_buf[2];
	u8 in_buf[2];
	u8 in_buf[2];


	struct i2c_msg msgs[] = {
	struct i2c_msg msgs[] = {
		{
		{
			.addr = i2cbus->slave_addr,
			.addr = dvo->slave_addr,
			.flags = 0,
			.flags = 0,
			.len = 1,
			.len = 1,
			.buf = out_buf,
			.buf = out_buf,
		},
		},
		{
		{
			.addr = i2cbus->slave_addr,
			.addr = dvo->slave_addr,
			.flags = I2C_M_RD,
			.flags = I2C_M_RD,
			.len = 1,
			.len = 1,
			.buf = in_buf,
			.buf = in_buf,
@@ -208,10 +209,11 @@ static bool ch7017_read(struct intel_dvo_device *dvo, int addr, uint8_t *val)


static bool ch7017_write(struct intel_dvo_device *dvo, int addr, uint8_t val)
static bool ch7017_write(struct intel_dvo_device *dvo, int addr, uint8_t val)
{
{
	struct intel_i2c_chan *i2cbus = dvo->i2c_bus;
	struct i2c_adapter *adapter = dvo->i2c_bus;
	struct intel_i2c_chan *i2cbus = container_of(adapter, struct intel_i2c_chan, adapter);
	uint8_t out_buf[2];
	uint8_t out_buf[2];
	struct i2c_msg msg = {
	struct i2c_msg msg = {
		.addr = i2cbus->slave_addr,
		.addr = dvo->slave_addr,
		.flags = 0,
		.flags = 0,
		.len = 2,
		.len = 2,
		.buf = out_buf,
		.buf = out_buf,
@@ -228,8 +230,9 @@ static bool ch7017_write(struct intel_dvo_device *dvo, int addr, uint8_t val)


/** Probes for a CH7017 on the given bus and slave address. */
/** Probes for a CH7017 on the given bus and slave address. */
static bool ch7017_init(struct intel_dvo_device *dvo,
static bool ch7017_init(struct intel_dvo_device *dvo,
			struct intel_i2c_chan *i2cbus)
			struct i2c_adapter *adapter)
{
{
	struct intel_i2c_chan *i2cbus = container_of(adapter, struct intel_i2c_chan, adapter);
	struct ch7017_priv *priv;
	struct ch7017_priv *priv;
	uint8_t val;
	uint8_t val;


@@ -237,8 +240,7 @@ static bool ch7017_init(struct intel_dvo_device *dvo,
	if (priv == NULL)
	if (priv == NULL)
		return false;
		return false;


	dvo->i2c_bus = i2cbus;
	dvo->i2c_bus = adapter;
	dvo->i2c_bus->slave_addr = dvo->slave_addr;
	dvo->dev_priv = priv;
	dvo->dev_priv = priv;


	if (!ch7017_read(dvo, CH7017_DEVICE_ID, &val))
	if (!ch7017_read(dvo, CH7017_DEVICE_ID, &val))
@@ -248,7 +250,7 @@ static bool ch7017_init(struct intel_dvo_device *dvo,
	    val != CH7018_DEVICE_ID_VALUE &&
	    val != CH7018_DEVICE_ID_VALUE &&
	    val != CH7019_DEVICE_ID_VALUE) {
	    val != CH7019_DEVICE_ID_VALUE) {
		DRM_DEBUG("ch701x not detected, got %d: from %s Slave %d.\n",
		DRM_DEBUG("ch701x not detected, got %d: from %s Slave %d.\n",
			  val, i2cbus->adapter.name,i2cbus->slave_addr);
			  val, i2cbus->adapter.name,dvo->slave_addr);
		goto fail;
		goto fail;
	}
	}


+13 −12
Original line number Original line Diff line number Diff line
@@ -123,19 +123,20 @@ static char *ch7xxx_get_id(uint8_t vid)
static bool ch7xxx_readb(struct intel_dvo_device *dvo, int addr, uint8_t *ch)
static bool ch7xxx_readb(struct intel_dvo_device *dvo, int addr, uint8_t *ch)
{
{
	struct ch7xxx_priv *ch7xxx= dvo->dev_priv;
	struct ch7xxx_priv *ch7xxx= dvo->dev_priv;
	struct intel_i2c_chan *i2cbus = dvo->i2c_bus;
	struct i2c_adapter *adapter = dvo->i2c_bus;
	struct intel_i2c_chan *i2cbus = container_of(adapter, struct intel_i2c_chan, adapter);
	u8 out_buf[2];
	u8 out_buf[2];
	u8 in_buf[2];
	u8 in_buf[2];


	struct i2c_msg msgs[] = {
	struct i2c_msg msgs[] = {
		{
		{
			.addr = i2cbus->slave_addr,
			.addr = dvo->slave_addr,
			.flags = 0,
			.flags = 0,
			.len = 1,
			.len = 1,
			.buf = out_buf,
			.buf = out_buf,
		},
		},
		{
		{
			.addr = i2cbus->slave_addr,
			.addr = dvo->slave_addr,
			.flags = I2C_M_RD,
			.flags = I2C_M_RD,
			.len = 1,
			.len = 1,
			.buf = in_buf,
			.buf = in_buf,
@@ -152,7 +153,7 @@ static bool ch7xxx_readb(struct intel_dvo_device *dvo, int addr, uint8_t *ch)


	if (!ch7xxx->quiet) {
	if (!ch7xxx->quiet) {
		DRM_DEBUG("Unable to read register 0x%02x from %s:%02x.\n",
		DRM_DEBUG("Unable to read register 0x%02x from %s:%02x.\n",
			  addr, i2cbus->adapter.name, i2cbus->slave_addr);
			  addr, i2cbus->adapter.name, dvo->slave_addr);
	}
	}
	return false;
	return false;
}
}
@@ -161,10 +162,11 @@ static bool ch7xxx_readb(struct intel_dvo_device *dvo, int addr, uint8_t *ch)
static bool ch7xxx_writeb(struct intel_dvo_device *dvo, int addr, uint8_t ch)
static bool ch7xxx_writeb(struct intel_dvo_device *dvo, int addr, uint8_t ch)
{
{
	struct ch7xxx_priv *ch7xxx = dvo->dev_priv;
	struct ch7xxx_priv *ch7xxx = dvo->dev_priv;
	struct intel_i2c_chan *i2cbus = dvo->i2c_bus;
	struct i2c_adapter *adapter = dvo->i2c_bus;
	struct intel_i2c_chan *i2cbus = container_of(adapter, struct intel_i2c_chan, adapter);
	uint8_t out_buf[2];
	uint8_t out_buf[2];
	struct i2c_msg msg = {
	struct i2c_msg msg = {
		.addr = i2cbus->slave_addr,
		.addr = dvo->slave_addr,
		.flags = 0,
		.flags = 0,
		.len = 2,
		.len = 2,
		.buf = out_buf,
		.buf = out_buf,
@@ -178,14 +180,14 @@ static bool ch7xxx_writeb(struct intel_dvo_device *dvo, int addr, uint8_t ch)


	if (!ch7xxx->quiet) {
	if (!ch7xxx->quiet) {
		DRM_DEBUG("Unable to write register 0x%02x to %s:%d.\n",
		DRM_DEBUG("Unable to write register 0x%02x to %s:%d.\n",
			  addr, i2cbus->adapter.name, i2cbus->slave_addr);
			  addr, i2cbus->adapter.name, dvo->slave_addr);
	}
	}


	return false;
	return false;
}
}


static bool ch7xxx_init(struct intel_dvo_device *dvo,
static bool ch7xxx_init(struct intel_dvo_device *dvo,
			struct intel_i2c_chan *i2cbus)
			struct i2c_adapter *adapter)
{
{
	/* this will detect the CH7xxx chip on the specified i2c bus */
	/* this will detect the CH7xxx chip on the specified i2c bus */
	struct ch7xxx_priv *ch7xxx;
	struct ch7xxx_priv *ch7xxx;
@@ -196,8 +198,7 @@ static bool ch7xxx_init(struct intel_dvo_device *dvo,
	if (ch7xxx == NULL)
	if (ch7xxx == NULL)
		return false;
		return false;


	dvo->i2c_bus = i2cbus;
	dvo->i2c_bus = adapter;
	dvo->i2c_bus->slave_addr = dvo->slave_addr;
	dvo->dev_priv = ch7xxx;
	dvo->dev_priv = ch7xxx;
	ch7xxx->quiet = true;
	ch7xxx->quiet = true;


@@ -207,7 +208,7 @@ static bool ch7xxx_init(struct intel_dvo_device *dvo,
	name = ch7xxx_get_id(vendor);
	name = ch7xxx_get_id(vendor);
	if (!name) {
	if (!name) {
		DRM_DEBUG("ch7xxx not detected; got 0x%02x from %s slave %d.\n",
		DRM_DEBUG("ch7xxx not detected; got 0x%02x from %s slave %d.\n",
			  vendor, i2cbus->adapter.name, i2cbus->slave_addr);
			  vendor, adapter->name, dvo->slave_addr);
		goto out;
		goto out;
	}
	}


@@ -217,7 +218,7 @@ static bool ch7xxx_init(struct intel_dvo_device *dvo,


	if (device != CH7xxx_DID) {
	if (device != CH7xxx_DID) {
		DRM_DEBUG("ch7xxx not detected; got 0x%02x from %s slave %d.\n",
		DRM_DEBUG("ch7xxx not detected; got 0x%02x from %s slave %d.\n",
			  vendor, i2cbus->adapter.name, i2cbus->slave_addr);
			  vendor, adapter->name, dvo->slave_addr);
		goto out;
		goto out;
	}
	}


Loading