forked from mirrors/linux
		
	iio: st-accel: add support for lsm303agr accelerometer
This adds support for the lsm303agr accelerometer. Signed-off-by: Giuseppe Barba <giuseppe.barba@st.com> Acked-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:
		
							parent
							
								
									74f5683f35
								
							
						
					
					
						commit
						ddc05fa286
					
				
					 5 changed files with 9 additions and 0 deletions
				
			
		| 
						 | 
					@ -35,6 +35,7 @@ Accelerometers:
 | 
				
			||||||
- st,lsm303dl-accel
 | 
					- st,lsm303dl-accel
 | 
				
			||||||
- st,lsm303dlm-accel
 | 
					- st,lsm303dlm-accel
 | 
				
			||||||
- st,lsm330-accel
 | 
					- st,lsm330-accel
 | 
				
			||||||
 | 
					- st,lsm303agr-accel
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Gyroscopes:
 | 
					Gyroscopes:
 | 
				
			||||||
- st,l3g4200d-gyro
 | 
					- st,l3g4200d-gyro
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -26,6 +26,7 @@
 | 
				
			||||||
#define LSM303DLH_ACCEL_DEV_NAME	"lsm303dlh_accel"
 | 
					#define LSM303DLH_ACCEL_DEV_NAME	"lsm303dlh_accel"
 | 
				
			||||||
#define LSM303DLM_ACCEL_DEV_NAME	"lsm303dlm_accel"
 | 
					#define LSM303DLM_ACCEL_DEV_NAME	"lsm303dlm_accel"
 | 
				
			||||||
#define LSM330_ACCEL_DEV_NAME		"lsm330_accel"
 | 
					#define LSM330_ACCEL_DEV_NAME		"lsm330_accel"
 | 
				
			||||||
 | 
					#define LSM303AGR_ACCEL_DEV_NAME	"lsm303agr_accel"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
* struct st_sensors_platform_data - default accel platform data
 | 
					* struct st_sensors_platform_data - default accel platform data
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -233,6 +233,7 @@ static const struct st_sensor_settings st_accel_sensors_settings[] = {
 | 
				
			||||||
			[2] = LSM330D_ACCEL_DEV_NAME,
 | 
								[2] = LSM330D_ACCEL_DEV_NAME,
 | 
				
			||||||
			[3] = LSM330DL_ACCEL_DEV_NAME,
 | 
								[3] = LSM330DL_ACCEL_DEV_NAME,
 | 
				
			||||||
			[4] = LSM330DLC_ACCEL_DEV_NAME,
 | 
								[4] = LSM330DLC_ACCEL_DEV_NAME,
 | 
				
			||||||
 | 
								[5] = LSM303AGR_ACCEL_DEV_NAME,
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
		.ch = (struct iio_chan_spec *)st_accel_12bit_channels,
 | 
							.ch = (struct iio_chan_spec *)st_accel_12bit_channels,
 | 
				
			||||||
		.odr = {
 | 
							.odr = {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -68,6 +68,10 @@ static const struct of_device_id st_accel_of_match[] = {
 | 
				
			||||||
		.compatible = "st,lsm330-accel",
 | 
							.compatible = "st,lsm330-accel",
 | 
				
			||||||
		.data = LSM330_ACCEL_DEV_NAME,
 | 
							.data = LSM330_ACCEL_DEV_NAME,
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							.compatible = "st,lsm303agr-accel",
 | 
				
			||||||
 | 
							.data = LSM303AGR_ACCEL_DEV_NAME,
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	{},
 | 
						{},
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
MODULE_DEVICE_TABLE(of, st_accel_of_match);
 | 
					MODULE_DEVICE_TABLE(of, st_accel_of_match);
 | 
				
			||||||
| 
						 | 
					@ -116,6 +120,7 @@ static const struct i2c_device_id st_accel_id_table[] = {
 | 
				
			||||||
	{ LSM303DL_ACCEL_DEV_NAME },
 | 
						{ LSM303DL_ACCEL_DEV_NAME },
 | 
				
			||||||
	{ LSM303DLM_ACCEL_DEV_NAME },
 | 
						{ LSM303DLM_ACCEL_DEV_NAME },
 | 
				
			||||||
	{ LSM330_ACCEL_DEV_NAME },
 | 
						{ LSM330_ACCEL_DEV_NAME },
 | 
				
			||||||
 | 
						{ LSM303AGR_ACCEL_DEV_NAME },
 | 
				
			||||||
	{},
 | 
						{},
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
MODULE_DEVICE_TABLE(i2c, st_accel_id_table);
 | 
					MODULE_DEVICE_TABLE(i2c, st_accel_id_table);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -57,6 +57,7 @@ static const struct spi_device_id st_accel_id_table[] = {
 | 
				
			||||||
	{ LSM303DL_ACCEL_DEV_NAME },
 | 
						{ LSM303DL_ACCEL_DEV_NAME },
 | 
				
			||||||
	{ LSM303DLM_ACCEL_DEV_NAME },
 | 
						{ LSM303DLM_ACCEL_DEV_NAME },
 | 
				
			||||||
	{ LSM330_ACCEL_DEV_NAME },
 | 
						{ LSM330_ACCEL_DEV_NAME },
 | 
				
			||||||
 | 
						{ LSM303AGR_ACCEL_DEV_NAME },
 | 
				
			||||||
	{},
 | 
						{},
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
MODULE_DEVICE_TABLE(spi, st_accel_id_table);
 | 
					MODULE_DEVICE_TABLE(spi, st_accel_id_table);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue