From: Adriana Reus <adriana.reus@intel.com>
To: Lucas De Marchi <lucas.de.marchi@gmail.com>
Cc: jic23@kernel.org, linux-iio@vger.kernel.org,
srinivas.pandruvada@linux.intel.com, ggao@invensense.com,
Michael Welling <mwelling@ieee.org>,
lars@metafoo.de, Daniel Baluta <daniel.baluta@intel.com>,
adi.reus@gmail.com, cmo@melexis.com
Subject: Re: [PATCH v4 4/4] iio: imu: inv_mpu6050: Add SPI support for MPU6000
Date: Thu, 11 Feb 2016 10:31:19 +0200 [thread overview]
Message-ID: <56BC46D7.2020503@intel.com> (raw)
In-Reply-To: <CAKi4VAJJN0zf+tdo6ZRgh1_A8g4wtEBkU0W4+8h7OQYvQBSHLw@mail.gmail.com>
On 11.02.2016 07:39, Lucas De Marchi wrote:
> Hi Adriana,
>
> On Wed, Feb 10, 2016 at 12:41 PM, Adriana Reus <adriana.reus@intel.com> wrote:
>> -int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name)
>> +int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name,
>> + int (*inv_mpu_bus_setup)(struct iio_dev *))
>> {
>> struct inv_mpu6050_state *st;
>> struct iio_dev *indio_dev;
>> @@ -700,6 +702,9 @@ int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name)
>> if (result)
>> return result;
>>
>> + if (inv_mpu_bus_setup)
>> + inv_mpu_bus_setup(indio_dev);
>
> ok
>
>> +static int inv_mpu_i2c_disable(struct iio_dev *indio_dev)
>> +{
>> + struct inv_mpu6050_state *st = iio_priv(indio_dev);
>> + int ret = 0;
>> +
>> + ret = inv_mpu6050_set_power_itg(st, true);
>> + if (ret)
>> + return ret;
>> +
>> + ret = regmap_write(st->map, INV_MPU6050_REG_USER_CTRL,
>> + INV_MPU6050_BIT_I2C_IF_DIS);
>> + if (ret) {
>> + inv_mpu6050_set_power_itg(st, false);
>> + return ret;
>> + }
>
> ok
>
>> +static int inv_mpu_probe(struct spi_device *spi)
>> +{
>> + struct regmap *regmap;
>> + const struct spi_device_id *id = spi_get_device_id(spi);
>> + const char *name = id ? id->name : NULL;
>> + int result;
>> +
>> + regmap = devm_regmap_init_spi(spi, &inv_mpu_regmap_config);
>> + if (IS_ERR(regmap)) {
>> + dev_err(&spi->dev, "Failed to register spi regmap %d\n",
>> + (int)PTR_ERR(regmap));
>> + return PTR_ERR(regmap);
>> + }
>> +
>> + result = regmap_write(regmap, INV_MPU6050_REG_USER_CTRL,
>> + INV_MPU6050_BIT_I2C_IF_DIS);
>> + if (result) {
>> + dev_err(&spi->dev, "Failed to disable I2C interface\n");
>> + return result;
>> + }
>
> leftover from previous patch?
indeed... thanks
>
>
> Lucas De Marchi
>
prev parent reply other threads:[~2016-02-11 8:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-10 14:41 [PATCH v4 0/4] iio: imu: inv_mpu6050: Split driver into core and I2C/SPI functionality Adriana Reus
2016-02-10 14:41 ` [PATCH v4 1/4] iio: imu: inv-mpu6050: Fix interrupt pin configuration Adriana Reus
2016-02-10 14:41 ` [PATCH v4 2/4] iio: imu: inv_mpu6050: Use regmap instead of i2c specific functions Adriana Reus
2016-02-10 14:41 ` [PATCH v4 3/4] iio: imu: inv_mpu6050: Separate driver into core and i2c functionality Adriana Reus
2016-02-10 14:41 ` [PATCH v4 4/4] iio: imu: inv_mpu6050: Add SPI support for MPU6000 Adriana Reus
2016-02-11 5:39 ` Lucas De Marchi
2016-02-11 8:31 ` Adriana Reus [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56BC46D7.2020503@intel.com \
--to=adriana.reus@intel.com \
--cc=adi.reus@gmail.com \
--cc=cmo@melexis.com \
--cc=daniel.baluta@intel.com \
--cc=ggao@invensense.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=lucas.de.marchi@gmail.com \
--cc=mwelling@ieee.org \
--cc=srinivas.pandruvada@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.