bmc150_magn.c (03ab8e6297acd1bc0eedaa050e2a1635c576fd11) bmc150_magn.c (d04d46dd82ad10bdc3c9ce6a513e1fa1336719c4)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Bosch BMC150 three-axis magnetic field sensor driver
4 *
5 * Copyright (c) 2015, Intel Corporation.
6 *
7 * This code is based on bmm050_api.c authored by contact@bosch.sensortec.com:
8 *

--- 971 unchanged lines hidden (view full) ---

980 if (data->dready_trig)
981 iio_trigger_unregister(data->dready_trig);
982err_poweroff:
983 bmc150_magn_set_power_mode(data, BMC150_MAGN_POWER_MODE_SUSPEND, true);
984 return ret;
985}
986EXPORT_SYMBOL_NS(bmc150_magn_probe, IIO_BMC150_MAGN);
987
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Bosch BMC150 three-axis magnetic field sensor driver
4 *
5 * Copyright (c) 2015, Intel Corporation.
6 *
7 * This code is based on bmm050_api.c authored by contact@bosch.sensortec.com:
8 *

--- 971 unchanged lines hidden (view full) ---

980 if (data->dready_trig)
981 iio_trigger_unregister(data->dready_trig);
982err_poweroff:
983 bmc150_magn_set_power_mode(data, BMC150_MAGN_POWER_MODE_SUSPEND, true);
984 return ret;
985}
986EXPORT_SYMBOL_NS(bmc150_magn_probe, IIO_BMC150_MAGN);
987
988int bmc150_magn_remove(struct device *dev)
988void bmc150_magn_remove(struct device *dev)
989{
990 struct iio_dev *indio_dev = dev_get_drvdata(dev);
991 struct bmc150_magn_data *data = iio_priv(indio_dev);
992
993 iio_device_unregister(indio_dev);
994
995 pm_runtime_disable(dev);
996 pm_runtime_set_suspended(dev);

--- 6 unchanged lines hidden (view full) ---

1003 if (data->dready_trig)
1004 iio_trigger_unregister(data->dready_trig);
1005
1006 mutex_lock(&data->mutex);
1007 bmc150_magn_set_power_mode(data, BMC150_MAGN_POWER_MODE_SUSPEND, true);
1008 mutex_unlock(&data->mutex);
1009
1010 regulator_bulk_disable(ARRAY_SIZE(data->regulators), data->regulators);
989{
990 struct iio_dev *indio_dev = dev_get_drvdata(dev);
991 struct bmc150_magn_data *data = iio_priv(indio_dev);
992
993 iio_device_unregister(indio_dev);
994
995 pm_runtime_disable(dev);
996 pm_runtime_set_suspended(dev);

--- 6 unchanged lines hidden (view full) ---

1003 if (data->dready_trig)
1004 iio_trigger_unregister(data->dready_trig);
1005
1006 mutex_lock(&data->mutex);
1007 bmc150_magn_set_power_mode(data, BMC150_MAGN_POWER_MODE_SUSPEND, true);
1008 mutex_unlock(&data->mutex);
1009
1010 regulator_bulk_disable(ARRAY_SIZE(data->regulators), data->regulators);
1011 return 0;
1012}
1013EXPORT_SYMBOL_NS(bmc150_magn_remove, IIO_BMC150_MAGN);
1014
1015#ifdef CONFIG_PM
1016static int bmc150_magn_runtime_suspend(struct device *dev)
1017{
1018 struct iio_dev *indio_dev = dev_get_drvdata(dev);
1019 struct bmc150_magn_data *data = iio_priv(indio_dev);

--- 66 unchanged lines hidden ---
1011}
1012EXPORT_SYMBOL_NS(bmc150_magn_remove, IIO_BMC150_MAGN);
1013
1014#ifdef CONFIG_PM
1015static int bmc150_magn_runtime_suspend(struct device *dev)
1016{
1017 struct iio_dev *indio_dev = dev_get_drvdata(dev);
1018 struct bmc150_magn_data *data = iio_priv(indio_dev);

--- 66 unchanged lines hidden ---