linux/drivers/regulator/stm32-vrefbuf.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) STMicroelectronics 2017
 *
 * Author: Fabrice Gasnier <[email protected]>
 */

#include <linux/bitfield.h>
#include <linux/clk.h>
#include <linux/io.h>
#include <linux/iopoll.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/of_regulator.h>
#include <linux/pm_runtime.h>

/* STM32 VREFBUF registers */
#define STM32_VREFBUF_CSR

/* STM32 VREFBUF CSR bitfields */
#define STM32_VRS
#define STM32_VRR
#define STM32_HIZ
#define STM32_ENVR

#define STM32_VREFBUF_AUTO_SUSPEND_DELAY_MS

struct stm32_vrefbuf {};

static const unsigned int stm32_vrefbuf_voltages[] =;

static int stm32_vrefbuf_enable(struct regulator_dev *rdev)
{}

static int stm32_vrefbuf_disable(struct regulator_dev *rdev)
{}

static int stm32_vrefbuf_is_enabled(struct regulator_dev *rdev)
{}

static int stm32_vrefbuf_set_voltage_sel(struct regulator_dev *rdev,
					 unsigned sel)
{}

static int stm32_vrefbuf_get_voltage_sel(struct regulator_dev *rdev)
{}

static const struct regulator_ops stm32_vrefbuf_volt_ops =;

static const struct regulator_desc stm32_vrefbuf_regu =;

static int stm32_vrefbuf_probe(struct platform_device *pdev)
{}

static void stm32_vrefbuf_remove(struct platform_device *pdev)
{
	struct regulator_dev *rdev = platform_get_drvdata(pdev);
	struct stm32_vrefbuf *priv = rdev_get_drvdata(rdev);

	pm_runtime_get_sync(&pdev->dev);
	regulator_unregister(rdev);
	clk_disable_unprepare(priv->clk);
	pm_runtime_disable(&pdev->dev);
	pm_runtime_set_suspended(&pdev->dev);
	pm_runtime_put_noidle(&pdev->dev);
};

static int __maybe_unused stm32_vrefbuf_runtime_suspend(struct device *dev)
{}

static int __maybe_unused stm32_vrefbuf_runtime_resume(struct device *dev)
{}

static const struct dev_pm_ops stm32_vrefbuf_pm_ops =;

static const struct of_device_id __maybe_unused stm32_vrefbuf_of_match[] =;
MODULE_DEVICE_TABLE(of, stm32_vrefbuf_of_match);

static struct platform_driver stm32_vrefbuf_driver =;
module_platform_driver();

MODULE_LICENSE();
MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_ALIAS();