define DEBUG before any include in the .c file
#define DEBUG
#undef CONFIG_LOGLEVEL
#define CONFIG_LOGLEVEL 7
#define LOG_DEBUG
#include <common.h>
#include <bmp_layout.h>
#include <dm.h>
#include <mapmem.h>
#include <splash.h>
#include <video.h>
#include <watchdog.h>
#include <asm/unaligned.h>
...
dts-side:
rm67191_panel {
compatible = "raydium,rm67191";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_mipi_dsi_en>;
reset-gpio = <&gpio1 8 GPIO_ACTIVE_LOW>;
dsi-lanes = <4>;
video-mode = <2>; /* 0: burst mode
* 1: non-burst mode with sync event
* 2: non-burst mode with sync pulse
*/
panel-width-mm = <68>;
panel-height-mm = <121>;
status = "okay";
port {
rm67191_from_dsim: endpoint {
remote-endpoint = <&dsim_to_rm67191>;
};
};
};
Driver side:
ret = gpio_request_by_name(dev, "reset-gpio", 0, &priv->reset,
GPIOD_IS_OUT);
if (ret) {
printf("Warning: cannot get reset GPIO\n");
if (ret != -ENOENT)
return ret;
}
/* reset panel */
ret = dm_gpio_set_value(&priv->reset, true);
if (ret)
printf("reset gpio fails to set true\n");
mdelay(100);
ret = dm_gpio_set_value(&priv->reset, false);
if (ret)
printf("reset gpio fails to set true\n");
mdelay(100);
return 0;
dts-side:
rm67191_panel {
compatible = "raydium,rm67191";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_mipi_dsi_en>;
reset-gpio = <&gpio1 8 GPIO_ACTIVE_LOW>;
dsi-lanes = <4>;
video-mode = <2>; /* 0: burst mode
* 1: non-burst mode with sync event
* 2: non-burst mode with sync pulse
*/
panel-width-mm = <68>;
panel-height-mm = <121>;
status = "okay";
port {
rm67191_from_dsim: endpoint {
remote-endpoint = <&dsim_to_rm67191>;
};
};
};
driver-side:
ret = dev_read_u32(dev, "video-mode", &video_mode);
if (!ret) {
printf("property read\n");
}
#include <asm/io.h>
u32 val = readl(CCM_BASE_ADDR + 0xbb80);
printk("KERN_ERR, DEBUG FUNC = %s, LINE = %d, reg = %x\n", __func__, __LINE__, val);
writel(0x10040032, CCM_BASE_ADDR + 0xbb80);
printk("KERN_ERR, DEBUG FUNC = %s, LINE = %d, reg = %x\n", __func__, __LINE__, val);
backlight: lcd-backlight {
status = "okay";
compatible = "pwm-backlight";
pwms = <&pwm1 0 5000000>;
brightness-levels = <0 255>;
num-interpolated-steps = <255>;
default-brightness-level = <250>;
};
struct udevice *backlight;
ret = uclass_get_device_by_phandle(UCLASS_PANEL_BACKLIGHT, dev,
"backlight", &priv->backlight);
if (ret) {
debug("%s: Warning: cannot get backlight: ret=%d\n",
__func__, ret);
if (ret != -ENOENT)
return ret;
}