2019-05-28 16:57:21 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2009-05-21 21:17:06 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2007-2009 ST-Ericsson AB
|
2010-05-01 16:26:20 +00:00
|
|
|
*
|
|
|
|
* ABX500 core access functions.
|
2012-08-10 08:32:35 +00:00
|
|
|
* The abx500 interface is used for the Analog Baseband chips.
|
2010-05-01 16:26:20 +00:00
|
|
|
*
|
|
|
|
* Author: Mattias Wallin <mattias.wallin@stericsson.com>
|
|
|
|
* Author: Mattias Nilsson <mattias.i.nilsson@stericsson.com>
|
|
|
|
* Author: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
|
|
|
|
* Author: Rickard Andersson <rickard.andersson@stericsson.com>
|
2009-05-21 21:17:06 +00:00
|
|
|
*/
|
|
|
|
|
2009-09-09 09:31:00 +00:00
|
|
|
#include <linux/regulator/machine.h>
|
2009-05-21 21:17:06 +00:00
|
|
|
|
2012-01-30 16:46:54 +00:00
|
|
|
struct device;
|
|
|
|
|
2010-05-01 16:26:20 +00:00
|
|
|
#ifndef MFD_ABX500_H
|
|
|
|
#define MFD_ABX500_H
|
2009-05-21 21:17:06 +00:00
|
|
|
|
2010-05-01 16:26:20 +00:00
|
|
|
/**
|
|
|
|
* struct abx500_init_setting
|
|
|
|
* Initial value of the registers for driver to use during setup.
|
|
|
|
*/
|
|
|
|
struct abx500_init_settings {
|
|
|
|
u8 bank;
|
|
|
|
u8 reg;
|
|
|
|
u8 setting;
|
|
|
|
};
|
|
|
|
|
|
|
|
int abx500_set_register_interruptible(struct device *dev, u8 bank, u8 reg,
|
|
|
|
u8 value);
|
|
|
|
int abx500_get_register_interruptible(struct device *dev, u8 bank, u8 reg,
|
|
|
|
u8 *value);
|
|
|
|
int abx500_get_register_page_interruptible(struct device *dev, u8 bank,
|
|
|
|
u8 first_reg, u8 *regvals, u8 numregs);
|
|
|
|
int abx500_set_register_page_interruptible(struct device *dev, u8 bank,
|
|
|
|
u8 first_reg, u8 *regvals, u8 numregs);
|
|
|
|
/**
|
|
|
|
* abx500_mask_and_set_register_inerruptible() - Modifies selected bits of a
|
|
|
|
* target register
|
|
|
|
*
|
|
|
|
* @dev: The AB sub device.
|
|
|
|
* @bank: The i2c bank number.
|
|
|
|
* @bitmask: The bit mask to use.
|
|
|
|
* @bitvalues: The new bit values.
|
|
|
|
*
|
|
|
|
* Updates the value of an AB register:
|
|
|
|
* value -> ((value & ~bitmask) | (bitvalues & bitmask))
|
|
|
|
*/
|
|
|
|
int abx500_mask_and_set_register_interruptible(struct device *dev, u8 bank,
|
|
|
|
u8 reg, u8 bitmask, u8 bitvalues);
|
|
|
|
int abx500_get_chip_id(struct device *dev);
|
|
|
|
int abx500_event_registers_startup_state_get(struct device *dev, u8 *event);
|
|
|
|
int abx500_startup_irq_enabled(struct device *dev, unsigned int irq);
|
|
|
|
|
|
|
|
struct abx500_ops {
|
|
|
|
int (*get_chip_id) (struct device *);
|
|
|
|
int (*get_register) (struct device *, u8, u8, u8 *);
|
|
|
|
int (*set_register) (struct device *, u8, u8, u8);
|
|
|
|
int (*get_register_page) (struct device *, u8, u8, u8 *, u8);
|
|
|
|
int (*set_register_page) (struct device *, u8, u8, u8 *, u8);
|
|
|
|
int (*mask_and_set_register) (struct device *, u8, u8, u8, u8);
|
|
|
|
int (*event_registers_startup_state_get) (struct device *, u8 *);
|
|
|
|
int (*startup_irq_enabled) (struct device *, unsigned int);
|
2012-01-27 10:22:16 +00:00
|
|
|
void (*dump_all_banks) (struct device *);
|
2010-05-01 16:26:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
int abx500_register_ops(struct device *core_dev, struct abx500_ops *ops);
|
2010-09-22 13:58:30 +00:00
|
|
|
void abx500_remove_ops(struct device *dev);
|
2009-05-21 21:17:06 +00:00
|
|
|
#endif
|