Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Siemens SX1 board definitions
0004  *
0005  * Copyright: Vovan888 at gmail com
0006  */
0007 
0008 #ifndef __ASM_ARCH_SX1_I2C_CHIPS_H
0009 #define __ASM_ARCH_SX1_I2C_CHIPS_H
0010 
0011 #define SOFIA_MAX_LIGHT_VAL 0x2B
0012 
0013 #define SOFIA_I2C_ADDR      0x32
0014 /* Sofia reg 3 bits masks */
0015 #define SOFIA_POWER1_REG    0x03
0016 
0017 #define SOFIA_USB_POWER     0x01
0018 #define SOFIA_MMC_POWER     0x04
0019 #define SOFIA_BLUETOOTH_POWER   0x08
0020 #define SOFIA_MMILIGHT_POWER    0x20
0021 
0022 #define SOFIA_POWER2_REG    0x04
0023 #define SOFIA_BACKLIGHT_REG 0x06
0024 #define SOFIA_KEYLIGHT_REG  0x07
0025 #define SOFIA_DIMMING_REG   0x09
0026 
0027 
0028 /* Function Prototypes for SX1 devices control on I2C bus */
0029 
0030 int sx1_setbacklight(u8 backlight);
0031 int sx1_getbacklight(u8 *backlight);
0032 int sx1_setkeylight(u8 keylight);
0033 int sx1_getkeylight(u8 *keylight);
0034 
0035 int sx1_setmmipower(u8 onoff);
0036 int sx1_setusbpower(u8 onoff);
0037 int sx1_i2c_read_byte(u8 devaddr, u8 regoffset, u8 *value);
0038 int sx1_i2c_write_byte(u8 devaddr, u8 regoffset, u8 value);
0039 
0040 /* MMC prototypes */
0041 
0042 extern void sx1_mmc_init(void);
0043 extern void sx1_mmc_slot_cover_handler(void *arg, int state);
0044 
0045 #endif /* __ASM_ARCH_SX1_I2C_CHIPS_H */