1 /* include/linux/leds-rt8547.h
2 * Include file of driver to Richtek RT8547 LED Flash IC
4 * Copyright (C) 2014 Richtek Technology Corporation
5 * Author: CY_Huang <cy_huang@richtek.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
12 #ifndef __LINUX_LEDS_RT8547_H
13 #define __LINUX_LEDS_RT8547_H
15 #define RT8547_DRV_VER "1.0.2_G"
18 RT8547_FLED_REG0 = 0x01,
35 RT8547_LVP_MAX = RT8547_LVP_3P8V,
46 RT8547_TOL_MAX = RT8547_TOL_400mA,
49 #define RT8547_STO_MAX 36
51 #define RT8547_LVP_MASK 0x0F
52 #define RT8547_TOCLEVEL_MASK 0xE0
53 #define RT8547_TOCLEVEL_SHFT 5
54 #define RT8547_SCLEVEL_MASK 0x1F
55 #define RT8547_SWRST_MASK 0x20
56 #define RT8547_MODESEL_MASK 0x10
57 #define RT8547_TCLEVEL_MASK 0x0F
58 #define RT8547_STO_MASK 0x3F
60 struct rt8547_platform_data {
67 unsigned char def_lvp:4;
68 unsigned char def_tol:3;
71 /* one wire protocol parameter */
72 #define RT8547_ONEWIRE_ADDR 0x99
73 #define RT8547_LONG_DELAY 9
74 #define RT8547_SHORT_DELAY 4
75 #define RT8547_START_DELAY 10
76 #define RT8547_STOP_DELAY 1500
78 #ifdef CONFIG_LEDS_RT8547_DBG
79 #define RT_DBG(fmt, args...) pr_info("%s: " fmt, __func__, ##args)
81 #define RT_DBG(fmt, args...)
82 #endif /* #ifdef CONFIG_LEDS_RT8547_DBG */
84 #endif /* #ifndef __LINUX_LEDS_RT8547_H */