~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/mfd/da9055/core.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-or-later */
  2 /*
  3  * da9055 declarations for DA9055 PMICs.
  4  *
  5  * Copyright(c) 2012 Dialog Semiconductor Ltd.
  6  *
  7  * Author: David Dajun Chen <dchen@diasemi.com>
  8  */
  9 
 10 #ifndef __DA9055_CORE_H
 11 #define __DA9055_CORE_H
 12 
 13 #include <linux/interrupt.h>
 14 #include <linux/regmap.h>
 15 
 16 /*
 17  * PMIC IRQ
 18  */
 19 #define DA9055_IRQ_ALARM        0x01
 20 #define DA9055_IRQ_TICK         0x02
 21 #define DA9055_IRQ_NONKEY       0x00
 22 #define DA9055_IRQ_REGULATOR    0x0B
 23 #define DA9055_IRQ_HWMON        0x03
 24 
 25 struct da9055_pdata;
 26 
 27 struct da9055 {
 28         struct regmap *regmap;
 29         struct regmap_irq_chip_data *irq_data;
 30         struct device *dev;
 31         struct i2c_client *i2c_client;
 32 
 33         int irq_base;
 34         int chip_irq;
 35 };
 36 
 37 /* Device I/O */
 38 static inline int da9055_reg_read(struct da9055 *da9055, unsigned char reg)
 39 {
 40         int val, ret;
 41 
 42         ret = regmap_read(da9055->regmap, reg, &val);
 43         if (ret < 0)
 44                 return ret;
 45 
 46         return val;
 47 }
 48 
 49 static inline int da9055_reg_write(struct da9055 *da9055, unsigned char reg,
 50                                     unsigned char val)
 51 {
 52         return regmap_write(da9055->regmap, reg, val);
 53 }
 54 
 55 static inline int da9055_group_read(struct da9055 *da9055, unsigned char reg,
 56                                      unsigned reg_cnt, unsigned char *val)
 57 {
 58         return regmap_bulk_read(da9055->regmap, reg, val, reg_cnt);
 59 }
 60 
 61 static inline int da9055_group_write(struct da9055 *da9055, unsigned char reg,
 62                                       unsigned reg_cnt, unsigned char *val)
 63 {
 64         return regmap_raw_write(da9055->regmap, reg, val, reg_cnt);
 65 }
 66 
 67 static inline int da9055_reg_update(struct da9055 *da9055, unsigned char reg,
 68                                      unsigned char bit_mask,
 69                                      unsigned char reg_val)
 70 {
 71         return regmap_update_bits(da9055->regmap, reg, bit_mask, reg_val);
 72 }
 73 
 74 /* Generic Device API */
 75 int da9055_device_init(struct da9055 *da9055);
 76 void da9055_device_exit(struct da9055 *da9055);
 77 
 78 extern const struct regmap_config da9055_regmap_config;
 79 
 80 #endif /* __DA9055_CORE_H */
 81 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php