aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/gyro
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-12-15 21:06:13 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-15 21:06:13 -0500
commitdab363f938a53ddaee60bfecc1aebdbb3d3af5f0 (patch)
treeccdb11a6e6191ba71fbc7716714c47b79172070d /drivers/iio/gyro
parenta68db9cb858d10820add66682ad4d412f9914288 (diff)
parent17d2c6439be65777245914be354c5a97c76ad246 (diff)
Merge tag 'staging-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging driver updates from Greg KH: "Here's the big staging tree pull request for 3.19-rc1. We continued to delete more lines than were added, always a good thing, but not at a huge rate this release, only about 70k lines removed overall mostly from removing the horrid bcm driver. Lots of normal staging driver cleanups and fixes all over the place, well over a thousand of them, the shortlog shows all the horrid details. The "contentious" thing here is the movement of the Android binder code out of staging into the "real" part of the kernel. This is code that has been stable for a few years now and is working as-is in the tens of millions of devices with no issues. Yes, the code is horrid, and the userspace api leaves a lot to be desired, but it's not going to change due to legacy issues that we have no control over. Because so many devices and companies rely on this, and the code is stable, might as well promote it out of staging. This was all discussed at the Linux Plumbers conference, and everyone participating agreed that this was the best way forward. There is work happening to replace the binder code with something new that is happening right now, but I don't expect to see the results of that work for another year at the earliest. If that ever happens, and Android switches over to it, I'll gladly remove this version. As for maintainers, I'll be glad to maintain this code, I've been doing it for the past few years with no problems. I'll send a MAINTAINERS entry for it before 3.19-final is out, still need to talk to the Google developers about if they are willing to help with it or not, last I checked they were, which was good. All of these patches have been in linux-next for a while with no reported issues" * tag 'staging-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (1382 commits) Staging: slicoss: Fix long line issues in slicoss.c staging: rtl8712: remove unnecessary else after return staging: comedi: change some printk calls to pr_err staging: rtl8723au: hal: Removed the extra semicolon lustre: Deletion of unnecessary checks before three function calls staging: lustre: fix sparse warnings: static function declaration staging: lustre: fixed sparse warnings related to static declarations staging: unisys: remove duplicate header staging: unisys: remove unneeded structure staging: ft1000 : replace __attribute ((__packed__) with __packed drivers: staging: rtl8192e: Include "asm/unaligned.h" instead of "access_ok.h" in "rtl819x_BAProc.c" Drivers:staging:rtl8192e: Fixed checkpatch warning Drivers:staging:clocking-wizard: Added a newline staging: clocking-wizard: check for a valid clk_name pointer staging: rtl8723au: Hal_InitPGData() avoid unnecessary typecasts staging: rtl8723au: _DisableAnalog(): Avoid zero-init variables unnecessarily staging: rtl8723au: Remove unnecessary wrapper _ResetDigitalProcedure1() staging: rtl8723au: _ResetDigitalProcedure1_92C() reduce code obfuscation staging: rtl8723au: Remove unnecessary wrapper _DisableRFAFEAndResetBB() staging: rtl8723au: _DisableRFAFEAndResetBB8192C(): Reduce code obfuscation ...
Diffstat (limited to 'drivers/iio/gyro')
-rw-r--r--drivers/iio/gyro/st_gyro.h3
-rw-r--r--drivers/iio/gyro/st_gyro_core.c19
-rw-r--r--drivers/iio/gyro/st_gyro_i2c.c4
-rw-r--r--drivers/iio/gyro/st_gyro_spi.c4
4 files changed, 13 insertions, 17 deletions
diff --git a/drivers/iio/gyro/st_gyro.h b/drivers/iio/gyro/st_gyro.h
index c197360c450b..5353d6328c54 100644
--- a/drivers/iio/gyro/st_gyro.h
+++ b/drivers/iio/gyro/st_gyro.h
@@ -30,8 +30,7 @@ static const struct st_sensors_platform_data gyro_pdata = {
30 .drdy_int_pin = 2, 30 .drdy_int_pin = 2,
31}; 31};
32 32
33int st_gyro_common_probe(struct iio_dev *indio_dev, 33int st_gyro_common_probe(struct iio_dev *indio_dev);
34 struct st_sensors_platform_data *pdata);
35void st_gyro_common_remove(struct iio_dev *indio_dev); 34void st_gyro_common_remove(struct iio_dev *indio_dev);
36 35
37#ifdef CONFIG_IIO_BUFFER 36#ifdef CONFIG_IIO_BUFFER
diff --git a/drivers/iio/gyro/st_gyro_core.c b/drivers/iio/gyro/st_gyro_core.c
index f156fc6c5c6c..f07a2336f7dc 100644
--- a/drivers/iio/gyro/st_gyro_core.c
+++ b/drivers/iio/gyro/st_gyro_core.c
@@ -103,7 +103,7 @@ static const struct iio_chan_spec st_gyro_16bit_channels[] = {
103 IIO_CHAN_SOFT_TIMESTAMP(3) 103 IIO_CHAN_SOFT_TIMESTAMP(3)
104}; 104};
105 105
106static const struct st_sensors st_gyro_sensors[] = { 106static const struct st_sensor_settings st_gyro_sensors_settings[] = {
107 { 107 {
108 .wai = ST_GYRO_1_WAI_EXP, 108 .wai = ST_GYRO_1_WAI_EXP,
109 .sensors_supported = { 109 .sensors_supported = {
@@ -309,8 +309,7 @@ static const struct iio_trigger_ops st_gyro_trigger_ops = {
309#define ST_GYRO_TRIGGER_OPS NULL 309#define ST_GYRO_TRIGGER_OPS NULL
310#endif 310#endif
311 311
312int st_gyro_common_probe(struct iio_dev *indio_dev, 312int st_gyro_common_probe(struct iio_dev *indio_dev)
313 struct st_sensors_platform_data *pdata)
314{ 313{
315 struct st_sensor_data *gdata = iio_priv(indio_dev); 314 struct st_sensor_data *gdata = iio_priv(indio_dev);
316 int irq = gdata->get_irq_data_ready(indio_dev); 315 int irq = gdata->get_irq_data_ready(indio_dev);
@@ -322,20 +321,22 @@ int st_gyro_common_probe(struct iio_dev *indio_dev,
322 st_sensors_power_enable(indio_dev); 321 st_sensors_power_enable(indio_dev);
323 322
324 err = st_sensors_check_device_support(indio_dev, 323 err = st_sensors_check_device_support(indio_dev,
325 ARRAY_SIZE(st_gyro_sensors), st_gyro_sensors); 324 ARRAY_SIZE(st_gyro_sensors_settings),
325 st_gyro_sensors_settings);
326 if (err < 0) 326 if (err < 0)
327 return err; 327 return err;
328 328
329 gdata->num_data_channels = ST_GYRO_NUMBER_DATA_CHANNELS; 329 gdata->num_data_channels = ST_GYRO_NUMBER_DATA_CHANNELS;
330 gdata->multiread_bit = gdata->sensor->multi_read_bit; 330 gdata->multiread_bit = gdata->sensor_settings->multi_read_bit;
331 indio_dev->channels = gdata->sensor->ch; 331 indio_dev->channels = gdata->sensor_settings->ch;
332 indio_dev->num_channels = ST_SENSORS_NUMBER_ALL_CHANNELS; 332 indio_dev->num_channels = ST_SENSORS_NUMBER_ALL_CHANNELS;
333 333
334 gdata->current_fullscale = (struct st_sensor_fullscale_avl *) 334 gdata->current_fullscale = (struct st_sensor_fullscale_avl *)
335 &gdata->sensor->fs.fs_avl[0]; 335 &gdata->sensor_settings->fs.fs_avl[0];
336 gdata->odr = gdata->sensor->odr.odr_avl[0].hz; 336 gdata->odr = gdata->sensor_settings->odr.odr_avl[0].hz;
337 337
338 err = st_sensors_init_sensor(indio_dev, pdata); 338 err = st_sensors_init_sensor(indio_dev,
339 (struct st_sensors_platform_data *)&gyro_pdata);
339 if (err < 0) 340 if (err < 0)
340 return err; 341 return err;
341 342
diff --git a/drivers/iio/gyro/st_gyro_i2c.c b/drivers/iio/gyro/st_gyro_i2c.c
index 8fa0ad2ef4ef..64480b16c689 100644
--- a/drivers/iio/gyro/st_gyro_i2c.c
+++ b/drivers/iio/gyro/st_gyro_i2c.c
@@ -67,13 +67,11 @@ static int st_gyro_i2c_probe(struct i2c_client *client,
67 return -ENOMEM; 67 return -ENOMEM;
68 68
69 gdata = iio_priv(indio_dev); 69 gdata = iio_priv(indio_dev);
70 gdata->dev = &client->dev;
71 st_sensors_of_i2c_probe(client, st_gyro_of_match); 70 st_sensors_of_i2c_probe(client, st_gyro_of_match);
72 71
73 st_sensors_i2c_configure(indio_dev, client, gdata); 72 st_sensors_i2c_configure(indio_dev, client, gdata);
74 73
75 err = st_gyro_common_probe(indio_dev, 74 err = st_gyro_common_probe(indio_dev);
76 (struct st_sensors_platform_data *)&gyro_pdata);
77 if (err < 0) 75 if (err < 0)
78 return err; 76 return err;
79 77
diff --git a/drivers/iio/gyro/st_gyro_spi.c b/drivers/iio/gyro/st_gyro_spi.c
index b4ad3be26687..e59bead6bc3c 100644
--- a/drivers/iio/gyro/st_gyro_spi.c
+++ b/drivers/iio/gyro/st_gyro_spi.c
@@ -29,12 +29,10 @@ static int st_gyro_spi_probe(struct spi_device *spi)
29 return -ENOMEM; 29 return -ENOMEM;
30 30
31 gdata = iio_priv(indio_dev); 31 gdata = iio_priv(indio_dev);
32 gdata->dev = &spi->dev;
33 32
34 st_sensors_spi_configure(indio_dev, spi, gdata); 33 st_sensors_spi_configure(indio_dev, spi, gdata);
35 34
36 err = st_gyro_common_probe(indio_dev, 35 err = st_gyro_common_probe(indio_dev);
37 (struct st_sensors_platform_data *)&gyro_pdata);
38 if (err < 0) 36 if (err < 0)
39 return err; 37 return err;
40 38