Re: [RFC 3/8] iio: bmc150: refactor interrupt enabling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 24, 2014 at 12:02 AM, Hartmut Knaack <knaack.h@xxxxxx> wrote:

>> +static int bmc150_accel_set_interrupt(struct bmc150_accel_data *data,
>> +                                   struct bmc150_accel_interrupt_info *info,
>> +                                   bool state)
>> +{
>> +     int ret;
>> +
>> +     /*
>> +      * We will expect the enable and disable to do operation in
>> +      * in reverse order. This will happen here anyway as our
>> +      * resume operation uses sync mode runtime pm calls, the
>> +      * suspend operation will be delayed by autosuspend delay
>> +      * So the disable operation will still happen in reverse of
>> +      * enable operation. When runtime pm is disabled the mode
>> +      * is always on so sequence doesn't matter
>> +      */
>> +     ret = bmc150_accel_set_power_state(data, state);
>> +     if (ret < 0)
>> +             return ret;
>> +
>> +
>> +     /* map the interrupt to the appropriate pins */
>> +     if (info->map_reg) {
> So, info->map_reg might be set, but info->en_reg will always be set?

Good catch, originally I thought map_reg may not be needed, but it
looks like it is not needed after all. I will remove the if in the
next version.

>> +
>> +static int bmc150_accel_setup_any_motion_interrupt(
>> +                                     struct bmc150_accel_data *data,
>> +                                     bool status)
>> +{
>> +     return bmc150_accel_set_interrupt(data, &bmc150_accel_interrupts[1],
>> +                                       status);
>> +}
>> +
>> +static int bmc150_accel_setup_new_data_interrupt(struct bmc150_accel_data *data,
>> +                                        bool status)
>> +{
>> +     return bmc150_accel_set_interrupt(data, &bmc150_accel_interrupts[0],
>> +                                       status);
>> +}
>> +
> I don't think these wrappers really provide a benefit.

They are removed in one of the later patches. I wanted to keep this
patch small, hence I kept the two original functions in this patch.
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux