HW23: Use new I2C DM interface
With yocto update to dunfell release, this config is not allowed anymore and the code must use the new I2C DM interface. BugzID: 69636
This commit is contained in:
		
							parent
							
								
									14a5c2a688
								
							
						
					
					
						commit
						ec54da360d
					
				
							
								
								
									
										12
									
								
								cmd/eeprom.c
								
								
								
								
							
							
						
						
									
										12
									
								
								cmd/eeprom.c
								
								
								
								
							| 
						 | 
					@ -24,6 +24,7 @@
 | 
				
			||||||
#include <config.h>
 | 
					#include <config.h>
 | 
				
			||||||
#include <command.h>
 | 
					#include <command.h>
 | 
				
			||||||
#include <i2c.h>
 | 
					#include <i2c.h>
 | 
				
			||||||
 | 
					#include <dm/uclass.h>
 | 
				
			||||||
#include <eeprom_layout.h>
 | 
					#include <eeprom_layout.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifndef	CONFIG_SYS_I2C_SPEED
 | 
					#ifndef	CONFIG_SYS_I2C_SPEED
 | 
				
			||||||
| 
						 | 
					@ -138,14 +139,15 @@ static int eeprom_rw_block(unsigned offset, uchar *addr, unsigned alen,
 | 
				
			||||||
		spi_write(addr, alen, buffer, len);
 | 
							spi_write(addr, alen, buffer, len);
 | 
				
			||||||
#else	/* I2C */
 | 
					#else	/* I2C */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if defined(CONFIG_SYS_I2C_EEPROM_BUS)
 | 
					 | 
				
			||||||
	i2c_set_bus_num(CONFIG_SYS_I2C_EEPROM_BUS);
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						struct udevice* bus;
 | 
				
			||||||
 | 
						uclass_get_device_by_seq(UCLASS_I2C, CONFIG_SYS_I2C_EEPROM_BUS, &bus);
 | 
				
			||||||
 | 
						struct udevice *chip;
 | 
				
			||||||
 | 
						i2c_get_chip(bus, addr[0], offset, &chip);
 | 
				
			||||||
	if (read)
 | 
						if (read)
 | 
				
			||||||
		ret = i2c_read(addr[0], offset, alen - 1, buffer, len);
 | 
							ret = dm_i2c_read(chip, alen - 1, buffer, len);
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		ret = i2c_write(addr[0], offset, alen - 1, buffer, len);
 | 
							ret = dm_i2c_write(chip, alen - 1, buffer, len);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (ret)
 | 
						if (ret)
 | 
				
			||||||
		ret = 1;
 | 
							ret = 1;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -36,7 +36,6 @@ CONFIG_ENV_IS_IN_MMC=y
 | 
				
			||||||
CONFIG_DM_GPIO=y
 | 
					CONFIG_DM_GPIO=y
 | 
				
			||||||
CONFIG_DM_PCA953X=y
 | 
					CONFIG_DM_PCA953X=y
 | 
				
			||||||
CONFIG_DM_I2C=y
 | 
					CONFIG_DM_I2C=y
 | 
				
			||||||
CONFIG_DM_I2C_COMPAT=y
 | 
					 | 
				
			||||||
CONFIG_I2C_SET_DEFAULT_BUS_NUM=y
 | 
					CONFIG_I2C_SET_DEFAULT_BUS_NUM=y
 | 
				
			||||||
CONFIG_I2C_DEFAULT_BUS_NUMBER=3
 | 
					CONFIG_I2C_DEFAULT_BUS_NUMBER=3
 | 
				
			||||||
CONFIG_SYS_I2C_IMX_LPI2C=y
 | 
					CONFIG_SYS_I2C_IMX_LPI2C=y
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue