.. | .. |
---|
1 | | -// SPDX-License-Identifier: GPL-2.0 |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
2 | 2 | /* |
---|
3 | | - * Copyright(c) Icenowy Zheng <icenowy@aosc.io> |
---|
4 | | - * Based on analogix-anx6345.c, which is: |
---|
5 | | - * Copyright(c) 2016, Analogix Semiconductor. |
---|
| 3 | + * Copyright(c) 2016, Analogix Semiconductor. |
---|
| 4 | + * Copyright(c) 2017, Icenowy Zheng <icenowy@aosc.io> |
---|
| 5 | + * |
---|
| 6 | + * Based on anx7808 driver obtained from chromeos with copyright: |
---|
| 7 | + * Copyright(c) 2013, Google Inc. |
---|
6 | 8 | */ |
---|
7 | 9 | #include <linux/delay.h> |
---|
8 | 10 | #include <linux/err.h> |
---|
9 | | -#include <linux/interrupt.h> |
---|
| 11 | +#include <linux/gpio/consumer.h> |
---|
10 | 12 | #include <linux/i2c.h> |
---|
| 13 | +#include <linux/interrupt.h> |
---|
11 | 14 | #include <linux/kernel.h> |
---|
12 | 15 | #include <linux/module.h> |
---|
13 | | -#include <linux/of_gpio.h> |
---|
14 | 16 | #include <linux/of_platform.h> |
---|
15 | 17 | #include <linux/regmap.h> |
---|
16 | | -#include <linux/types.h> |
---|
17 | | -#include <linux/gpio/consumer.h> |
---|
18 | 18 | #include <linux/regulator/consumer.h> |
---|
| 19 | +#include <linux/types.h> |
---|
19 | 20 | |
---|
20 | | -#include <drm/drmP.h> |
---|
21 | 21 | #include <drm/drm_atomic_helper.h> |
---|
| 22 | +#include <drm/drm_bridge.h> |
---|
22 | 23 | #include <drm/drm_crtc.h> |
---|
23 | 24 | #include <drm/drm_crtc_helper.h> |
---|
24 | 25 | #include <drm/drm_dp_helper.h> |
---|
25 | 26 | #include <drm/drm_edid.h> |
---|
| 27 | +#include <drm/drm_of.h> |
---|
| 28 | +#include <drm/drm_panel.h> |
---|
| 29 | +#include <drm/drm_print.h> |
---|
| 30 | +#include <drm/drm_probe_helper.h> |
---|
26 | 31 | |
---|
27 | 32 | #include "analogix-i2c-dptx.h" |
---|
28 | 33 | #include "analogix-i2c-txcommon.h" |
---|
29 | 34 | |
---|
30 | | -#define I2C_NUM_ADDRESSES 2 |
---|
31 | | -#define I2C_IDX_DPTX 0 |
---|
32 | | -#define I2C_IDX_TXCOM 1 |
---|
33 | | - |
---|
34 | | -#define XTAL_CLK 270 /* 27M */ |
---|
35 | | - |
---|
36 | 35 | #define POLL_DELAY 50000 /* us */ |
---|
37 | 36 | #define POLL_TIMEOUT 5000000 /* us */ |
---|
38 | 37 | |
---|
39 | | -static const u8 anx6345_i2c_addresses[] = { |
---|
40 | | - [I2C_IDX_DPTX] = ANALOGIX_I2C_DPTX, |
---|
41 | | - [I2C_IDX_TXCOM] = ANALOGIX_I2C_TXCOMMON, |
---|
42 | | -}; |
---|
| 38 | +#define I2C_IDX_DPTX 0 |
---|
| 39 | +#define I2C_IDX_TXCOM 1 |
---|
43 | 40 | |
---|
44 | | -struct anx6345_platform_data { |
---|
45 | | - struct regulator *dvdd12; |
---|
46 | | - struct regulator *dvdd25; |
---|
47 | | - struct regulator *vcc_panel; |
---|
48 | | - struct gpio_desc *gpiod_reset; |
---|
| 41 | +static const u8 anx6345_i2c_addresses[] = { |
---|
| 42 | + [I2C_IDX_DPTX] = 0x70, |
---|
| 43 | + [I2C_IDX_TXCOM] = 0x72, |
---|
49 | 44 | }; |
---|
| 45 | +#define I2C_NUM_ADDRESSES ARRAY_SIZE(anx6345_i2c_addresses) |
---|
50 | 46 | |
---|
51 | 47 | struct anx6345 { |
---|
52 | 48 | struct drm_dp_aux aux; |
---|
.. | .. |
---|
54 | 50 | struct i2c_client *client; |
---|
55 | 51 | struct edid *edid; |
---|
56 | 52 | struct drm_connector connector; |
---|
57 | | - struct drm_dp_link link; |
---|
58 | | - struct anx6345_platform_data pdata; |
---|
59 | | - struct mutex lock; |
---|
| 53 | + struct drm_panel *panel; |
---|
| 54 | + struct regulator *dvdd12; |
---|
| 55 | + struct regulator *dvdd25; |
---|
| 56 | + struct gpio_desc *gpiod_reset; |
---|
| 57 | + struct mutex lock; /* protect EDID access */ |
---|
60 | 58 | |
---|
61 | | - /* |
---|
62 | | - * I2C Slave addresses of ANX6345 are mapped as DPTX and SYS |
---|
63 | | - */ |
---|
| 59 | + /* I2C Slave addresses of ANX6345 are mapped as DPTX and SYS */ |
---|
64 | 60 | struct i2c_client *i2c_clients[I2C_NUM_ADDRESSES]; |
---|
65 | 61 | struct regmap *map[I2C_NUM_ADDRESSES]; |
---|
66 | 62 | |
---|
.. | .. |
---|
95 | 91 | { |
---|
96 | 92 | struct anx6345 *anx6345 = container_of(aux, struct anx6345, aux); |
---|
97 | 93 | |
---|
98 | | - return anx_aux_transfer(anx6345->map[I2C_IDX_DPTX], msg); |
---|
| 94 | + return anx_dp_aux_transfer(anx6345->map[I2C_IDX_DPTX], msg); |
---|
99 | 95 | } |
---|
100 | 96 | |
---|
101 | 97 | static int anx6345_dp_link_training(struct anx6345 *anx6345) |
---|
102 | 98 | { |
---|
103 | 99 | unsigned int value; |
---|
104 | | - u8 dp_bw; |
---|
| 100 | + u8 dp_bw, dpcd[2]; |
---|
105 | 101 | int err; |
---|
106 | 102 | |
---|
107 | 103 | err = anx6345_clear_bits(anx6345->map[I2C_IDX_TXCOM], |
---|
.. | .. |
---|
148 | 144 | if (err) |
---|
149 | 145 | return err; |
---|
150 | 146 | |
---|
151 | | - /* Check link capabilities */ |
---|
152 | | - err = drm_dp_link_probe(&anx6345->aux, &anx6345->link); |
---|
153 | | - if (err < 0) { |
---|
154 | | - DRM_ERROR("Failed to probe link capabilities: %d\n", err); |
---|
155 | | - return err; |
---|
156 | | - } |
---|
| 147 | + /* |
---|
| 148 | + * Power up the sink (DP_SET_POWER register is only available on DPCD |
---|
| 149 | + * v1.1 and later). |
---|
| 150 | + */ |
---|
| 151 | + if (anx6345->dpcd[DP_DPCD_REV] >= 0x11) { |
---|
| 152 | + err = drm_dp_dpcd_readb(&anx6345->aux, DP_SET_POWER, &dpcd[0]); |
---|
| 153 | + if (err < 0) { |
---|
| 154 | + DRM_ERROR("Failed to read DP_SET_POWER register: %d\n", |
---|
| 155 | + err); |
---|
| 156 | + return err; |
---|
| 157 | + } |
---|
157 | 158 | |
---|
158 | | - /* Power up the sink */ |
---|
159 | | - err = drm_dp_link_power_up(&anx6345->aux, &anx6345->link); |
---|
160 | | - if (err < 0) { |
---|
161 | | - DRM_ERROR("Failed to power up DisplayPort link: %d\n", err); |
---|
162 | | - return err; |
---|
| 159 | + dpcd[0] &= ~DP_SET_POWER_MASK; |
---|
| 160 | + dpcd[0] |= DP_SET_POWER_D0; |
---|
| 161 | + |
---|
| 162 | + err = drm_dp_dpcd_writeb(&anx6345->aux, DP_SET_POWER, dpcd[0]); |
---|
| 163 | + if (err < 0) { |
---|
| 164 | + DRM_ERROR("Failed to power up DisplayPort link: %d\n", |
---|
| 165 | + err); |
---|
| 166 | + return err; |
---|
| 167 | + } |
---|
| 168 | + |
---|
| 169 | + /* |
---|
| 170 | + * According to the DP 1.1 specification, a "Sink Device must |
---|
| 171 | + * exit the power saving state within 1 ms" (Section 2.5.3.1, |
---|
| 172 | + * Table 5-52, "Sink Control Field" (register 0x600). |
---|
| 173 | + */ |
---|
| 174 | + usleep_range(1000, 2000); |
---|
163 | 175 | } |
---|
164 | 176 | |
---|
165 | 177 | /* Possibly enable downspread on the sink */ |
---|
.. | .. |
---|
198 | 210 | if (err) |
---|
199 | 211 | return err; |
---|
200 | 212 | |
---|
201 | | - value = drm_dp_link_rate_to_bw_code(anx6345->link.rate); |
---|
| 213 | + dpcd[0] = dp_bw; |
---|
202 | 214 | err = regmap_write(anx6345->map[I2C_IDX_DPTX], |
---|
203 | | - SP_DP_MAIN_LINK_BW_SET_REG, value); |
---|
| 215 | + SP_DP_MAIN_LINK_BW_SET_REG, dpcd[0]); |
---|
204 | 216 | if (err) |
---|
205 | 217 | return err; |
---|
206 | 218 | |
---|
| 219 | + dpcd[1] = drm_dp_max_lane_count(anx6345->dpcd); |
---|
| 220 | + |
---|
207 | 221 | err = regmap_write(anx6345->map[I2C_IDX_DPTX], |
---|
208 | | - SP_DP_LANE_COUNT_SET_REG, anx6345->link.num_lanes); |
---|
| 222 | + SP_DP_LANE_COUNT_SET_REG, dpcd[1]); |
---|
209 | 223 | if (err) |
---|
210 | 224 | return err; |
---|
211 | 225 | |
---|
212 | | - err = drm_dp_link_configure(&anx6345->aux, &anx6345->link); |
---|
| 226 | + if (drm_dp_enhanced_frame_cap(anx6345->dpcd)) |
---|
| 227 | + dpcd[1] |= DP_LANE_COUNT_ENHANCED_FRAME_EN; |
---|
| 228 | + |
---|
| 229 | + err = drm_dp_dpcd_write(&anx6345->aux, DP_LINK_BW_SET, dpcd, |
---|
| 230 | + sizeof(dpcd)); |
---|
| 231 | + |
---|
213 | 232 | if (err < 0) { |
---|
214 | | - DRM_ERROR("Failed to configure DisplayPort link: %d\n", err); |
---|
| 233 | + DRM_ERROR("Failed to configure link: %d\n", err); |
---|
215 | 234 | return err; |
---|
216 | 235 | } |
---|
217 | 236 | |
---|
.. | .. |
---|
221 | 240 | if (err) |
---|
222 | 241 | return err; |
---|
223 | 242 | |
---|
224 | | - err = regmap_read_poll_timeout(anx6345->map[I2C_IDX_DPTX], |
---|
| 243 | + return regmap_read_poll_timeout(anx6345->map[I2C_IDX_DPTX], |
---|
225 | 244 | SP_DP_LT_CTRL_REG, |
---|
226 | 245 | value, !(value & SP_DP_LT_INPROGRESS), |
---|
227 | 246 | POLL_DELAY, POLL_TIMEOUT); |
---|
228 | | - if (err) |
---|
229 | | - return err; |
---|
230 | | - |
---|
231 | | - return 0; |
---|
232 | 247 | } |
---|
233 | 248 | |
---|
234 | 249 | static int anx6345_tx_initialization(struct anx6345 *anx6345) |
---|
235 | 250 | { |
---|
236 | | - struct drm_display_info *di = &anx6345->connector.display_info; |
---|
237 | 251 | int err, i; |
---|
238 | | - u32 color_depth; |
---|
239 | 252 | |
---|
240 | | - switch (di->bpc) { |
---|
241 | | - case 12: |
---|
242 | | - color_depth = SP_IN_BPC_12BIT; |
---|
243 | | - break; |
---|
244 | | - case 10: |
---|
245 | | - color_depth = SP_IN_BPC_10BIT; |
---|
246 | | - break; |
---|
247 | | - case 6: |
---|
248 | | - color_depth = SP_IN_BPC_6BIT; |
---|
249 | | - break; |
---|
250 | | - case 8: |
---|
251 | | - default: |
---|
252 | | - color_depth = SP_IN_BPC_8BIT; |
---|
253 | | - break; |
---|
254 | | - } |
---|
255 | | - |
---|
| 253 | + /* FIXME: colordepth is hardcoded for now */ |
---|
256 | 254 | err = regmap_write(anx6345->map[I2C_IDX_TXCOM], SP_VID_CTRL2_REG, |
---|
257 | | - color_depth << SP_IN_BPC_SHIFT); |
---|
| 255 | + SP_IN_BPC_6BIT << SP_IN_BPC_SHIFT); |
---|
258 | 256 | if (err) |
---|
259 | 257 | return err; |
---|
260 | 258 | |
---|
.. | .. |
---|
299 | 297 | if (err) |
---|
300 | 298 | return err; |
---|
301 | 299 | |
---|
302 | | - err = anx6345_clear_bits(anx6345->map[I2C_IDX_TXCOM], |
---|
| 300 | + return anx6345_clear_bits(anx6345->map[I2C_IDX_TXCOM], |
---|
303 | 301 | SP_RESET_CTRL2_REG, SP_AUX_RST); |
---|
304 | | - if (err) |
---|
305 | | - return err; |
---|
306 | | - |
---|
307 | | - err = anx6345_dp_link_training(anx6345); |
---|
308 | | - if (err) |
---|
309 | | - return err; |
---|
310 | | - |
---|
311 | | - return 0; |
---|
312 | 302 | } |
---|
313 | 303 | |
---|
314 | 304 | static void anx6345_poweron(struct anx6345 *anx6345) |
---|
315 | 305 | { |
---|
316 | | - struct anx6345_platform_data *pdata = &anx6345->pdata; |
---|
317 | 306 | int err; |
---|
318 | | - u32 idl; |
---|
319 | 307 | |
---|
320 | | - if (WARN_ON(anx6345->powered)) |
---|
321 | | - return; |
---|
| 308 | + /* Ensure reset is asserted before starting power on sequence */ |
---|
| 309 | + gpiod_set_value_cansleep(anx6345->gpiod_reset, 1); |
---|
| 310 | + usleep_range(1000, 2000); |
---|
322 | 311 | |
---|
323 | | - if (pdata->dvdd12) { |
---|
324 | | - err = regulator_enable(pdata->dvdd12); |
---|
325 | | - if (err) { |
---|
326 | | - DRM_ERROR("Failed to enable DVDD12 regulator: %d\n", |
---|
327 | | - err); |
---|
328 | | - return; |
---|
329 | | - } |
---|
330 | | - |
---|
331 | | - usleep_range(1000, 2000); |
---|
332 | | - } |
---|
333 | | - |
---|
334 | | - if (pdata->dvdd25) { |
---|
335 | | - err = regulator_enable(pdata->dvdd25); |
---|
336 | | - if (err) { |
---|
337 | | - DRM_ERROR("Failed to enable DVDD25 regulator: %d\n", |
---|
338 | | - err); |
---|
339 | | - return; |
---|
340 | | - } |
---|
341 | | - |
---|
342 | | - usleep_range(5000, 10000); |
---|
343 | | - } |
---|
344 | | - |
---|
345 | | - if (pdata->vcc_panel) { |
---|
346 | | - err = regulator_enable(pdata->vcc_panel); |
---|
347 | | - if (err) { |
---|
348 | | - DRM_ERROR("Failed to enable panel regulator: %d\n", |
---|
349 | | - err); |
---|
350 | | - return; |
---|
351 | | - } |
---|
352 | | - } |
---|
353 | | - |
---|
354 | | - err = regmap_read(anx6345->map[I2C_IDX_TXCOM], SP_DEVICE_IDL_REG, &idl); |
---|
| 312 | + err = regulator_enable(anx6345->dvdd12); |
---|
355 | 313 | if (err) { |
---|
356 | | - gpiod_direction_output(pdata->gpiod_reset, 1); |
---|
357 | | - usleep_range(1000, 2000); |
---|
358 | | - |
---|
359 | | - gpiod_direction_output(pdata->gpiod_reset, 0); |
---|
| 314 | + DRM_ERROR("Failed to enable dvdd12 regulator: %d\n", |
---|
| 315 | + err); |
---|
| 316 | + return; |
---|
360 | 317 | } |
---|
| 318 | + |
---|
| 319 | + /* T1 - delay between VDD12 and VDD25 should be 0-2ms */ |
---|
| 320 | + usleep_range(1000, 2000); |
---|
| 321 | + |
---|
| 322 | + err = regulator_enable(anx6345->dvdd25); |
---|
| 323 | + if (err) { |
---|
| 324 | + DRM_ERROR("Failed to enable dvdd25 regulator: %d\n", |
---|
| 325 | + err); |
---|
| 326 | + return; |
---|
| 327 | + } |
---|
| 328 | + |
---|
| 329 | + /* T2 - delay between RESETN and all power rail stable, |
---|
| 330 | + * should be 2-5ms |
---|
| 331 | + */ |
---|
| 332 | + usleep_range(2000, 5000); |
---|
| 333 | + |
---|
| 334 | + gpiod_set_value_cansleep(anx6345->gpiod_reset, 0); |
---|
361 | 335 | |
---|
362 | 336 | /* Power on registers module */ |
---|
363 | 337 | anx6345_set_bits(anx6345->map[I2C_IDX_TXCOM], SP_POWERDOWN_CTRL_REG, |
---|
364 | | - SP_HDCP_PD | SP_AUDIO_PD); |
---|
| 338 | + SP_HDCP_PD | SP_AUDIO_PD | SP_VIDEO_PD | SP_LINK_PD); |
---|
365 | 339 | anx6345_clear_bits(anx6345->map[I2C_IDX_TXCOM], SP_POWERDOWN_CTRL_REG, |
---|
366 | 340 | SP_REGISTER_PD | SP_TOTAL_PD); |
---|
| 341 | + |
---|
| 342 | + if (anx6345->panel) |
---|
| 343 | + drm_panel_prepare(anx6345->panel); |
---|
367 | 344 | |
---|
368 | 345 | anx6345->powered = true; |
---|
369 | 346 | } |
---|
370 | 347 | |
---|
371 | 348 | static void anx6345_poweroff(struct anx6345 *anx6345) |
---|
372 | 349 | { |
---|
373 | | - struct anx6345_platform_data *pdata = &anx6345->pdata; |
---|
374 | 350 | int err; |
---|
375 | 351 | |
---|
376 | | - if (WARN_ON(!anx6345->powered)) |
---|
377 | | - return; |
---|
378 | | - |
---|
379 | | - gpiod_set_value_cansleep(pdata->gpiod_reset, 1); |
---|
| 352 | + gpiod_set_value_cansleep(anx6345->gpiod_reset, 1); |
---|
380 | 353 | usleep_range(1000, 2000); |
---|
381 | 354 | |
---|
382 | | - if (pdata->vcc_panel) { |
---|
383 | | - err = regulator_disable(pdata->vcc_panel); |
---|
384 | | - if (err) { |
---|
385 | | - DRM_ERROR("Failed to disable panel regulator: %d\n", |
---|
386 | | - err); |
---|
387 | | - return; |
---|
388 | | - } |
---|
| 355 | + if (anx6345->panel) |
---|
| 356 | + drm_panel_unprepare(anx6345->panel); |
---|
| 357 | + |
---|
| 358 | + err = regulator_disable(anx6345->dvdd25); |
---|
| 359 | + if (err) { |
---|
| 360 | + DRM_ERROR("Failed to disable dvdd25 regulator: %d\n", |
---|
| 361 | + err); |
---|
| 362 | + return; |
---|
389 | 363 | } |
---|
390 | 364 | |
---|
391 | | - if (pdata->dvdd25) { |
---|
392 | | - err = regulator_disable(pdata->dvdd25); |
---|
393 | | - if (err) { |
---|
394 | | - DRM_ERROR("Failed to disable DVDD25 regulator: %d\n", |
---|
395 | | - err); |
---|
396 | | - return; |
---|
397 | | - } |
---|
| 365 | + usleep_range(5000, 10000); |
---|
398 | 366 | |
---|
399 | | - usleep_range(5000, 10000); |
---|
| 367 | + err = regulator_disable(anx6345->dvdd12); |
---|
| 368 | + if (err) { |
---|
| 369 | + DRM_ERROR("Failed to disable dvdd12 regulator: %d\n", |
---|
| 370 | + err); |
---|
| 371 | + return; |
---|
400 | 372 | } |
---|
401 | 373 | |
---|
402 | | - if (pdata->dvdd12) { |
---|
403 | | - err = regulator_disable(pdata->dvdd12); |
---|
404 | | - if (err) { |
---|
405 | | - DRM_ERROR("Failed to disable DVDD12 regulator: %d\n", |
---|
406 | | - err); |
---|
407 | | - return; |
---|
408 | | - } |
---|
409 | | - |
---|
410 | | - usleep_range(1000, 2000); |
---|
411 | | - } |
---|
| 374 | + usleep_range(1000, 2000); |
---|
412 | 375 | |
---|
413 | 376 | anx6345->powered = false; |
---|
414 | 377 | } |
---|
.. | .. |
---|
422 | 385 | |
---|
423 | 386 | /* Power on needed modules */ |
---|
424 | 387 | err = anx6345_clear_bits(anx6345->map[I2C_IDX_TXCOM], |
---|
425 | | - SP_POWERDOWN_CTRL_REG, |
---|
426 | | - SP_VIDEO_PD | SP_LINK_PD); |
---|
| 388 | + SP_POWERDOWN_CTRL_REG, |
---|
| 389 | + SP_VIDEO_PD | SP_LINK_PD); |
---|
427 | 390 | |
---|
428 | 391 | err = anx6345_tx_initialization(anx6345); |
---|
429 | 392 | if (err) { |
---|
430 | | - DRM_ERROR("Failed transmitter initialization: %d\n", err); |
---|
431 | | - goto err_poweroff; |
---|
| 393 | + DRM_ERROR("Failed eDP transmitter initialization: %d\n", err); |
---|
| 394 | + anx6345_poweroff(anx6345); |
---|
| 395 | + return err; |
---|
| 396 | + } |
---|
| 397 | + |
---|
| 398 | + err = anx6345_dp_link_training(anx6345); |
---|
| 399 | + if (err) { |
---|
| 400 | + DRM_ERROR("Failed link training: %d\n", err); |
---|
| 401 | + anx6345_poweroff(anx6345); |
---|
| 402 | + return err; |
---|
432 | 403 | } |
---|
433 | 404 | |
---|
434 | 405 | /* |
---|
.. | .. |
---|
438 | 409 | usleep_range(10000, 15000); |
---|
439 | 410 | |
---|
440 | 411 | return 0; |
---|
441 | | - |
---|
442 | | -err_poweroff: |
---|
443 | | - DRM_ERROR("Failed DisplayPort transmitter initialization: %d\n", err); |
---|
444 | | - anx6345_poweroff(anx6345); |
---|
445 | | - |
---|
446 | | - return err; |
---|
447 | | -} |
---|
448 | | - |
---|
449 | | -static int anx6345_init_pdata(struct anx6345 *anx6345) |
---|
450 | | -{ |
---|
451 | | - struct anx6345_platform_data *pdata = &anx6345->pdata; |
---|
452 | | - struct device *dev = &anx6345->client->dev; |
---|
453 | | - |
---|
454 | | - /* 1.2V digital core power regulator */ |
---|
455 | | - pdata->dvdd12 = devm_regulator_get(dev, "dvdd12"); |
---|
456 | | - if (IS_ERR(pdata->dvdd12)) { |
---|
457 | | - DRM_ERROR("DVDD12 regulator not found\n"); |
---|
458 | | - return PTR_ERR(pdata->dvdd12); |
---|
459 | | - } |
---|
460 | | - |
---|
461 | | - /* 2.5V digital core power regulator */ |
---|
462 | | - pdata->dvdd25 = devm_regulator_get(dev, "dvdd25"); |
---|
463 | | - if (IS_ERR(pdata->dvdd25)) { |
---|
464 | | - DRM_ERROR("DVDD25 regulator not found\n"); |
---|
465 | | - return PTR_ERR(pdata->dvdd25); |
---|
466 | | - } |
---|
467 | | - |
---|
468 | | - /* panel power regulator */ |
---|
469 | | - pdata->vcc_panel = devm_regulator_get(dev, "panel"); |
---|
470 | | - if (IS_ERR(pdata->vcc_panel)) { |
---|
471 | | - DRM_ERROR("panel regulator not found\n"); |
---|
472 | | - return PTR_ERR(pdata->vcc_panel); |
---|
473 | | - } |
---|
474 | | - |
---|
475 | | - /* GPIO for chip reset */ |
---|
476 | | - pdata->gpiod_reset = devm_gpiod_get(dev, "reset", GPIOD_ASIS); |
---|
477 | | - |
---|
478 | | - return PTR_ERR_OR_ZERO(pdata->gpiod_reset); |
---|
479 | 412 | } |
---|
480 | 413 | |
---|
481 | 414 | static int anx6345_config_dp_output(struct anx6345 *anx6345) |
---|
.. | .. |
---|
494 | 427 | return err; |
---|
495 | 428 | |
---|
496 | 429 | /* Force stream valid */ |
---|
497 | | - err = anx6345_set_bits(anx6345->map[I2C_IDX_DPTX], |
---|
| 430 | + return anx6345_set_bits(anx6345->map[I2C_IDX_DPTX], |
---|
498 | 431 | SP_DP_SYSTEM_CTRL_BASE + 3, |
---|
499 | 432 | SP_STRM_FORCE | SP_STRM_CTRL); |
---|
500 | | - if (err) |
---|
501 | | - return err; |
---|
502 | | - |
---|
503 | | - return 0; |
---|
504 | 433 | } |
---|
505 | 434 | |
---|
506 | 435 | static int anx6345_get_downstream_info(struct anx6345 *anx6345) |
---|
.. | .. |
---|
522 | 451 | return 0; |
---|
523 | 452 | } |
---|
524 | 453 | |
---|
525 | | -static int anx6345_probe_edid_from_of(struct anx6345 *anx6345) |
---|
526 | | -{ |
---|
527 | | - const u8 *edidp; |
---|
528 | | - int len; |
---|
529 | | - |
---|
530 | | - if (!anx6345->bridge.of_node) |
---|
531 | | - return -ENODEV; |
---|
532 | | - |
---|
533 | | - edidp = of_get_property(anx6345->bridge.of_node, "edid", &len); |
---|
534 | | - if (!edidp || len != EDID_LENGTH) |
---|
535 | | - return -EINVAL; |
---|
536 | | - |
---|
537 | | - anx6345->edid = devm_kmemdup(&anx6345->client->dev, edidp, |
---|
538 | | - len, GFP_KERNEL); |
---|
539 | | - |
---|
540 | | - if (!anx6345->edid) |
---|
541 | | - return -ENOMEM; |
---|
542 | | - |
---|
543 | | - return 0; |
---|
544 | | -} |
---|
545 | | - |
---|
546 | 454 | static int anx6345_get_modes(struct drm_connector *connector) |
---|
547 | 455 | { |
---|
548 | 456 | struct anx6345 *anx6345 = connector_to_anx6345(connector); |
---|
549 | 457 | int err, num_modes = 0; |
---|
550 | | - |
---|
551 | | - if (WARN_ON(!anx6345->powered)) |
---|
552 | | - return 0; |
---|
553 | | - |
---|
554 | | - if (anx6345->edid) |
---|
555 | | - return drm_add_edid_modes(connector, anx6345->edid); |
---|
| 458 | + bool power_off = false; |
---|
556 | 459 | |
---|
557 | 460 | mutex_lock(&anx6345->lock); |
---|
558 | 461 | |
---|
559 | | - err = anx6345_get_downstream_info(anx6345); |
---|
560 | | - if (err) { |
---|
561 | | - DRM_ERROR("Failed to get downstream info: %d\n", err); |
---|
562 | | - goto unlock; |
---|
563 | | - } |
---|
564 | | - |
---|
565 | | - anx6345->edid = drm_get_edid(connector, &anx6345->aux.ddc); |
---|
566 | | - if (!anx6345->edid) |
---|
567 | | - DRM_ERROR("Failed to read EDID from panel\n"); |
---|
568 | | - |
---|
569 | 462 | if (!anx6345->edid) { |
---|
570 | | - err = anx6345_probe_edid_from_of(anx6345); |
---|
| 463 | + if (!anx6345->powered) { |
---|
| 464 | + anx6345_poweron(anx6345); |
---|
| 465 | + power_off = true; |
---|
| 466 | + } |
---|
| 467 | + |
---|
| 468 | + err = anx6345_get_downstream_info(anx6345); |
---|
571 | 469 | if (err) { |
---|
572 | | - DRM_ERROR("Failed to probe EDID from device tree\n"); |
---|
| 470 | + DRM_ERROR("Failed to get downstream info: %d\n", err); |
---|
| 471 | + goto unlock; |
---|
| 472 | + } |
---|
| 473 | + |
---|
| 474 | + anx6345->edid = drm_get_edid(connector, &anx6345->aux.ddc); |
---|
| 475 | + if (!anx6345->edid) |
---|
| 476 | + DRM_ERROR("Failed to read EDID from panel\n"); |
---|
| 477 | + |
---|
| 478 | + err = drm_connector_update_edid_property(connector, |
---|
| 479 | + anx6345->edid); |
---|
| 480 | + if (err) { |
---|
| 481 | + DRM_ERROR("Failed to update EDID property: %d\n", err); |
---|
573 | 482 | goto unlock; |
---|
574 | 483 | } |
---|
575 | 484 | } |
---|
576 | 485 | |
---|
577 | | - err = drm_mode_connector_update_edid_property(connector, anx6345->edid); |
---|
578 | | - if (err) { |
---|
579 | | - DRM_ERROR("Failed to update EDID property: %d\n", err); |
---|
580 | | - goto unlock; |
---|
581 | | - } |
---|
| 486 | + num_modes += drm_add_edid_modes(connector, anx6345->edid); |
---|
582 | 487 | |
---|
583 | | - num_modes = drm_add_edid_modes(connector, anx6345->edid); |
---|
| 488 | + /* Driver currently supports only 6bpc */ |
---|
| 489 | + connector->display_info.bpc = 6; |
---|
584 | 490 | |
---|
585 | 491 | unlock: |
---|
| 492 | + if (power_off) |
---|
| 493 | + anx6345_poweroff(anx6345); |
---|
| 494 | + |
---|
586 | 495 | mutex_unlock(&anx6345->lock); |
---|
| 496 | + |
---|
| 497 | + if (!num_modes && anx6345->panel) |
---|
| 498 | + num_modes += drm_panel_get_modes(anx6345->panel, connector); |
---|
587 | 499 | |
---|
588 | 500 | return num_modes; |
---|
589 | 501 | } |
---|
590 | 502 | |
---|
591 | 503 | static const struct drm_connector_helper_funcs anx6345_connector_helper_funcs = { |
---|
592 | 504 | .get_modes = anx6345_get_modes, |
---|
593 | | - .best_encoder = drm_atomic_helper_best_encoder, |
---|
594 | 505 | }; |
---|
595 | 506 | |
---|
596 | | -static enum drm_connector_status anx6345_detect(struct drm_connector *connector, |
---|
597 | | - bool force) |
---|
| 507 | +static void |
---|
| 508 | +anx6345_connector_destroy(struct drm_connector *connector) |
---|
598 | 509 | { |
---|
599 | | - return connector_status_connected; |
---|
| 510 | + drm_connector_cleanup(connector); |
---|
600 | 511 | } |
---|
601 | 512 | |
---|
602 | 513 | static const struct drm_connector_funcs anx6345_connector_funcs = { |
---|
603 | 514 | .fill_modes = drm_helper_probe_single_connector_modes, |
---|
604 | | - .detect = anx6345_detect, |
---|
605 | | - .destroy = drm_connector_cleanup, |
---|
| 515 | + .destroy = anx6345_connector_destroy, |
---|
606 | 516 | .reset = drm_atomic_helper_connector_reset, |
---|
607 | 517 | .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, |
---|
608 | 518 | .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, |
---|
609 | 519 | }; |
---|
610 | 520 | |
---|
611 | | -static int anx6345_bridge_attach(struct drm_bridge *bridge) |
---|
| 521 | +static int anx6345_bridge_attach(struct drm_bridge *bridge, |
---|
| 522 | + enum drm_bridge_attach_flags flags) |
---|
612 | 523 | { |
---|
613 | 524 | struct anx6345 *anx6345 = bridge_to_anx6345(bridge); |
---|
614 | 525 | int err; |
---|
| 526 | + |
---|
| 527 | + if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) { |
---|
| 528 | + DRM_ERROR("Fix bridge driver to make connector optional!"); |
---|
| 529 | + return -EINVAL; |
---|
| 530 | + } |
---|
615 | 531 | |
---|
616 | 532 | if (!bridge->encoder) { |
---|
617 | 533 | DRM_ERROR("Parent encoder object not found"); |
---|
.. | .. |
---|
640 | 556 | drm_connector_helper_add(&anx6345->connector, |
---|
641 | 557 | &anx6345_connector_helper_funcs); |
---|
642 | 558 | |
---|
643 | | - anx6345->connector.port = anx6345->client->dev.of_node; |
---|
| 559 | + err = drm_connector_register(&anx6345->connector); |
---|
| 560 | + if (err) { |
---|
| 561 | + DRM_ERROR("Failed to register connector: %d\n", err); |
---|
| 562 | + return err; |
---|
| 563 | + } |
---|
| 564 | + |
---|
644 | 565 | anx6345->connector.polled = DRM_CONNECTOR_POLL_HPD; |
---|
645 | 566 | |
---|
646 | | - err = drm_mode_connector_attach_encoder(&anx6345->connector, |
---|
647 | | - bridge->encoder); |
---|
| 567 | + err = drm_connector_attach_encoder(&anx6345->connector, |
---|
| 568 | + bridge->encoder); |
---|
648 | 569 | if (err) { |
---|
649 | 570 | DRM_ERROR("Failed to link up connector to encoder: %d\n", err); |
---|
650 | 571 | return err; |
---|
.. | .. |
---|
653 | 574 | return 0; |
---|
654 | 575 | } |
---|
655 | 576 | |
---|
656 | | -static bool anx6345_bridge_mode_fixup(struct drm_bridge *bridge, |
---|
657 | | - const struct drm_display_mode *mode, |
---|
658 | | - struct drm_display_mode *adjusted_mode) |
---|
| 577 | +static enum drm_mode_status |
---|
| 578 | +anx6345_bridge_mode_valid(struct drm_bridge *bridge, |
---|
| 579 | + const struct drm_display_info *info, |
---|
| 580 | + const struct drm_display_mode *mode) |
---|
659 | 581 | { |
---|
660 | 582 | if (mode->flags & DRM_MODE_FLAG_INTERLACE) |
---|
661 | | - return false; |
---|
| 583 | + return MODE_NO_INTERLACE; |
---|
662 | 584 | |
---|
663 | 585 | /* Max 1200p at 5.4 Ghz, one lane */ |
---|
664 | 586 | if (mode->clock > 154000) |
---|
665 | | - return false; |
---|
| 587 | + return MODE_CLOCK_HIGH; |
---|
666 | 588 | |
---|
667 | | - return true; |
---|
| 589 | + return MODE_OK; |
---|
668 | 590 | } |
---|
669 | 591 | |
---|
670 | 592 | static void anx6345_bridge_disable(struct drm_bridge *bridge) |
---|
.. | .. |
---|
674 | 596 | /* Power off all modules except configuration registers access */ |
---|
675 | 597 | anx6345_set_bits(anx6345->map[I2C_IDX_TXCOM], SP_POWERDOWN_CTRL_REG, |
---|
676 | 598 | SP_HDCP_PD | SP_AUDIO_PD | SP_VIDEO_PD | SP_LINK_PD); |
---|
677 | | -} |
---|
| 599 | + if (anx6345->panel) |
---|
| 600 | + drm_panel_disable(anx6345->panel); |
---|
678 | 601 | |
---|
679 | | -static void anx6345_bridge_mode_set(struct drm_bridge *bridge, |
---|
680 | | - struct drm_display_mode *mode, |
---|
681 | | - struct drm_display_mode *adjusted_mode) |
---|
682 | | -{ |
---|
683 | | - struct anx6345 *anx6345 = bridge_to_anx6345(bridge); |
---|
684 | | - |
---|
685 | | - if (WARN_ON(!anx6345->powered)) |
---|
686 | | - return; |
---|
| 602 | + if (anx6345->powered) |
---|
| 603 | + anx6345_poweroff(anx6345); |
---|
687 | 604 | } |
---|
688 | 605 | |
---|
689 | 606 | static void anx6345_bridge_enable(struct drm_bridge *bridge) |
---|
690 | 607 | { |
---|
691 | 608 | struct anx6345 *anx6345 = bridge_to_anx6345(bridge); |
---|
692 | 609 | int err; |
---|
| 610 | + |
---|
| 611 | + if (anx6345->panel) |
---|
| 612 | + drm_panel_enable(anx6345->panel); |
---|
693 | 613 | |
---|
694 | 614 | err = anx6345_start(anx6345); |
---|
695 | 615 | if (err) { |
---|
.. | .. |
---|
704 | 624 | |
---|
705 | 625 | static const struct drm_bridge_funcs anx6345_bridge_funcs = { |
---|
706 | 626 | .attach = anx6345_bridge_attach, |
---|
707 | | - .mode_fixup = anx6345_bridge_mode_fixup, |
---|
| 627 | + .mode_valid = anx6345_bridge_mode_valid, |
---|
708 | 628 | .disable = anx6345_bridge_disable, |
---|
709 | | - .mode_set = anx6345_bridge_mode_set, |
---|
710 | 629 | .enable = anx6345_bridge_enable, |
---|
711 | 630 | }; |
---|
712 | 631 | |
---|
.. | .. |
---|
724 | 643 | .reg_bits = 8, |
---|
725 | 644 | .val_bits = 8, |
---|
726 | 645 | .max_register = 0xff, |
---|
| 646 | + .cache_type = REGCACHE_NONE, |
---|
727 | 647 | }; |
---|
728 | 648 | |
---|
729 | 649 | static const u16 anx6345_chipid_list[] = { |
---|
730 | 650 | 0x6345, |
---|
731 | 651 | }; |
---|
732 | 652 | |
---|
| 653 | +static bool anx6345_get_chip_id(struct anx6345 *anx6345) |
---|
| 654 | +{ |
---|
| 655 | + unsigned int i, idl, idh, version; |
---|
| 656 | + |
---|
| 657 | + if (regmap_read(anx6345->map[I2C_IDX_TXCOM], SP_DEVICE_IDL_REG, &idl)) |
---|
| 658 | + return false; |
---|
| 659 | + |
---|
| 660 | + if (regmap_read(anx6345->map[I2C_IDX_TXCOM], SP_DEVICE_IDH_REG, &idh)) |
---|
| 661 | + return false; |
---|
| 662 | + |
---|
| 663 | + anx6345->chipid = (u8)idl | ((u8)idh << 8); |
---|
| 664 | + |
---|
| 665 | + if (regmap_read(anx6345->map[I2C_IDX_TXCOM], SP_DEVICE_VERSION_REG, |
---|
| 666 | + &version)) |
---|
| 667 | + return false; |
---|
| 668 | + |
---|
| 669 | + for (i = 0; i < ARRAY_SIZE(anx6345_chipid_list); i++) { |
---|
| 670 | + if (anx6345->chipid == anx6345_chipid_list[i]) { |
---|
| 671 | + DRM_INFO("Found ANX%x (ver. %d) eDP Transmitter\n", |
---|
| 672 | + anx6345->chipid, version); |
---|
| 673 | + return true; |
---|
| 674 | + } |
---|
| 675 | + } |
---|
| 676 | + |
---|
| 677 | + DRM_ERROR("ANX%x (ver. %d) not supported by this driver\n", |
---|
| 678 | + anx6345->chipid, version); |
---|
| 679 | + |
---|
| 680 | + return false; |
---|
| 681 | +} |
---|
| 682 | + |
---|
733 | 683 | static int anx6345_i2c_probe(struct i2c_client *client, |
---|
734 | 684 | const struct i2c_device_id *id) |
---|
735 | 685 | { |
---|
736 | 686 | struct anx6345 *anx6345; |
---|
737 | | - struct anx6345_platform_data *pdata; |
---|
738 | | - unsigned int i, idl, idh, version; |
---|
739 | | - bool found = false; |
---|
740 | | - int err; |
---|
| 687 | + struct device *dev; |
---|
| 688 | + int i, err; |
---|
741 | 689 | |
---|
742 | 690 | anx6345 = devm_kzalloc(&client->dev, sizeof(*anx6345), GFP_KERNEL); |
---|
743 | 691 | if (!anx6345) |
---|
744 | 692 | return -ENOMEM; |
---|
745 | 693 | |
---|
746 | | - pdata = &anx6345->pdata; |
---|
747 | | - |
---|
748 | 694 | mutex_init(&anx6345->lock); |
---|
749 | 695 | |
---|
750 | | -#if IS_ENABLED(CONFIG_OF) |
---|
751 | 696 | anx6345->bridge.of_node = client->dev.of_node; |
---|
752 | | -#endif |
---|
753 | 697 | |
---|
754 | 698 | anx6345->client = client; |
---|
755 | 699 | i2c_set_clientdata(client, anx6345); |
---|
756 | 700 | |
---|
757 | | - err = anx6345_init_pdata(anx6345); |
---|
758 | | - if (err) { |
---|
759 | | - DRM_ERROR("Failed to initialize pdata: %d\n", err); |
---|
| 701 | + dev = &anx6345->client->dev; |
---|
| 702 | + |
---|
| 703 | + err = drm_of_find_panel_or_bridge(client->dev.of_node, 1, 0, |
---|
| 704 | + &anx6345->panel, NULL); |
---|
| 705 | + if (err == -EPROBE_DEFER) |
---|
760 | 706 | return err; |
---|
| 707 | + |
---|
| 708 | + if (err) |
---|
| 709 | + DRM_DEBUG("No panel found\n"); |
---|
| 710 | + |
---|
| 711 | + /* 1.2V digital core power regulator */ |
---|
| 712 | + anx6345->dvdd12 = devm_regulator_get(dev, "dvdd12"); |
---|
| 713 | + if (IS_ERR(anx6345->dvdd12)) { |
---|
| 714 | + if (PTR_ERR(anx6345->dvdd12) != -EPROBE_DEFER) |
---|
| 715 | + DRM_ERROR("Failed to get dvdd12 supply (%ld)\n", |
---|
| 716 | + PTR_ERR(anx6345->dvdd12)); |
---|
| 717 | + return PTR_ERR(anx6345->dvdd12); |
---|
| 718 | + } |
---|
| 719 | + |
---|
| 720 | + /* 2.5V digital core power regulator */ |
---|
| 721 | + anx6345->dvdd25 = devm_regulator_get(dev, "dvdd25"); |
---|
| 722 | + if (IS_ERR(anx6345->dvdd25)) { |
---|
| 723 | + if (PTR_ERR(anx6345->dvdd25) != -EPROBE_DEFER) |
---|
| 724 | + DRM_ERROR("Failed to get dvdd25 supply (%ld)\n", |
---|
| 725 | + PTR_ERR(anx6345->dvdd25)); |
---|
| 726 | + return PTR_ERR(anx6345->dvdd25); |
---|
| 727 | + } |
---|
| 728 | + |
---|
| 729 | + /* GPIO for chip reset */ |
---|
| 730 | + anx6345->gpiod_reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); |
---|
| 731 | + if (IS_ERR(anx6345->gpiod_reset)) { |
---|
| 732 | + DRM_ERROR("Reset gpio not found\n"); |
---|
| 733 | + return PTR_ERR(anx6345->gpiod_reset); |
---|
761 | 734 | } |
---|
762 | 735 | |
---|
763 | 736 | /* Map slave addresses of ANX6345 */ |
---|
764 | 737 | for (i = 0; i < I2C_NUM_ADDRESSES; i++) { |
---|
765 | 738 | if (anx6345_i2c_addresses[i] >> 1 != client->addr) |
---|
766 | | - anx6345->i2c_clients[i] = i2c_new_dummy(client->adapter, |
---|
| 739 | + anx6345->i2c_clients[i] = i2c_new_dummy_device(client->adapter, |
---|
767 | 740 | anx6345_i2c_addresses[i] >> 1); |
---|
768 | 741 | else |
---|
769 | 742 | anx6345->i2c_clients[i] = client; |
---|
770 | 743 | |
---|
771 | | - if (!anx6345->i2c_clients[i]) { |
---|
772 | | - err = -ENOMEM; |
---|
| 744 | + if (IS_ERR(anx6345->i2c_clients[i])) { |
---|
| 745 | + err = PTR_ERR(anx6345->i2c_clients[i]); |
---|
773 | 746 | DRM_ERROR("Failed to reserve I2C bus %02x\n", |
---|
774 | 747 | anx6345_i2c_addresses[i]); |
---|
775 | 748 | goto err_unregister_i2c; |
---|
.. | .. |
---|
787 | 760 | |
---|
788 | 761 | /* Look for supported chip ID */ |
---|
789 | 762 | anx6345_poweron(anx6345); |
---|
| 763 | + if (anx6345_get_chip_id(anx6345)) { |
---|
| 764 | + anx6345->bridge.funcs = &anx6345_bridge_funcs; |
---|
| 765 | + drm_bridge_add(&anx6345->bridge); |
---|
790 | 766 | |
---|
791 | | - err = regmap_read(anx6345->map[I2C_IDX_TXCOM], SP_DEVICE_IDL_REG, |
---|
792 | | - &idl); |
---|
793 | | - if (err) |
---|
794 | | - goto err_poweroff; |
---|
795 | | - |
---|
796 | | - err = regmap_read(anx6345->map[I2C_IDX_TXCOM], SP_DEVICE_IDH_REG, |
---|
797 | | - &idh); |
---|
798 | | - if (err) |
---|
799 | | - goto err_poweroff; |
---|
800 | | - |
---|
801 | | - anx6345->chipid = (u8)idl | ((u8)idh << 8); |
---|
802 | | - |
---|
803 | | - err = regmap_read(anx6345->map[I2C_IDX_TXCOM], SP_DEVICE_VERSION_REG, |
---|
804 | | - &version); |
---|
805 | | - if (err) |
---|
806 | | - goto err_poweroff; |
---|
807 | | - |
---|
808 | | - for (i = 0; i < ARRAY_SIZE(anx6345_chipid_list); i++) { |
---|
809 | | - if (anx6345->chipid == anx6345_chipid_list[i]) { |
---|
810 | | - DRM_INFO("Found ANX%x (ver. %d) eDP Transmitter\n", |
---|
811 | | - anx6345->chipid, version); |
---|
812 | | - found = true; |
---|
813 | | - break; |
---|
814 | | - } |
---|
815 | | - } |
---|
816 | | - |
---|
817 | | - if (!found) { |
---|
818 | | - DRM_ERROR("ANX%x (ver. %d) not supported by this driver\n", |
---|
819 | | - anx6345->chipid, version); |
---|
| 767 | + return 0; |
---|
| 768 | + } else { |
---|
| 769 | + anx6345_poweroff(anx6345); |
---|
820 | 770 | err = -ENODEV; |
---|
821 | | - goto err_poweroff; |
---|
822 | 771 | } |
---|
823 | | - |
---|
824 | | - anx6345->bridge.funcs = &anx6345_bridge_funcs; |
---|
825 | | - |
---|
826 | | - drm_bridge_add(&anx6345->bridge); |
---|
827 | | - |
---|
828 | | - return 0; |
---|
829 | | - |
---|
830 | | -err_poweroff: |
---|
831 | | - anx6345_poweroff(anx6345); |
---|
832 | 772 | |
---|
833 | 773 | err_unregister_i2c: |
---|
834 | 774 | unregister_i2c_dummy_clients(anx6345); |
---|
.. | .. |
---|
843 | 783 | |
---|
844 | 784 | unregister_i2c_dummy_clients(anx6345); |
---|
845 | 785 | |
---|
| 786 | + kfree(anx6345->edid); |
---|
| 787 | + |
---|
| 788 | + mutex_destroy(&anx6345->lock); |
---|
| 789 | + |
---|
846 | 790 | return 0; |
---|
847 | 791 | } |
---|
848 | 792 | |
---|
.. | .. |
---|
852 | 796 | }; |
---|
853 | 797 | MODULE_DEVICE_TABLE(i2c, anx6345_id); |
---|
854 | 798 | |
---|
855 | | -#if IS_ENABLED(CONFIG_OF) |
---|
856 | 799 | static const struct of_device_id anx6345_match_table[] = { |
---|
857 | 800 | { .compatible = "analogix,anx6345", }, |
---|
858 | 801 | { /* sentinel */ }, |
---|
859 | 802 | }; |
---|
860 | 803 | MODULE_DEVICE_TABLE(of, anx6345_match_table); |
---|
861 | | -#endif |
---|
862 | 804 | |
---|
863 | 805 | static struct i2c_driver anx6345_driver = { |
---|
864 | 806 | .driver = { |
---|