Example #1
0
static int __maybe_unused rmi_smb_runtime_suspend(struct device *dev)
{
	struct i2c_client *client = to_i2c_client(dev);
	struct rmi_smb_xport *rmi_smb = i2c_get_clientdata(client);
	int ret;

	ret = rmi_driver_suspend(rmi_smb->xport.rmi_dev, false);
	if (ret)
		dev_warn(dev, "Failed to suspend device: %d\n", ret);

	return ret;
}
Example #2
0
static int rmi_spi_runtime_suspend(struct device *dev)
{
	struct spi_device *spi = to_spi_device(dev);
	struct rmi_spi_xport *rmi_spi = spi_get_drvdata(spi);
	int ret;

	ret = rmi_driver_suspend(rmi_spi->xport.rmi_dev);
	if (ret)
		dev_warn(dev, "Failed to resume device: %d\n", ret);

	disable_irq(rmi_spi->irq);

	return 0;
}
Example #3
0
static int rmi_spi_suspend(struct device *dev)
{
	struct spi_device *spi = to_spi_device(dev);
	struct rmi_spi_xport *rmi_spi = spi_get_drvdata(spi);
	int ret;

	ret = rmi_driver_suspend(rmi_spi->xport.rmi_dev);
	if (ret)
		dev_warn(dev, "Failed to resume device: %d\n", ret);

	disable_irq(rmi_spi->irq);
	if (device_may_wakeup(&spi->dev)) {
		ret = enable_irq_wake(rmi_spi->irq);
		if (!ret)
			dev_warn(dev, "Failed to enable irq for wake: %d\n",
				ret);
	}
	return ret;
}