diff options
Diffstat (limited to 'drivers/i2c')
| -rw-r--r-- | drivers/i2c/Makefile | 1 | ||||
| -rw-r--r-- | drivers/i2c/busses/Kconfig | 1 | ||||
| -rw-r--r-- | drivers/i2c/busses/Makefile | 1 | ||||
| -rw-r--r-- | drivers/i2c/busses/i2c-i801.c | 4 | ||||
| -rw-r--r-- | drivers/i2c/busses/i2c-img-scb.c | 2 | ||||
| -rw-r--r-- | drivers/i2c/busses/i2c-imx.c | 4 | ||||
| -rw-r--r-- | drivers/i2c/busses/i2c-ismt.c | 5 | ||||
| -rw-r--r-- | drivers/i2c/busses/i2c-octeon-core.h | 1 | ||||
| -rw-r--r-- | drivers/i2c/busses/i2c-omap.c | 14 | ||||
| -rw-r--r-- | drivers/i2c/busses/i2c-piix4.c | 162 | ||||
| -rw-r--r-- | drivers/i2c/busses/i2c-sprd.c | 1 | ||||
| -rw-r--r-- | drivers/i2c/busses/i2c-stm32f7.c | 17 | ||||
| -rw-r--r-- | drivers/i2c/muxes/Makefile | 1 | 
13 files changed, 190 insertions, 24 deletions
| diff --git a/drivers/i2c/Makefile b/drivers/i2c/Makefile index 7bb65a4369e1..72c94c60fdd1 100644 --- a/drivers/i2c/Makefile +++ b/drivers/i2c/Makefile @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0  #  # Makefile for the i2c core.  # diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig index c06dce2c1da7..45a3f3ca29b3 100644 --- a/drivers/i2c/busses/Kconfig +++ b/drivers/i2c/busses/Kconfig @@ -131,6 +131,7 @@ config I2C_I801  	    Gemini Lake (SOC)  	    Cannon Lake-H (PCH)  	    Cannon Lake-LP (PCH) +	    Cedar Fork (PCH)  	  This driver can also be built as a module.  If so, the module  	  will be called i2c-i801. diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile index 47f3ac9a695a..2ce8576540a2 100644 --- a/drivers/i2c/busses/Makefile +++ b/drivers/i2c/busses/Makefile @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0  #  # Makefile for the i2c bus drivers.  # diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c index e114e4e00d29..9e12a53ef7b8 100644 --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c @@ -68,6 +68,7 @@   * Gemini Lake (SOC)		0x31d4	32	hard	yes	yes	yes   * Cannon Lake-H (PCH)		0xa323	32	hard	yes	yes	yes   * Cannon Lake-LP (PCH)		0x9da3	32	hard	yes	yes	yes + * Cedar Fork (PCH)		0x18df	32	hard	yes	yes	yes   *   * Features supported by this driver:   * Software PEC				no @@ -204,6 +205,7 @@  /* Older devices have their ID defined in <linux/pci_ids.h> */  #define PCI_DEVICE_ID_INTEL_BAYTRAIL_SMBUS		0x0f12 +#define PCI_DEVICE_ID_INTEL_CDF_SMBUS			0x18df  #define PCI_DEVICE_ID_INTEL_DNV_SMBUS			0x19df  #define PCI_DEVICE_ID_INTEL_COUGARPOINT_SMBUS		0x1c22  #define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS		0x1d22 @@ -1025,6 +1027,7 @@ static const struct pci_device_id i801_ids[] = {  	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BRASWELL_SMBUS) },  	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SUNRISEPOINT_H_SMBUS) },  	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_SMBUS) }, +	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CDF_SMBUS) },  	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_DNV_SMBUS) },  	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BROXTON_SMBUS) },  	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_LEWISBURG_SMBUS) }, @@ -1513,6 +1516,7 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id)  	case PCI_DEVICE_ID_INTEL_CANNONLAKE_LP_SMBUS:  	case PCI_DEVICE_ID_INTEL_LEWISBURG_SMBUS:  	case PCI_DEVICE_ID_INTEL_LEWISBURG_SSKU_SMBUS: +	case PCI_DEVICE_ID_INTEL_CDF_SMBUS:  	case PCI_DEVICE_ID_INTEL_DNV_SMBUS:  	case PCI_DEVICE_ID_INTEL_KABYLAKE_PCH_H_SMBUS:  		priv->features |= FEATURE_I2C_BLOCK_READ; diff --git a/drivers/i2c/busses/i2c-img-scb.c b/drivers/i2c/busses/i2c-img-scb.c index 84fb35f6837f..eb1d91b986fd 100644 --- a/drivers/i2c/busses/i2c-img-scb.c +++ b/drivers/i2c/busses/i2c-img-scb.c @@ -1459,6 +1459,6 @@ static struct platform_driver img_scb_i2c_driver = {  };  module_platform_driver(img_scb_i2c_driver); -MODULE_AUTHOR("James Hogan <[email protected]>"); +MODULE_AUTHOR("James Hogan <[email protected]>");  MODULE_DESCRIPTION("IMG host I2C driver");  MODULE_LICENSE("GPL v2"); diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index 54a47b40546f..f96830ffd9f1 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c @@ -1021,7 +1021,7 @@ static int i2c_imx_init_recovery_info(struct imx_i2c_struct *i2c_imx,  	}  	dev_dbg(&pdev->dev, "using scl-gpio %d and sda-gpio %d for recovery\n", -			rinfo->sda_gpio, rinfo->scl_gpio); +			rinfo->scl_gpio, rinfo->sda_gpio);  	rinfo->prepare_recovery = i2c_imx_prepare_recovery;  	rinfo->unprepare_recovery = i2c_imx_unprepare_recovery; @@ -1100,7 +1100,7 @@ static int i2c_imx_probe(struct platform_device *pdev)  	}  	/* Request IRQ */ -	ret = devm_request_irq(&pdev->dev, irq, i2c_imx_isr, 0, +	ret = devm_request_irq(&pdev->dev, irq, i2c_imx_isr, IRQF_SHARED,  				pdev->name, i2c_imx);  	if (ret) {  		dev_err(&pdev->dev, "can't claim irq %d\n", irq); diff --git a/drivers/i2c/busses/i2c-ismt.c b/drivers/i2c/busses/i2c-ismt.c index 22ffcb73c185..b51adffa4841 100644 --- a/drivers/i2c/busses/i2c-ismt.c +++ b/drivers/i2c/busses/i2c-ismt.c @@ -340,12 +340,15 @@ static int ismt_process_desc(const struct ismt_desc *desc,  			data->word = dma_buffer[0] | (dma_buffer[1] << 8);  			break;  		case I2C_SMBUS_BLOCK_DATA: -		case I2C_SMBUS_I2C_BLOCK_DATA:  			if (desc->rxbytes != dma_buffer[0] + 1)  				return -EMSGSIZE;  			memcpy(data->block, dma_buffer, desc->rxbytes);  			break; +		case I2C_SMBUS_I2C_BLOCK_DATA: +			memcpy(&data->block[1], dma_buffer, desc->rxbytes); +			data->block[0] = desc->rxbytes; +			break;  		}  		return 0;  	} diff --git a/drivers/i2c/busses/i2c-octeon-core.h b/drivers/i2c/busses/i2c-octeon-core.h index aa3c8f4771c1..a7ef19855bb8 100644 --- a/drivers/i2c/busses/i2c-octeon-core.h +++ b/drivers/i2c/busses/i2c-octeon-core.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */  #include <linux/atomic.h>  #include <linux/clk.h>  #include <linux/delay.h> diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index 1ebb5e947e0b..23c2ea2baedc 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c @@ -360,6 +360,7 @@ static int omap_i2c_init(struct omap_i2c_dev *omap)  	unsigned long fclk_rate = 12000000;  	unsigned long internal_clk = 0;  	struct clk *fclk; +	int error;  	if (omap->rev >= OMAP_I2C_REV_ON_3430_3530) {  		/* @@ -378,6 +379,13 @@ static int omap_i2c_init(struct omap_i2c_dev *omap)  		 * do this bit unconditionally.  		 */  		fclk = clk_get(omap->dev, "fck"); +		if (IS_ERR(fclk)) { +			error = PTR_ERR(fclk); +			dev_err(omap->dev, "could not get fck: %i\n", error); + +			return error; +		} +  		fclk_rate = clk_get_rate(fclk);  		clk_put(fclk); @@ -410,6 +418,12 @@ static int omap_i2c_init(struct omap_i2c_dev *omap)  		else  			internal_clk = 4000;  		fclk = clk_get(omap->dev, "fck"); +		if (IS_ERR(fclk)) { +			error = PTR_ERR(fclk); +			dev_err(omap->dev, "could not get fck: %i\n", error); + +			return error; +		}  		fclk_rate = clk_get_rate(fclk) / 1000;  		clk_put(fclk); diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c index 0ecdb47a23ab..174579d32e5f 100644 --- a/drivers/i2c/busses/i2c-piix4.c +++ b/drivers/i2c/busses/i2c-piix4.c @@ -85,6 +85,9 @@  /* SB800 constants */  #define SB800_PIIX4_SMB_IDX		0xcd6 +#define KERNCZ_IMC_IDX			0x3e +#define KERNCZ_IMC_DATA			0x3f +  /*   * SB800 port is selected by bits 2:1 of the smb_en register (0x2c)   * or the smb_sel register (0x2e), depending on bit 0 of register 0x2f. @@ -94,6 +97,12 @@  #define SB800_PIIX4_PORT_IDX_ALT	0x2e  #define SB800_PIIX4_PORT_IDX_SEL	0x2f  #define SB800_PIIX4_PORT_IDX_MASK	0x06 +#define SB800_PIIX4_PORT_IDX_SHIFT	1 + +/* On kerncz, SmBus0Sel is at bit 20:19 of PMx00 DecodeEn */ +#define SB800_PIIX4_PORT_IDX_KERNCZ		0x02 +#define SB800_PIIX4_PORT_IDX_MASK_KERNCZ	0x18 +#define SB800_PIIX4_PORT_IDX_SHIFT_KERNCZ	3  /* insmod parameters */ @@ -149,6 +158,8 @@ static const struct dmi_system_id piix4_dmi_ibm[] = {   */  static DEFINE_MUTEX(piix4_mutex_sb800);  static u8 piix4_port_sel_sb800; +static u8 piix4_port_mask_sb800; +static u8 piix4_port_shift_sb800;  static const char *piix4_main_port_names_sb800[PIIX4_MAX_ADAPTERS] = {  	" port 0", " port 2", " port 3", " port 4"  }; @@ -159,6 +170,7 @@ struct i2c_piix4_adapdata {  	/* SB800 */  	bool sb800_main; +	bool notify_imc;  	u8 port;		/* Port number, shifted */  }; @@ -347,7 +359,19 @@ static int piix4_setup_sb800(struct pci_dev *PIIX4_dev,  	/* Find which register is used for port selection */  	if (PIIX4_dev->vendor == PCI_VENDOR_ID_AMD) { -		piix4_port_sel_sb800 = SB800_PIIX4_PORT_IDX_ALT; +		switch (PIIX4_dev->device) { +		case PCI_DEVICE_ID_AMD_KERNCZ_SMBUS: +			piix4_port_sel_sb800 = SB800_PIIX4_PORT_IDX_KERNCZ; +			piix4_port_mask_sb800 = SB800_PIIX4_PORT_IDX_MASK_KERNCZ; +			piix4_port_shift_sb800 = SB800_PIIX4_PORT_IDX_SHIFT_KERNCZ; +			break; +		case PCI_DEVICE_ID_AMD_HUDSON2_SMBUS: +		default: +			piix4_port_sel_sb800 = SB800_PIIX4_PORT_IDX_ALT; +			piix4_port_mask_sb800 = SB800_PIIX4_PORT_IDX_MASK; +			piix4_port_shift_sb800 = SB800_PIIX4_PORT_IDX_SHIFT; +			break; +		}  	} else {  		mutex_lock(&piix4_mutex_sb800);  		outb_p(SB800_PIIX4_PORT_IDX_SEL, SB800_PIIX4_SMB_IDX); @@ -355,6 +379,8 @@ static int piix4_setup_sb800(struct pci_dev *PIIX4_dev,  		piix4_port_sel_sb800 = (port_sel & 0x01) ?  				       SB800_PIIX4_PORT_IDX_ALT :  				       SB800_PIIX4_PORT_IDX; +		piix4_port_mask_sb800 = SB800_PIIX4_PORT_IDX_MASK; +		piix4_port_shift_sb800 = SB800_PIIX4_PORT_IDX_SHIFT;  		mutex_unlock(&piix4_mutex_sb800);  	} @@ -572,6 +598,67 @@ static s32 piix4_access(struct i2c_adapter * adap, u16 addr,  	return 0;  } +static uint8_t piix4_imc_read(uint8_t idx) +{ +	outb_p(idx, KERNCZ_IMC_IDX); +	return inb_p(KERNCZ_IMC_DATA); +} + +static void piix4_imc_write(uint8_t idx, uint8_t value) +{ +	outb_p(idx, KERNCZ_IMC_IDX); +	outb_p(value, KERNCZ_IMC_DATA); +} + +static int piix4_imc_sleep(void) +{ +	int timeout = MAX_TIMEOUT; + +	if (!request_muxed_region(KERNCZ_IMC_IDX, 2, "smbus_kerncz_imc")) +		return -EBUSY; + +	/* clear response register */ +	piix4_imc_write(0x82, 0x00); +	/* request ownership flag */ +	piix4_imc_write(0x83, 0xB4); +	/* kick off IMC Mailbox command 96 */ +	piix4_imc_write(0x80, 0x96); + +	while (timeout--) { +		if (piix4_imc_read(0x82) == 0xfa) { +			release_region(KERNCZ_IMC_IDX, 2); +			return 0; +		} +		usleep_range(1000, 2000); +	} + +	release_region(KERNCZ_IMC_IDX, 2); +	return -ETIMEDOUT; +} + +static void piix4_imc_wakeup(void) +{ +	int timeout = MAX_TIMEOUT; + +	if (!request_muxed_region(KERNCZ_IMC_IDX, 2, "smbus_kerncz_imc")) +		return; + +	/* clear response register */ +	piix4_imc_write(0x82, 0x00); +	/* release ownership flag */ +	piix4_imc_write(0x83, 0xB5); +	/* kick off IMC Mailbox command 96 */ +	piix4_imc_write(0x80, 0x96); + +	while (timeout--) { +		if (piix4_imc_read(0x82) == 0xfa) +			break; +		usleep_range(1000, 2000); +	} + +	release_region(KERNCZ_IMC_IDX, 2); +} +  /*   * Handles access to multiple SMBus ports on the SB800.   * The port is selected by bits 2:1 of the smb_en register (0x2c). @@ -612,12 +699,47 @@ static s32 piix4_access_sb800(struct i2c_adapter *adap, u16 addr,  		return -EBUSY;  	} +	/* +	 * Notify the IMC (Integrated Micro Controller) if required. +	 * Among other responsibilities, the IMC is in charge of monitoring +	 * the System fans and temperature sensors, and act accordingly. +	 * All this is done through SMBus and can/will collide +	 * with our transactions if they are long (BLOCK_DATA). +	 * Therefore we need to request the ownership flag during those +	 * transactions. +	 */ +	if ((size == I2C_SMBUS_BLOCK_DATA) && adapdata->notify_imc) { +		int ret; + +		ret = piix4_imc_sleep(); +		switch (ret) { +		case -EBUSY: +			dev_warn(&adap->dev, +				 "IMC base address index region 0x%x already in use.\n", +				 KERNCZ_IMC_IDX); +			break; +		case -ETIMEDOUT: +			dev_warn(&adap->dev, +				 "Failed to communicate with the IMC.\n"); +			break; +		default: +			break; +		} + +		/* If IMC communication fails do not retry */ +		if (ret) { +			dev_warn(&adap->dev, +				 "Continuing without IMC notification.\n"); +			adapdata->notify_imc = false; +		} +	} +  	outb_p(piix4_port_sel_sb800, SB800_PIIX4_SMB_IDX);  	smba_en_lo = inb_p(SB800_PIIX4_SMB_IDX + 1);  	port = adapdata->port; -	if ((smba_en_lo & SB800_PIIX4_PORT_IDX_MASK) != port) -		outb_p((smba_en_lo & ~SB800_PIIX4_PORT_IDX_MASK) | port, +	if ((smba_en_lo & piix4_port_mask_sb800) != port) +		outb_p((smba_en_lo & ~piix4_port_mask_sb800) | port,  		       SB800_PIIX4_SMB_IDX + 1);  	retval = piix4_access(adap, addr, flags, read_write, @@ -628,6 +750,9 @@ static s32 piix4_access_sb800(struct i2c_adapter *adap, u16 addr,  	/* Release the semaphore */  	outb_p(smbslvcnt | 0x20, SMBSLVCNT); +	if ((size == I2C_SMBUS_BLOCK_DATA) && adapdata->notify_imc) +		piix4_imc_wakeup(); +  	mutex_unlock(&piix4_mutex_sb800);  	return retval; @@ -679,7 +804,7 @@ static struct i2c_adapter *piix4_main_adapters[PIIX4_MAX_ADAPTERS];  static struct i2c_adapter *piix4_aux_adapter;  static int piix4_add_adapter(struct pci_dev *dev, unsigned short smba, -			     bool sb800_main, u8 port, +			     bool sb800_main, u8 port, bool notify_imc,  			     const char *name, struct i2c_adapter **padap)  {  	struct i2c_adapter *adap; @@ -706,7 +831,8 @@ static int piix4_add_adapter(struct pci_dev *dev, unsigned short smba,  	adapdata->smba = smba;  	adapdata->sb800_main = sb800_main; -	adapdata->port = port << 1; +	adapdata->port = port << piix4_port_shift_sb800; +	adapdata->notify_imc = notify_imc;  	/* set up the sysfs linkage to our parent device */  	adap->dev.parent = &dev->dev; @@ -728,14 +854,15 @@ static int piix4_add_adapter(struct pci_dev *dev, unsigned short smba,  	return 0;  } -static int piix4_add_adapters_sb800(struct pci_dev *dev, unsigned short smba) +static int piix4_add_adapters_sb800(struct pci_dev *dev, unsigned short smba, +				    bool notify_imc)  {  	struct i2c_piix4_adapdata *adapdata;  	int port;  	int retval;  	for (port = 0; port < PIIX4_MAX_ADAPTERS; port++) { -		retval = piix4_add_adapter(dev, smba, true, port, +		retval = piix4_add_adapter(dev, smba, true, port, notify_imc,  					   piix4_main_port_names_sb800[port],  					   &piix4_main_adapters[port]);  		if (retval < 0) @@ -769,6 +896,7 @@ static int piix4_probe(struct pci_dev *dev, const struct pci_device_id *id)  	     dev->device == PCI_DEVICE_ID_ATI_SBX00_SMBUS &&  	     dev->revision >= 0x40) ||  	    dev->vendor == PCI_VENDOR_ID_AMD) { +		bool notify_imc = false;  		is_sb800 = true;  		if (!request_region(SB800_PIIX4_SMB_IDX, 2, "smba_idx")) { @@ -778,6 +906,20 @@ static int piix4_probe(struct pci_dev *dev, const struct pci_device_id *id)  			return -EBUSY;  		} +		if (dev->vendor == PCI_VENDOR_ID_AMD && +		    dev->device == PCI_DEVICE_ID_AMD_KERNCZ_SMBUS) { +			u8 imc; + +			/* +			 * Detect if IMC is active or not, this method is +			 * described on coreboot's AMD IMC notes +			 */ +			pci_bus_read_config_byte(dev->bus, PCI_DEVFN(0x14, 3), +						 0x40, &imc); +			if (imc & 0x80) +				notify_imc = true; +		} +  		/* base address location etc changed in SB800 */  		retval = piix4_setup_sb800(dev, id, 0);  		if (retval < 0) { @@ -789,7 +931,7 @@ static int piix4_probe(struct pci_dev *dev, const struct pci_device_id *id)  		 * Try to register multiplexed main SMBus adapter,  		 * give up if we can't  		 */ -		retval = piix4_add_adapters_sb800(dev, retval); +		retval = piix4_add_adapters_sb800(dev, retval, notify_imc);  		if (retval < 0) {  			release_region(SB800_PIIX4_SMB_IDX, 2);  			return retval; @@ -800,7 +942,7 @@ static int piix4_probe(struct pci_dev *dev, const struct pci_device_id *id)  			return retval;  		/* Try to register main SMBus adapter, give up if we can't */ -		retval = piix4_add_adapter(dev, retval, false, 0, "", +		retval = piix4_add_adapter(dev, retval, false, 0, false, "",  					   &piix4_main_adapters[0]);  		if (retval < 0)  			return retval; @@ -827,7 +969,7 @@ static int piix4_probe(struct pci_dev *dev, const struct pci_device_id *id)  	if (retval > 0) {  		/* Try to add the aux adapter if it exists,  		 * piix4_add_adapter will clean up if this fails */ -		piix4_add_adapter(dev, retval, false, 0, +		piix4_add_adapter(dev, retval, false, 0, false,  				  is_sb800 ? piix4_aux_port_name_sb800 : "",  				  &piix4_aux_adapter);  	} diff --git a/drivers/i2c/busses/i2c-sprd.c b/drivers/i2c/busses/i2c-sprd.c index 22e08ae1704f..25fcc3c1e32b 100644 --- a/drivers/i2c/busses/i2c-sprd.c +++ b/drivers/i2c/busses/i2c-sprd.c @@ -627,6 +627,7 @@ static const struct dev_pm_ops sprd_i2c_pm_ops = {  static const struct of_device_id sprd_i2c_of_match[] = {  	{ .compatible = "sprd,sc9860-i2c", }, +	{},  };  static struct platform_driver sprd_i2c_driver = { diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c index 47c67b0ca896..d4a6e9c2e9aa 100644 --- a/drivers/i2c/busses/i2c-stm32f7.c +++ b/drivers/i2c/busses/i2c-stm32f7.c @@ -215,7 +215,7 @@ struct stm32f7_i2c_dev {  	unsigned int msg_num;  	unsigned int msg_id;  	struct stm32f7_i2c_msg f7_msg; -	struct stm32f7_i2c_setup *setup; +	struct stm32f7_i2c_setup setup;  	struct stm32f7_i2c_timings timing;  }; @@ -265,7 +265,7 @@ static struct stm32f7_i2c_spec i2c_specs[] = {  	},  }; -struct stm32f7_i2c_setup stm32f7_setup = { +static const struct stm32f7_i2c_setup stm32f7_setup = {  	.rise_time = STM32F7_I2C_RISE_TIME_DEFAULT,  	.fall_time = STM32F7_I2C_FALL_TIME_DEFAULT,  	.dnf = STM32F7_I2C_DNF_DEFAULT, @@ -537,7 +537,7 @@ static void stm32f7_i2c_hw_config(struct stm32f7_i2c_dev *i2c_dev)  	writel_relaxed(timing, i2c_dev->base + STM32F7_I2C_TIMINGR);  	/* Enable I2C */ -	if (i2c_dev->setup->analog_filter) +	if (i2c_dev->setup.analog_filter)  		stm32f7_i2c_clr_bits(i2c_dev->base + STM32F7_I2C_CR1,  				     STM32F7_I2C_CR1_ANFOFF);  	else @@ -887,22 +887,19 @@ static int stm32f7_i2c_probe(struct platform_device *pdev)  	}  	setup = of_device_get_match_data(&pdev->dev); -	i2c_dev->setup->rise_time = setup->rise_time; -	i2c_dev->setup->fall_time = setup->fall_time; -	i2c_dev->setup->dnf = setup->dnf; -	i2c_dev->setup->analog_filter = setup->analog_filter; +	i2c_dev->setup = *setup;  	ret = device_property_read_u32(i2c_dev->dev, "i2c-scl-rising-time-ns",  				       &rise_time);  	if (!ret) -		i2c_dev->setup->rise_time = rise_time; +		i2c_dev->setup.rise_time = rise_time;  	ret = device_property_read_u32(i2c_dev->dev, "i2c-scl-falling-time-ns",  				       &fall_time);  	if (!ret) -		i2c_dev->setup->fall_time = fall_time; +		i2c_dev->setup.fall_time = fall_time; -	ret = stm32f7_i2c_setup_timing(i2c_dev, i2c_dev->setup); +	ret = stm32f7_i2c_setup_timing(i2c_dev, &i2c_dev->setup);  	if (ret)  		goto clk_free; diff --git a/drivers/i2c/muxes/Makefile b/drivers/i2c/muxes/Makefile index 4a67d3199877..6d9d865e8518 100644 --- a/drivers/i2c/muxes/Makefile +++ b/drivers/i2c/muxes/Makefile @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0  #  # Makefile for multiplexer I2C chip drivers. |