edatec Open Source HMI for 10 inches panel driver#7362
Conversation
Signed-off-by: lzunspp <bli@edatec.cn>
6by9
left a comment
There was a problem hiding this comment.
I'd missed that you'd posted both the 7" and 10" drivers yesterday.
The only changes I would expect to see to panel-ilitek-ili9881c.c is to add the init sequence, timing, descriptor, and compatible string. All the rest should be achievable in device tree.
The regulator driver here is near identical to that baked into the panel driver for the 7". This driver should be reused on the 7".
| msleep(20); | ||
|
|
||
| if (is_rzw) { | ||
| gpiod_set_value_cansleep(ctx->reset, 1); |
There was a problem hiding this comment.
No. If you need to invert the sense of a GPIO, do so in device tree
eg
reset-gpios = <®_display 2 1>;
or preferably
#include <dt-bindings/gpio/gpio.h>
...
reset-gpios = <®_display 2 GPIO_ACTIVE_LOW>;
| gpiod_set_value_cansleep(ctx->reset, 1); | ||
| if (is_rzw_t101p136cq_panel(ctx)) { | ||
| gpiod_set_value_cansleep(ctx->reset, 0); | ||
| msleep(100); |
There was a problem hiding this comment.
Why do you need extra time when turning off?
If you need a minimum of 100ms between turning off and on again, then do it in device tree for the regulator
off-on-delay-us = <100000>;
There was a problem hiding this comment.
i see turing off panel don't need delay , i will delete . this is copy from source driver , diffirent kernel version source code has little diffirent .
| .height_mm = 216, | ||
| }; | ||
|
|
||
| static const struct drm_display_mode t101p136cq_rpi5_2lane_mode = { |
There was a problem hiding this comment.
Isn't this identical to t101p136cq_rpi4_2lane_mode?
There was a problem hiding this comment.
yes it's the same , i will delete this config
| }; | ||
|
|
||
| static const struct drm_display_mode t101p136cq_rpi4_2lane_mode = { | ||
| .clock = 78086, //60Hz |
There was a problem hiding this comment.
If the only difference between t101p136cq_default_mode and this is that one runs over 4 lanes, then the timings shouldn't need to change.
There was a problem hiding this comment.
because , in early time 2 lan can't arrive 60 HZ so we Separate config . we will use the same timings config
| @@ -0,0 +1,355 @@ | |||
| // SPDX-License-Identifier: GPL-2.0 | |||
| /* | |||
| * Copyright (C) 2020 Marek Vasut <marex@denx.de> | |||
There was a problem hiding this comment.
i'm sorry , i will delete this
| }; | ||
|
|
||
| static const struct gpio_signal_mappings mappings[NUM_GPIO] = { | ||
| [LCD_BL_EN_N] = { REG_OUTPUT, PIN_LCD_BL_EN }, |
There was a problem hiding this comment.
Why the need for this lookup table? Just copying and pasting from a different driver is not always the best policy.
There was a problem hiding this comment.
this reason is same with 7 inches branch.
this is mcu code:
gpio_bit_write(GPIOA, GPIO_PIN_4, RESET); //LCD BL PWM
gpio_bit_write(GPIOA, GPIO_PIN_5, SET); //LCD_RST_L
gpio_bit_write(GPIOA, GPIO_PIN_6, SET); //TP_RST_L
gpio_bit_write(GPIOA, GPIO_PIN_7, SET); //LCD BL EN
we will control and used this gpios in mcu .
this is soc driver code:
static const struct gpio_signal_mappings mappings[NUM_GPIO] = {
[LCD_BL_EN_N] = { REG_OUTPUT, PIN_LCD_BL_EN },
[LCD_BL_PWM_N] = { REG_OUTPUT, PIN_LCD_BL_PWM },
[LCD_RST_N] = { REG_OUTPUT, PIN_LCD_RST },
[TP_RST_N] = { REG_OUTPUT, PIN_TP_RST },
};
LCD_BL_EN_N enable lcd backlight
LCD_BL_PWM_N this is control blacklight pwm
LCD_RST_N LCD reset pin
TP_RST_N TP reset pin
| @@ -0,0 +1,183 @@ | |||
| # CONFIG_LOCALVERSION_AUTO is not set | |||
There was a problem hiding this comment.
Why do we need a special defconfig for this hardware?
There was a problem hiding this comment.
because we will add REGULATOR_EDATEC_10INCH=m ,no this deconfig . which file can we write this config ? if we add config to other defconfig It may affect other files
| vdd_lcd: fixedregulator_lcd { | ||
| compatible = "regulator-fixed"; | ||
| regulator-name = "vdd_lcd"; | ||
| regulator-max-microvolt = <5000000>; |
There was a problem hiding this comment.
Defining the voltages is fairly redundant when it is a fixed regulator.
There was a problem hiding this comment.
bias IC support voltage for backlight ic , bias IC will support diffirent voltage with diffirent backlight ic . this config can meet the requirements
| regulator-min-microvolt = <5000000>; | ||
|
|
||
| gpios = <®_display 4 0>; | ||
| regulator-boot-on; |
There was a problem hiding this comment.
This feels like an odd property to be setting on this regulator
Docs at https://github.com/raspberrypi/linux/blob/rpi-6.18.y/Documentation/devicetree/bindings/regulator/regulator.yaml#L44-L51
It's expected that this regulator was left on by the bootloader. If the bootloader didn't leave it on then OS should turn it on at boot but shouldn't prevent it from being turned off later. This property is intended to only be used for regulators where software cannot read the state of the regulator.
There was a problem hiding this comment.
yes this dts is config for edatec-panel-regulator.c
| .init = t101p136cq_2lane_init, | ||
| .init_length = ARRAY_SIZE(t101p136cq_2lane_init), | ||
| .mode = &t101p136cq_rpi5_2lane_mode, | ||
| .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_LPM, |
There was a problem hiding this comment.
Why the difference in the flags between these variants?
vc4 currently ignores almost all of them anyway.
There was a problem hiding this comment.
static const struct ili9881c_desc t101p136cq_rpi4_lite_desc = {
.init = t101p136cq_2lane_init,
.init_length = ARRAY_SIZE(t101p136cq_2lane_init),
.mode = &t101p136cq_rpi4_2lane_mode,
.mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | MIPI_DSI_MODE_LPM,
.lanes = 2,
};
static const struct ili9881c_desc t101p136cq_rpi5_desc = {
.init = t101p136cq_2lane_init,
.init_length = ARRAY_SIZE(t101p136cq_2lane_init),
.mode = &t101p136cq_rpi5_2lane_mode,
.mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_LPM,
.lanes = 2,
};
you mean this two config mode_flags shoule be the same ? we merge some drivers code in all one , and copy config from source code.
this is 10 inches panel driver please check them , thanks!