Debian Codegraph @

src/soc/nvidia/tegra210/jdi_25x18_display/panel-jdi-lpm102a188a.h

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 #ifndef _PANEL_JDI_LPM102A188A_H_
4 #define _PANEL_JDI_LPM102A188A_H_
5
6 #define LP8557_MAX_BRIGHTNESS 0xFFF
7
8 #define LP8557_COMMAND 0x00
9 #define LP8557_COMMAND_ON (1 << 0)
10
11 #define LP8557_BRIGHTNESS_LOW 0x03
12 #define LP8557_BRIGHTNESS_LOW_MASK(x) (((x) & 0xF) << 4)
13
14 #define LP8557_BRIGHTNESS_HIGH 0x04
15 #define LP8557_BRIGHTNESS_HIGH_MASK(x) (((x) & 0xFF0) >> 4)
16
17 enum lp8557_config_brightness_mode {
18 LP8557_CONFIG_BRTMODE_PWM = 0x0,
19 LP8557_CONFIG_BRTMODE_REG,
20 LP8557_CONFIG_BRTMODE_PWM_REG_SHAPE_PWM,
21 LP8557_CONFIG_BRTMODE_PWM_REG_SHAPE_BRIGHTNESS,
22 LP8557_CONFIG_BRTMODE_MAX,
23 };
24 #define LP8557_CONFIG 0x10
25 #define LP8557_CONFIG_BRTMODE(x) (((x) & 0x3) << 0)
26 #define LP8557_CONFIG_AUTO_DETECT_LED (1 << 2)
27 #define LP8557_CONFIG_PWM_STANDBY (1 << 7)
28
29 enum lp8557_current {
30 LP8557_CURRENT_5_MA = 0x0,
31 LP8557_CURRENT_10_MA,
32 LP8557_CURRENT_13_MA,
33 LP8557_CURRENT_15_MA,
34 LP8557_CURRENT_18_MA,
35 LP8557_CURRENT_20_MA,
36 LP8557_CURRENT_23_MA,
37 LP8557_CURRENT_25_MA,
38 LP8557_CURRENT_MAX,
39 };
40 #define LP8557_CURRENT 0x11
41 #define LP8557_CURRENT_MAXCURR(x) (((x) & 0x7) << 0)
42 #define LP8557_CURRENT_ISET (1 << 7)
43
44 enum lp8557_pgen_frequency {
45 LP8557_PGEN_FREQ_4_9_KHZ = 0x0,
46 LP8557_PGEN_FREQ_9_8_KHZ,
47 LP8557_PGEN_FREQ_14_6_KHZ,
48 LP8557_PGEN_FREQ_19_5_KHZ,
49 LP8557_PGEN_FREQ_24_4_KHZ,
50 LP8557_PGEN_FREQ_29_3_KHZ,
51 LP8557_PGEN_FREQ_34_2_KHZ,
52 LP8557_PGEN_FREQ_39_1_KHZ,
53 LP8557_PGEN_FREQ_MAX,
54 };
55 #define LP8557_PGEN 0x12
56 #define LP8557_PGEN_FREQ(x) (((x) & 0x7) << 0)
57 #define LP8557_PGEN_MAGIC (5 << 3)
58 #define LP8557_PGEN_FSET (1 << 7)
59
60 enum lp8557_boost_freq {
61 LP8557_BOOST_FREQ_500_KHZ = 0x0,
62 LP8557_BOOST_FREQ_1_MHZ,
63 LP8557_BOOST_FREQ_MAX,
64 };
65 enum lp8557_boost_bcomp {
66 LP8557_BOOST_BCOMP_OPTION_0 = 0x0,
67 LP8557_BOOST_BCOMP_OPTION_1,
68 LP8557_BOOST_BCOMP_MAX,
69 };
70 #define LP8557_BOOST 0x13
71 #define LP8557_BOOST_FREQ(x) (((x) & 0x1) << 0)
72 #define LP8557_BOOST_BCOMP(x) (((x) & 0x1) << 1)
73 #define LP8557_BOOST_BCSET (1 << 6)
74 #define LP8557_BOOST_BFSET (1 << 7)
75
76 #define LP8557_LED_ENABLE 0x14
77 #define LP8557_LED_ENABLE_SINKS(x) (((x) & 0x3F) << 0)
78 #define LP8557_LED_ENABLE_MAGIC (2 << 6)
79
80 enum lp8557_step_ramp {
81 LP8557_STEP_RAMP_0_MS = 0x0,
82 LP8557_STEP_RAMP_50_MS,
83 LP8557_STEP_RAMP_100_MS,
84 LP8557_STEP_RAMP_200_MS,
85 LP8557_STEP_RAMP_MAX,
86 };
87 enum lp8557_step_smoothing {
88 LP8557_STEP_SMOOTHING_NONE = 0x0,
89 LP8557_STEP_SMOOTHING_LIGHT,
90 LP8557_STEP_SMOOTHING_MEDIUM,
91 LP8557_STEP_SMOOTHING_HEAVY,
92 LP8557_STEP_SMOOTHING_MAX,
93 };
94 #define LP8557_STEP 0x15
95 #define LP8557_STEP_RAMP(x) (((x) & 0x3) << 0)
96 #define LP8557_STEP_SMOOTHING(x) (((x) & 0x3) << 6)
97
98 struct mipi_dsi_device;
99 struct soc_nvidia_tegra210_config;
100
101 struct panel_jdi {
102 struct mipi_dsi_device *dsi;
103 const struct soc_nvidia_tegra210_config *mode;
104
105 /* Physical size */
106 unsigned int width_mm;
107 unsigned int height_mm;
108
109 int enabled;
110 };
111
112 struct panel_jdi *panel_jdi_dsi_probe(struct mipi_dsi_device *dsi);
113 int panel_jdi_prepare(struct panel_jdi *jdi);
114
115 #endif