Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Functions to access SY3686A power management chip.
0004  *
0005  * Copyright (C) 2021 reMarkable AS - http://www.remarkable.com/
0006  */
0007 
0008 #ifndef __MFD_SY7636A_H
0009 #define __MFD_SY7636A_H
0010 
0011 #define SY7636A_REG_OPERATION_MODE_CRL      0x00
0012 /* It is set if a gpio is used to control the regulator */
0013 #define SY7636A_OPERATION_MODE_CRL_VCOMCTL  BIT(6)
0014 #define SY7636A_OPERATION_MODE_CRL_ONOFF    BIT(7)
0015 #define SY7636A_REG_VCOM_ADJUST_CTRL_L      0x01
0016 #define SY7636A_REG_VCOM_ADJUST_CTRL_H      0x02
0017 #define SY7636A_REG_VCOM_ADJUST_CTRL_MASK   0x01ff
0018 #define SY7636A_REG_VLDO_VOLTAGE_ADJULST_CTRL   0x03
0019 #define SY7636A_REG_POWER_ON_DELAY_TIME     0x06
0020 #define SY7636A_REG_FAULT_FLAG          0x07
0021 #define SY7636A_FAULT_FLAG_PG           BIT(0)
0022 #define SY7636A_REG_TERMISTOR_READOUT       0x08
0023 
0024 #define SY7636A_REG_MAX             0x08
0025 
0026 #define VCOM_ADJUST_CTRL_MASK   0x1ff
0027 // Used to shift the high byte
0028 #define VCOM_ADJUST_CTRL_SHIFT  8
0029 // Used to scale from VCOM_ADJUST_CTRL to mv
0030 #define VCOM_ADJUST_CTRL_SCAL   10000
0031 
0032 #define FAULT_FLAG_SHIFT    1
0033 
0034 #endif /* __LINUX_MFD_SY7636A_H */