old mode 100644new mode 100755.. | .. |
---|
45 | 45 | bool power_invert; |
---|
46 | 46 | u32 bus_format; |
---|
47 | 47 | unsigned int bpc; |
---|
| 48 | + unsigned int lvds_index; |
---|
48 | 49 | |
---|
49 | 50 | struct { |
---|
50 | 51 | unsigned int prepare; |
---|
.. | .. |
---|
66 | 67 | struct udevice *backlight; |
---|
67 | 68 | struct gpio_desc enable_gpio; |
---|
68 | 69 | struct gpio_desc reset_gpio; |
---|
| 70 | + struct gpio_desc edp_bl_on; |
---|
| 71 | + struct gpio_desc edp_bl_en; |
---|
| 72 | + |
---|
| 73 | + struct gpio_desc lvds_gpio0; |
---|
| 74 | + struct gpio_desc lvds_gpio1; |
---|
| 75 | + struct gpio_desc lvds_gpio2; |
---|
| 76 | + struct gpio_desc lvds_gpio3; |
---|
69 | 77 | |
---|
70 | 78 | int cmd_type; |
---|
71 | 79 | struct gpio_desc spi_sdi_gpio; |
---|
.. | .. |
---|
275 | 283 | |
---|
276 | 284 | if (priv->prepared) |
---|
277 | 285 | return; |
---|
| 286 | + |
---|
| 287 | + /*7511 LVDS IO Control start*/ |
---|
| 288 | + printk("nodka_lvds_index = %d\n",plat->lvds_index); |
---|
| 289 | + |
---|
| 290 | + ret = plat->lvds_index & 1; |
---|
| 291 | + if (dm_gpio_is_valid(&priv->lvds_gpio0)) |
---|
| 292 | + dm_gpio_set_value(&priv->lvds_gpio0, ret); |
---|
| 293 | + ret = dm_gpio_get_value(&priv->lvds_gpio0); |
---|
| 294 | + printf("lvds_gpio0 : %d\n",ret); |
---|
| 295 | + |
---|
| 296 | + ret = plat->lvds_index >> 1 & 1; |
---|
| 297 | + if (dm_gpio_is_valid(&priv->lvds_gpio1)) |
---|
| 298 | + dm_gpio_set_value(&priv->lvds_gpio1, ret); |
---|
| 299 | + ret = dm_gpio_get_value(&priv->lvds_gpio1); |
---|
| 300 | + printf("lvds_gpio1 : %d\n",ret); |
---|
| 301 | + |
---|
| 302 | + ret = plat->lvds_index >> 2 & 1; |
---|
| 303 | + if (dm_gpio_is_valid(&priv->lvds_gpio2)) |
---|
| 304 | + dm_gpio_set_value(&priv->lvds_gpio2, ret); |
---|
| 305 | + ret = dm_gpio_get_value(&priv->lvds_gpio2); |
---|
| 306 | + printf("lvds_gpio2 : %d\n",ret); |
---|
| 307 | + |
---|
| 308 | + ret = plat->lvds_index >> 3 & 1; |
---|
| 309 | + if (dm_gpio_is_valid(&priv->lvds_gpio3)) |
---|
| 310 | + dm_gpio_set_value(&priv->lvds_gpio3, ret); |
---|
| 311 | + ret = dm_gpio_get_value(&priv->lvds_gpio3); |
---|
| 312 | + printf("lvds_gpio3 : %d\n",ret); |
---|
| 313 | + mdelay(100); |
---|
| 314 | +/*7511 LVDS IO Control end*/ |
---|
278 | 315 | |
---|
279 | 316 | if (priv->power_supply) |
---|
280 | 317 | regulator_set_enable(priv->power_supply, !plat->power_invert); |
---|
281 | | - |
---|
| 318 | + |
---|
| 319 | + if (dm_gpio_is_valid(&priv->edp_bl_on)) |
---|
| 320 | + dm_gpio_set_value(&priv->edp_bl_on, 1); |
---|
| 321 | + |
---|
| 322 | + if (dm_gpio_is_valid(&priv->edp_bl_en)) |
---|
| 323 | + dm_gpio_set_value(&priv->edp_bl_en, 1); |
---|
| 324 | + |
---|
282 | 325 | if (dm_gpio_is_valid(&priv->enable_gpio)) |
---|
283 | 326 | dm_gpio_set_value(&priv->enable_gpio, 1); |
---|
284 | | - |
---|
| 327 | + |
---|
285 | 328 | if (plat->delay.prepare) |
---|
286 | 329 | mdelay(plat->delay.prepare); |
---|
287 | | - |
---|
| 330 | + |
---|
288 | 331 | if (dm_gpio_is_valid(&priv->reset_gpio)) |
---|
289 | 332 | dm_gpio_set_value(&priv->reset_gpio, 1); |
---|
290 | | - |
---|
291 | | - if (plat->delay.reset) |
---|
292 | | - mdelay(plat->delay.reset); |
---|
293 | | - |
---|
| 333 | + mdelay(50); |
---|
294 | 334 | if (dm_gpio_is_valid(&priv->reset_gpio)) |
---|
295 | 335 | dm_gpio_set_value(&priv->reset_gpio, 0); |
---|
| 336 | + |
---|
| 337 | + mdelay(200); |
---|
296 | 338 | |
---|
297 | 339 | if (plat->delay.init) |
---|
298 | 340 | mdelay(plat->delay.init); |
---|
.. | .. |
---|
407 | 449 | plat->delay.disable = dev_read_u32_default(dev, "disable-delay-ms", 0); |
---|
408 | 450 | plat->delay.init = dev_read_u32_default(dev, "init-delay-ms", 0); |
---|
409 | 451 | plat->delay.reset = dev_read_u32_default(dev, "reset-delay-ms", 0); |
---|
| 452 | + plat->lvds_index = dev_read_u32_default(dev, "nodka-lvds", 0); |
---|
410 | 453 | |
---|
411 | 454 | plat->bus_format = dev_read_u32_default(dev, "bus-format", |
---|
412 | 455 | MEDIA_BUS_FMT_RBG888_1X24); |
---|
.. | .. |
---|
457 | 500 | int ret; |
---|
458 | 501 | const char *cmd_type; |
---|
459 | 502 | |
---|
| 503 | + ret = gpio_request_by_name(dev, "edp-bl-gpios", 0, |
---|
| 504 | + &priv->edp_bl_on, GPIOD_IS_OUT); |
---|
| 505 | + if (ret && ret != -ENOENT) { |
---|
| 506 | + printf("%s: Cannot get enable GPIO: %d\n", __func__, ret); |
---|
| 507 | + return ret; |
---|
| 508 | + } |
---|
| 509 | + |
---|
| 510 | + ret = gpio_request_by_name(dev, "edp-bl-en", 0, |
---|
| 511 | + &priv->edp_bl_en, GPIOD_IS_OUT); |
---|
| 512 | + if (ret && ret != -ENOENT) { |
---|
| 513 | + printf("%s: Cannot get enable GPIO: %d\n", __func__, ret); |
---|
| 514 | + return ret; |
---|
| 515 | + } |
---|
| 516 | + |
---|
460 | 517 | ret = gpio_request_by_name(dev, "enable-gpios", 0, |
---|
461 | 518 | &priv->enable_gpio, GPIOD_IS_OUT); |
---|
462 | 519 | if (ret && ret != -ENOENT) { |
---|
.. | .. |
---|
471 | 528 | return ret; |
---|
472 | 529 | } |
---|
473 | 530 | |
---|
| 531 | + ret = gpio_request_by_name(dev, "lvds-gpio0", 0, |
---|
| 532 | + &priv->lvds_gpio0, GPIOD_IS_OUT); |
---|
| 533 | + if (ret && ret != -ENOENT) { |
---|
| 534 | + printf("%s: Cannot get lvds-gpio0: %d\n", __func__, ret); |
---|
| 535 | + return ret; |
---|
| 536 | + } |
---|
| 537 | + |
---|
| 538 | + ret = gpio_request_by_name(dev, "lvds-gpio1", 0, |
---|
| 539 | + &priv->lvds_gpio1, GPIOD_IS_OUT); |
---|
| 540 | + if (ret && ret != -ENOENT) { |
---|
| 541 | + printf("%s: Cannot get lvds-gpio1: %d\n", __func__, ret); |
---|
| 542 | + return ret; |
---|
| 543 | + } |
---|
| 544 | + |
---|
| 545 | + ret = gpio_request_by_name(dev, "lvds-gpio2", 0, |
---|
| 546 | + &priv->lvds_gpio2, GPIOD_IS_OUT); |
---|
| 547 | + if (ret && ret != -ENOENT) { |
---|
| 548 | + printf("%s: Cannot get lvds-gpio2: %d\n", __func__, ret); |
---|
| 549 | + return ret; |
---|
| 550 | + } |
---|
| 551 | + |
---|
| 552 | + ret = gpio_request_by_name(dev, "lvds-gpio3", 0, |
---|
| 553 | + &priv->lvds_gpio3, GPIOD_IS_OUT); |
---|
| 554 | + if (ret && ret != -ENOENT) { |
---|
| 555 | + printf("%s: Cannot get lvds-gpio3: %d\n", __func__, ret); |
---|
| 556 | + return ret; |
---|
| 557 | + } |
---|
| 558 | + |
---|
474 | 559 | ret = uclass_get_device_by_phandle(UCLASS_PANEL_BACKLIGHT, dev, |
---|
475 | 560 | "backlight", &priv->backlight); |
---|
476 | 561 | if (ret && ret != -ENOENT) { |
---|