linux/drivers/hwmon/occ/common.h

/* SPDX-License-Identifier: GPL-2.0+ */
/* Copyright IBM Corp 2019 */

#ifndef OCC_COMMON_H
#define OCC_COMMON_H

#include <linux/hwmon-sysfs.h>
#include <linux/mutex.h>
#include <linux/sysfs.h>

struct device;

#define OCC_RESP_DATA_BYTES

/*
 * Same response format for all OCC versions.
 * Allocate the largest possible response.
 */
struct occ_response {} __packed;

struct occ_sensor_data_block_header {} __packed;

struct occ_sensor_data_block {} __packed;

struct occ_poll_response_header {} __packed;

struct occ_poll_response {} __packed;

struct occ_sensor {};

/*
 * OCC only provides one sensor data block of each type, but any number of
 * sensors within that block.
 */
struct occ_sensors {};

/*
 * Use our own attribute struct so we can dynamically allocate space for the
 * name.
 */
struct occ_attribute {};

struct occ {};

int occ_active(struct occ *occ, bool active);
int occ_setup(struct occ *occ);
int occ_setup_sysfs(struct occ *occ);
void occ_shutdown(struct occ *occ);
void occ_shutdown_sysfs(struct occ *occ);
void occ_sysfs_poll_done(struct occ *occ);
int occ_update_response(struct occ *occ);

#endif /* OCC_COMMON_H */