blob: 51af04c7b493fb21e70fe082c0eda352022c802b [file] [log] [blame]
/* Copyright (c) 2018 The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __QG_SDAM_H__
#define __QG_SDAM_H__
#define SDAM_TYPE 0x2E
enum qg_sdam_param {
SDAM_VALID,
SDAM_SOC,
SDAM_TEMP,
SDAM_RBAT_MOHM,
SDAM_OCV_UV,
SDAM_IBAT_UA,
SDAM_TIME_SEC,
SDAM_PON_OCV_UV,
SDAM_MAX,
};
struct qg_sdam {
struct regmap *regmap;
u16 sdam_base;
};
int qg_sdam_init(struct device *dev);
int qg_sdam_write(u8 param, u32 data);
int qg_sdam_read(u8 param, u32 *data);
int qg_sdam_write_all(u32 *sdam_data);
int qg_sdam_read_all(u32 *sdam_data);
#endif