linux/include/linux/mfd/max8998-private.h

/* SPDX-License-Identifier: GPL-2.0+ */
/*
 * max8998-private.h - Voltage regulator driver for the Maxim 8998
 *
 *  Copyright (C) 2009-2010 Samsung Electrnoics
 *  Kyungmin Park <[email protected]>
 *  Marek Szyprowski <[email protected]>
 */

#ifndef __LINUX_MFD_MAX8998_PRIV_H
#define __LINUX_MFD_MAX8998_PRIV_H

#define MAX8998_NUM_IRQ_REGS

/* MAX 8998 registers */
enum {};

/* IRQ definitions */
enum {};

/* MAX8998 various variants */
enum {};

#define MAX8998_IRQ_DCINF_MASK
#define MAX8998_IRQ_DCINR_MASK
#define MAX8998_IRQ_JIGF_MASK
#define MAX8998_IRQ_JIGR_MASK
#define MAX8998_IRQ_PWRONF_MASK
#define MAX8998_IRQ_PWRONR_MASK

#define MAX8998_IRQ_WTSREVNT_MASK
#define MAX8998_IRQ_SMPLEVNT_MASK
#define MAX8998_IRQ_ALARM1_MASK
#define MAX8998_IRQ_ALARM0_MASK

#define MAX8998_IRQ_ONKEY1S_MASK
#define MAX8998_IRQ_TOPOFFR_MASK
#define MAX8998_IRQ_DCINOVPR_MASK
#define MAX8998_IRQ_CHGRSTF_MASK
#define MAX8998_IRQ_DONER_MASK
#define MAX8998_IRQ_CHGFAULT_MASK

#define MAX8998_IRQ_LOBAT1_MASK
#define MAX8998_IRQ_LOBAT2_MASK

#define MAX8998_ENRAMP

struct irq_domain;

/**
 * struct max8998_dev - max8998 master device for sub-drivers
 * @dev: master device of the chip (can be used to access platform data)
 * @pdata: platform data for the driver and subdrivers
 * @i2c: i2c client private data for regulator
 * @rtc: i2c client private data for rtc
 * @iolock: mutex for serializing io access
 * @irqlock: mutex for buslock
 * @irq_base: base IRQ number for max8998, required for IRQs
 * @irq: generic IRQ number for max8998
 * @ono: power onoff IRQ number for max8998
 * @irq_masks_cur: currently active value
 * @irq_masks_cache: cached hardware value
 * @type: indicate which max8998 "variant" is used
 */
struct max8998_dev {};

int max8998_irq_init(struct max8998_dev *max8998);
void max8998_irq_exit(struct max8998_dev *max8998);
int max8998_irq_resume(struct max8998_dev *max8998);

extern int max8998_read_reg(struct i2c_client *i2c, u8 reg, u8 *dest);
extern int max8998_bulk_read(struct i2c_client *i2c, u8 reg, int count,
		u8 *buf);
extern int max8998_write_reg(struct i2c_client *i2c, u8 reg, u8 value);
extern int max8998_bulk_write(struct i2c_client *i2c, u8 reg, int count,
		u8 *buf);
extern int max8998_update_reg(struct i2c_client *i2c, u8 reg, u8 val, u8 mask);

#endif /*  __LINUX_MFD_MAX8998_PRIV_H */