Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Copyright (C) 2007-2009 ST-Ericsson AB
0004  *
0005  * ABX500 core access functions.
0006  * The abx500 interface is used for the Analog Baseband chips.
0007  *
0008  * Author: Mattias Wallin <mattias.wallin@stericsson.com>
0009  * Author: Mattias Nilsson <mattias.i.nilsson@stericsson.com>
0010  * Author: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
0011  * Author: Rickard Andersson <rickard.andersson@stericsson.com>
0012  */
0013 
0014 #include <linux/regulator/machine.h>
0015 
0016 struct device;
0017 
0018 #ifndef MFD_ABX500_H
0019 #define MFD_ABX500_H
0020 
0021 /**
0022  * struct abx500_init_setting
0023  * Initial value of the registers for driver to use during setup.
0024  */
0025 struct abx500_init_settings {
0026     u8 bank;
0027     u8 reg;
0028     u8 setting;
0029 };
0030 
0031 int abx500_set_register_interruptible(struct device *dev, u8 bank, u8 reg,
0032     u8 value);
0033 int abx500_get_register_interruptible(struct device *dev, u8 bank, u8 reg,
0034     u8 *value);
0035 int abx500_get_register_page_interruptible(struct device *dev, u8 bank,
0036     u8 first_reg, u8 *regvals, u8 numregs);
0037 int abx500_set_register_page_interruptible(struct device *dev, u8 bank,
0038     u8 first_reg, u8 *regvals, u8 numregs);
0039 /**
0040  * abx500_mask_and_set_register_inerruptible() - Modifies selected bits of a
0041  *  target register
0042  *
0043  * @dev: The AB sub device.
0044  * @bank: The i2c bank number.
0045  * @bitmask: The bit mask to use.
0046  * @bitvalues: The new bit values.
0047  *
0048  * Updates the value of an AB register:
0049  * value -> ((value & ~bitmask) | (bitvalues & bitmask))
0050  */
0051 int abx500_mask_and_set_register_interruptible(struct device *dev, u8 bank,
0052     u8 reg, u8 bitmask, u8 bitvalues);
0053 int abx500_get_chip_id(struct device *dev);
0054 int abx500_event_registers_startup_state_get(struct device *dev, u8 *event);
0055 int abx500_startup_irq_enabled(struct device *dev, unsigned int irq);
0056 
0057 struct abx500_ops {
0058     int (*get_chip_id) (struct device *);
0059     int (*get_register) (struct device *, u8, u8, u8 *);
0060     int (*set_register) (struct device *, u8, u8, u8);
0061     int (*get_register_page) (struct device *, u8, u8, u8 *, u8);
0062     int (*set_register_page) (struct device *, u8, u8, u8 *, u8);
0063     int (*mask_and_set_register) (struct device *, u8, u8, u8, u8);
0064     int (*event_registers_startup_state_get) (struct device *, u8 *);
0065     int (*startup_irq_enabled) (struct device *, unsigned int);
0066     void (*dump_all_banks) (struct device *);
0067 };
0068 
0069 int abx500_register_ops(struct device *core_dev, struct abx500_ops *ops);
0070 void abx500_remove_ops(struct device *dev);
0071 #endif