linux/drivers/hwmon/sfctemp.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (C) 2021 Emil Renner Berthing <[email protected]>
 * Copyright (C) 2021 Samin Guo <[email protected]>
 */

#include <linux/bits.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/hwmon.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/reset.h>

/*
 * TempSensor reset. The RSTN can be de-asserted once the analog core has
 * powered up. Trst(min 100ns)
 * 0:reset  1:de-assert
 */
#define SFCTEMP_RSTN

/*
 * TempSensor analog core power down. The analog core will be powered up
 * Tpu(min 50us) after PD is de-asserted. RSTN should be held low until the
 * analog core is powered up.
 * 0:power up  1:power down
 */
#define SFCTEMP_PD

/*
 * TempSensor start conversion enable.
 * 0:disable  1:enable
 */
#define SFCTEMP_RUN

/*
 * TempSensor conversion value output.
 * Temp(C)=DOUT*Y/4094 - K
 */
#define SFCTEMP_DOUT_POS
#define SFCTEMP_DOUT_MSK

/* DOUT to Celcius conversion constants */
#define SFCTEMP_Y1000
#define SFCTEMP_Z
#define SFCTEMP_K1000

struct sfctemp {};

static void sfctemp_power_up(struct sfctemp *sfctemp)
{}

static void sfctemp_power_down(struct sfctemp *sfctemp)
{}

static void sfctemp_run(struct sfctemp *sfctemp)
{}

static void sfctemp_stop(struct sfctemp *sfctemp)
{}

static int sfctemp_enable(struct sfctemp *sfctemp)
{}

static int sfctemp_disable(struct sfctemp *sfctemp)
{}

static void sfctemp_disable_action(void *data)
{}

static int sfctemp_convert(struct sfctemp *sfctemp, long *val)
{}

static umode_t sfctemp_is_visible(const void *data, enum hwmon_sensor_types type,
				  u32 attr, int channel)
{}

static int sfctemp_read(struct device *dev, enum hwmon_sensor_types type,
			u32 attr, int channel, long *val)
{}

static int sfctemp_write(struct device *dev, enum hwmon_sensor_types type,
			 u32 attr, int channel, long val)
{}

static const struct hwmon_channel_info *sfctemp_info[] =;

static const struct hwmon_ops sfctemp_hwmon_ops =;

static const struct hwmon_chip_info sfctemp_chip_info =;

static int sfctemp_probe(struct platform_device *pdev)
{}

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

static struct platform_driver sfctemp_driver =;
module_platform_driver();

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