Skip to content

Commit

Permalink
hack: call disable_irq on suspend and enable_irq on resume
Browse files Browse the repository at this point in the history
  • Loading branch information
NeroReflex committed Jun 7, 2024
1 parent eb2e814 commit ab9de5b
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions drivers/iio/imu/bmi323/bmi323_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2160,6 +2160,18 @@ static int bmi323_core_suspend(struct device *dev)
struct bmi323_data *data = iio_priv(indio_dev);

guard(mutex)(&data->sleep_mutex);

if (indio_dev->pollfunc) {
if (indio_dev->pollfunc->irq > 0) {
disable_irq(indio_dev->pollfunc->irq);
} else {
dev_err(data->dev, "indio_dev->pollfunc->irq is %d\n", indio_dev->pollfunc->irq);
}
} else {
dev_err(data->dev, "indio_dev->pollfunc is NULL\n");
}


data->sleeping = true;

/*
Expand All @@ -2176,6 +2188,17 @@ static int bmi323_core_resume(struct device *dev)
struct bmi323_data *data = iio_priv(indio_dev);

guard(mutex)(&data->sleep_mutex);

if (indio_dev->pollfunc) {
if (indio_dev->pollfunc->irq > 0) {
enable_irq(indio_dev->pollfunc->irq);
} else {
dev_err(data->dev, "indio_dev->pollfunc->irq is %d\n", indio_dev->pollfunc->irq);
}
} else {
dev_err(data->dev, "indio_dev->pollfunc is NULL\n");
}

data->sleeping = false;

/*
Expand Down

0 comments on commit ab9de5b

Please sign in to comment.