Re: [PATCH 1/1] iio: accel: bma400: add PM_SLEEP support

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

 



On Wed, Jul 15, 2020 at 8:05 AM Dan Robertson <dan@xxxxxxxxxxxxxxx> wrote:
>
>  - Add system sleep ops if CONFIG_PM_SLEEP is set.
>  - Add attribute for setting the power mode of the
>    device.

...

> -static const struct iio_chan_spec_ext_info bma400_ext_info[] = {

> -};
> -
> -#define BMA400_ACC_CHANNEL(_axis) { \

> -}
> -
> -static const struct iio_chan_spec bma400_channels[] = {

> -};
> -

I'm not sure how this part is related.

...

> +static const char * const bma400_power_modes[] = {
> +       "sleep",
> +       "low-power",
> +       "normal"

Missed comma.

> +};

...

> +#ifdef CONFIG_PM_SLEEP

__maybe_unused looks better.

> +static int bma400_suspend(struct device *dev)
> +{

> +}
> +
> +static int bma400_resume(struct device *dev)
> +{

> +}
> +#endif
> +
> +const struct dev_pm_ops bma400_pm_ops = {

> +#ifdef CONFIG_PM_SLEEP

Why?

> +       SET_SYSTEM_SLEEP_PM_OPS(bma400_suspend, bma400_resume)
> +#endif
> +};
> +EXPORT_SYMBOL(bma400_pm_ops);

...

>         .driver = {
>                 .name = "bma400",
>                 .of_match_table = bma400_of_i2c_match,
> +               .pm = &bma400_pm_ops

Missed comma.

>         },

...

>         .driver = {
>                 .name = "bma400",
>                 .of_match_table = bma400_of_spi_match,
> +               .pm = &bma400_pm_ops

Ditto.

>         },

-- 
With Best Regards,
Andy Shevchenko



[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