diff options
Diffstat (limited to 'drivers/i2c')
| -rw-r--r-- | drivers/i2c/busses/i2c-altera.c | 9 | ||||
| -rw-r--r-- | drivers/i2c/busses/i2c-amd-mp2-pci.c | 2 | ||||
| -rw-r--r-- | drivers/i2c/busses/i2c-aspeed.c | 5 | ||||
| -rw-r--r-- | drivers/i2c/busses/i2c-bcm-iproc.c | 3 | ||||
| -rw-r--r-- | drivers/i2c/busses/i2c-designware-platdrv.c | 14 | ||||
| -rw-r--r-- | drivers/i2c/i2c-core-base.c | 13 | 
6 files changed, 22 insertions, 24 deletions
| diff --git a/drivers/i2c/busses/i2c-altera.c b/drivers/i2c/busses/i2c-altera.c index 20ef63820c77..f5c00f903df3 100644 --- a/drivers/i2c/busses/i2c-altera.c +++ b/drivers/i2c/busses/i2c-altera.c @@ -384,7 +384,6 @@ static int altr_i2c_probe(struct platform_device *pdev)  	struct altr_i2c_dev *idev = NULL;  	struct resource *res;  	int irq, ret; -	u32 val;  	idev = devm_kzalloc(&pdev->dev, sizeof(*idev), GFP_KERNEL);  	if (!idev) @@ -411,17 +410,17 @@ static int altr_i2c_probe(struct platform_device *pdev)  	init_completion(&idev->msg_complete);  	spin_lock_init(&idev->lock); -	val = device_property_read_u32(idev->dev, "fifo-size", +	ret = device_property_read_u32(idev->dev, "fifo-size",  				       &idev->fifo_size); -	if (val) { +	if (ret) {  		dev_err(&pdev->dev, "FIFO size set to default of %d\n",  			ALTR_I2C_DFLT_FIFO_SZ);  		idev->fifo_size = ALTR_I2C_DFLT_FIFO_SZ;  	} -	val = device_property_read_u32(idev->dev, "clock-frequency", +	ret = device_property_read_u32(idev->dev, "clock-frequency",  				       &idev->bus_clk_rate); -	if (val) { +	if (ret) {  		dev_err(&pdev->dev, "Default to 100kHz\n");  		idev->bus_clk_rate = I2C_MAX_STANDARD_MODE_FREQ;	/* default clock rate */  	} diff --git a/drivers/i2c/busses/i2c-amd-mp2-pci.c b/drivers/i2c/busses/i2c-amd-mp2-pci.c index 5e4800d72e00..cd3fd5ee5f65 100644 --- a/drivers/i2c/busses/i2c-amd-mp2-pci.c +++ b/drivers/i2c/busses/i2c-amd-mp2-pci.c @@ -349,12 +349,12 @@ static int amd_mp2_pci_probe(struct pci_dev *pci_dev,  	if (!privdata)  		return -ENOMEM; +	privdata->pci_dev = pci_dev;  	rc = amd_mp2_pci_init(privdata, pci_dev);  	if (rc)  		return rc;  	mutex_init(&privdata->c2p_lock); -	privdata->pci_dev = pci_dev;  	pm_runtime_set_autosuspend_delay(&pci_dev->dev, 1000);  	pm_runtime_use_autosuspend(&pci_dev->dev); diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c index 07c1993274c5..f51702d86a90 100644 --- a/drivers/i2c/busses/i2c-aspeed.c +++ b/drivers/i2c/busses/i2c-aspeed.c @@ -603,6 +603,7 @@ static irqreturn_t aspeed_i2c_bus_irq(int irq, void *dev_id)  	/* Ack all interrupts except for Rx done */  	writel(irq_received & ~ASPEED_I2CD_INTR_RX_DONE,  	       bus->base + ASPEED_I2C_INTR_STS_REG); +	readl(bus->base + ASPEED_I2C_INTR_STS_REG);  	irq_remaining = irq_received;  #if IS_ENABLED(CONFIG_I2C_SLAVE) @@ -645,9 +646,11 @@ static irqreturn_t aspeed_i2c_bus_irq(int irq, void *dev_id)  			irq_received, irq_handled);  	/* Ack Rx done */ -	if (irq_received & ASPEED_I2CD_INTR_RX_DONE) +	if (irq_received & ASPEED_I2CD_INTR_RX_DONE) {  		writel(ASPEED_I2CD_INTR_RX_DONE,  		       bus->base + ASPEED_I2C_INTR_STS_REG); +		readl(bus->base + ASPEED_I2C_INTR_STS_REG); +	}  	spin_unlock(&bus->lock);  	return irq_remaining ? IRQ_NONE : IRQ_HANDLED;  } diff --git a/drivers/i2c/busses/i2c-bcm-iproc.c b/drivers/i2c/busses/i2c-bcm-iproc.c index 44be0926b566..d091a12596ad 100644 --- a/drivers/i2c/busses/i2c-bcm-iproc.c +++ b/drivers/i2c/busses/i2c-bcm-iproc.c @@ -360,6 +360,9 @@ static bool bcm_iproc_i2c_slave_isr(struct bcm_iproc_i2c_dev *iproc_i2c,  			value = (u8)((val >> S_RX_DATA_SHIFT) & S_RX_DATA_MASK);  			i2c_slave_event(iproc_i2c->slave,  					I2C_SLAVE_WRITE_RECEIVED, &value); +			if (rx_status == I2C_SLAVE_RX_END) +				i2c_slave_event(iproc_i2c->slave, +						I2C_SLAVE_STOP, &value);  		}  	} else if (status & BIT(IS_S_TX_UNDERRUN_SHIFT)) {  		/* Master read other than start */ diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c index c98befe2a92e..5536673060cc 100644 --- a/drivers/i2c/busses/i2c-designware-platdrv.c +++ b/drivers/i2c/busses/i2c-designware-platdrv.c @@ -354,10 +354,16 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)  	adap->dev.of_node = pdev->dev.of_node;  	adap->nr = -1; -	dev_pm_set_driver_flags(&pdev->dev, -				DPM_FLAG_SMART_PREPARE | -				DPM_FLAG_SMART_SUSPEND | -				DPM_FLAG_LEAVE_SUSPENDED); +	if (dev->flags & ACCESS_NO_IRQ_SUSPEND) { +		dev_pm_set_driver_flags(&pdev->dev, +					DPM_FLAG_SMART_PREPARE | +					DPM_FLAG_LEAVE_SUSPENDED); +	} else { +		dev_pm_set_driver_flags(&pdev->dev, +					DPM_FLAG_SMART_PREPARE | +					DPM_FLAG_SMART_SUSPEND | +					DPM_FLAG_LEAVE_SUSPENDED); +	}  	/* The code below assumes runtime PM to be disabled. */  	WARN_ON(pm_runtime_enabled(&pdev->dev)); diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index 5cc0b0ec5570..a66912782064 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -2273,19 +2273,6 @@ i2c_new_scanned_device(struct i2c_adapter *adap,  }  EXPORT_SYMBOL_GPL(i2c_new_scanned_device); -struct i2c_client * -i2c_new_probed_device(struct i2c_adapter *adap, -		      struct i2c_board_info *info, -		      unsigned short const *addr_list, -		      int (*probe)(struct i2c_adapter *adap, unsigned short addr)) -{ -	struct i2c_client *client; - -	client = i2c_new_scanned_device(adap, info, addr_list, probe); -	return IS_ERR(client) ? NULL : client; -} -EXPORT_SYMBOL_GPL(i2c_new_probed_device); -  struct i2c_adapter *i2c_get_adapter(int nr)  {  	struct i2c_adapter *adapter; |