This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DRV260XSW-LINUX: drv260x_resume()

Guru 29690 points
Part Number: DRV260XSW-LINUX
Other Parts Discussed in Thread: DRV2603, DRV2604, DRV2604L, DRV2605

Hi Team,

Would you mind if we ask about the contents of "drv260x.c"?
Does the following drv260x_resume() represent SHUTDOWN to ACTIVE in Power-State Transition (datasheet Figure 16)? 

----------------------------------------
static int __maybe_unused drv260x_resume(struct device *dev)
{
struct drv260x_data *haptics = dev_get_drvdata(dev);
int ret = 0;

mutex_lock(&haptics->input_dev->mutex);

if (input_device_enabled(haptics->input_dev)) {
ret = regulator_enable(haptics->regulator);
if (ret) {
dev_err(dev, "Failed to enable regulator\n");
goto out;
}

ret = regmap_update_bits(haptics->regmap,
DRV260X_MODE,
DRV260X_STANDBY_MASK, 0);
if (ret) {
dev_err(dev, "Failed to unset standby mode\n");
regulator_disable(haptics->regulator);
goto out;
}

gpiod_set_value(haptics->enable_gpio, 1);
}

out:
mutex_unlock(&haptics->input_dev->mutex);
return ret;
}
----------------------------------------

Best Regards,
Yaita