static int parse_decon_platdata(struct device_node *np) { u32 temp; char *pprop; /* parse for display controller */ #ifndef CONFIG_FB_I80_COMMAND_MODE DT_READ_U32(np, "samsung,vidcon1", g_decon_platdata.vidcon1); #endif DT_READ_U32(np, "samsung,default_win", g_decon_platdata.default_win); DT_READ_U32(np, "samsung,max_bpp", g_fb_win0.max_bpp); DT_READ_U32(np, "samsung,default_bpp", g_fb_win0.default_bpp); g_decon_platdata.win[0] = &g_fb_win0; g_decon_platdata.win[1] = &g_fb_win0; g_decon_platdata.win[2] = &g_fb_win0; g_decon_platdata.win[3] = &g_fb_win0; g_decon_platdata.win[4] = &g_fb_win0; return 0; exception: pr_err("%s: no property in the node, fb_variant.\n", pprop); return -EINVAL; }
int fimc_is_sensor_parse_dt_with_companion(struct platform_device *pdev) { int ret = 0; u32 temp; char *pprop; struct exynos_platform_fimc_is_sensor *pdata; struct device_node *dnode; struct device *dev; int gpio_reset = 0, gpio_standby = 0; #ifdef CONFIG_SOC_EXYNOS5422 int gpios_cam_en = 0; #endif #if !defined(CONFIG_USE_VENDER_FEATURE) /* LSI Patch */ int gpio_cam_en = 0; int gpio_comp_en, gpio_comp_rst; #else const char *name; #endif #ifdef CONFIG_SOC_EXYNOS5433 struct pinctrl *pinctrl_ch = NULL; #endif int gpio_none = 0; u32 id; BUG_ON(!pdev); BUG_ON(!pdev->dev.of_node); dev = &pdev->dev; dnode = dev->of_node; pdata = kzalloc(sizeof(struct exynos_platform_fimc_is_sensor), GFP_KERNEL); if (!pdata) { pr_err("%s: no memory for platform data\n", __func__); return -ENOMEM; } pdata->gpio_cfg = exynos_fimc_is_sensor_pins_cfg; pdata->iclk_cfg = exynos_fimc_is_sensor_iclk_cfg; pdata->iclk_on = exynos_fimc_is_sensor_iclk_on; pdata->iclk_off = exynos_fimc_is_sensor_iclk_off; pdata->mclk_on = exynos_fimc_is_sensor_mclk_on; pdata->mclk_off = exynos_fimc_is_sensor_mclk_off; ret = of_property_read_u32(dnode, "scenario", &pdata->scenario); if (ret) { err("scenario read is fail(%d)", ret); goto p_err; } ret = of_property_read_u32(dnode, "mclk_ch", &pdata->mclk_ch); if (ret) { err("mclk_ch read is fail(%d)", ret); goto p_err; } ret = of_property_read_u32(dnode, "csi_ch", &pdata->csi_ch); if (ret) { err("csi_ch read is fail(%d)", ret); goto p_err; } ret = of_property_read_u32(dnode, "flite_ch", &pdata->flite_ch); if (ret) { err("flite_ch read is fail(%d)", ret); goto p_err; } ret = of_property_read_u32(dnode, "i2c_ch", &pdata->i2c_ch); if (ret) { err("i2c_ch read is fail(%d)", ret); goto p_err; } ret = of_property_read_u32(dnode, "i2c_addr", &pdata->i2c_addr); if (ret) { err("i2c_addr read is fail(%d)", ret); goto p_err; } ret = of_property_read_u32(dnode, "is_bns", &pdata->is_bns); if (ret) { err("is_bns read is fail(%d)", ret); goto p_err; } ret = of_property_read_u32(dnode, "id", &id); if (ret) { err("id read is fail(%d)", ret); goto p_err; } pdata->id = id; DT_READ_U32(dnode, "flash_first_gpio", pdata->flash_first_gpio ); DT_READ_U32(dnode, "flash_second_gpio", pdata->flash_second_gpio); #ifdef CONFIG_USE_VENDER_FEATURE ret = of_property_read_string(dnode, "sensor_name", &name); if (ret) { err("sensor_name read is fail(%d)", ret); goto p_err; } strcpy(pdata->sensor_name, name); ret = of_property_read_u32(dnode, "sensor_id", &pdata->sensor_id); if (ret) { err("sensor_id read is fail(%d)", ret); goto p_err; } #endif gpio_reset = of_get_named_gpio(dnode, "gpio_reset", 0); if (!gpio_is_valid(gpio_reset)) { dev_err(dev, "failed to get PIN_RESET\n"); ret = -EINVAL; goto p_err; } else { gpio_request_one(gpio_reset, GPIOF_OUT_INIT_LOW, "CAM_GPIO_OUTPUT_LOW"); gpio_free(gpio_reset); } #ifdef CONFIG_SOC_EXYNOS5422 gpios_cam_en = of_get_named_gpio(dnode, "gpios_cam_en", 0); if (!gpio_is_valid(gpios_cam_en)) { dev_err(dev, "failed to get main/front cam en gpio\n"); } else { gpio_request_one(gpios_cam_en, GPIOF_OUT_INIT_LOW, "CAM_GPIO_OUTPUT_LOW"); gpio_free(gpios_cam_en); } #endif #if !defined(CONFIG_USE_VENDER_FEATURE) /* LSI Patch */ /* Optional Feature */ gpio_comp_en = of_get_named_gpio(dnode, "gpios_comp_en", 0); if (!gpio_is_valid(gpio_comp_en)) dev_err(dev, "failed to get main comp en gpio\n"); gpio_comp_rst = of_get_named_gpio(dnode, "gpios_comp_reset", 0); if (!gpio_is_valid(gpio_comp_rst)) dev_err(dev, "failed to get main comp reset gpio\n"); gpio_standby = of_get_named_gpio(dnode, "gpio_standby", 0); if (!gpio_is_valid(gpio_standby)) dev_err(dev, "failed to get gpio_standby\n"); gpio_cam_en = of_get_named_gpio(dnode, "gpios_cam_en", 0); if (!gpio_is_valid(gpio_cam_en)) dev_err(dev, "failed to get gpio_cam_en\n"); SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_ON, 0, gpio_cam_en, 0, NULL, PIN_OUTPUT_HIGH); SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_ON, 1, gpio_reset, 0, NULL, PIN_RESET); SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_ON, 2, gpio_none, 0, "ch", PIN_FUNCTION); SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_ON, 3, gpio_comp_en, 0, NULL, PIN_OUTPUT_HIGH); SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_ON, 4, gpio_comp_rst, 0, NULL, PIN_RESET); if (id == SENSOR_POSITION_REAR) { SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_ON, 5, gpio_none, 0, "af", PIN_FUNCTION); } SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_ON, 6, gpio_none, 0, NULL, PIN_END); SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_OFF, 0, gpio_reset, 0, NULL, PIN_RESET); SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_OFF, 1, gpio_reset, 0, NULL, PIN_INPUT); SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_OFF, 2, gpio_comp_rst, 0, NULL, PIN_RESET); SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_OFF, 3, gpio_comp_rst, 0, NULL, PIN_INPUT); SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_OFF, 4, gpio_comp_en, 0, NULL, PIN_INPUT); SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_OFF, 5, gpio_cam_en, 0, NULL, PIN_OUTPUT_LOW); SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_OFF, 6, gpio_none, 0, NULL, PIN_END); SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_ON, 0, gpio_cam_en, 0, NULL, PIN_OUTPUT_HIGH); SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_ON, 1, gpio_reset, 0, NULL, PIN_OUTPUT_LOW); SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_ON, 2, gpio_standby, 0, NULL, PIN_OUTPUT_HIGH); SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_ON, 3, gpio_none, 0, NULL, PIN_END); SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_OFF, 0, gpio_reset, 0, NULL, PIN_RESET); SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_OFF, 1, gpio_reset, 0, NULL, PIN_INPUT); SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_OFF, 2, gpio_standby, 0, NULL, PIN_OUTPUT_LOW); SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_OFF, 4, gpio_cam_en, 0, NULL, PIN_OUTPUT_LOW); SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_OFF, 3, gpio_none, 0, NULL, PIN_END); #else /* TN CODE */ if (id == SENSOR_POSITION_FRONT) { gpio_standby = of_get_named_gpio(dnode, "gpio_standby", 0); if (!gpio_is_valid(gpio_standby)) { dev_err(dev, "failed to get gpio_standby\n"); } else { gpio_request_one(gpio_standby, GPIOF_OUT_INIT_LOW, "CAM_GPIO_OUTPUT_LOW"); gpio_free(gpio_standby); } #ifdef CONFIG_SOC_EXYNOS5433 /* initial - i2c off */ pinctrl_ch = devm_pinctrl_get_select(&pdev->dev, "off1"); if (IS_ERR_OR_NULL(pinctrl_ch)) { pr_err("%s: cam %s pins are not configured\n", __func__, "off1"); } else { devm_pinctrl_put(pinctrl_ch); } #endif } #ifdef CONFIG_SOC_EXYNOS5422 if (id == SENSOR_POSITION_REAR) { /* BACK CAMERA - POWER ON */ SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_ON, 0, gpio_none, 0, NULL, 0, PIN_END); /* BACK CAMERA - POWER OFF */ SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_OFF, 0, gpio_none, 0, NULL, 0, PIN_END); } else { /* FRONT CAMERA - POWER ON */ SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_ON, 0, gpio_standby, 0, NULL, 0, PIN_OUTPUT_LOW); SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_ON, 1, gpio_none, 0, "VT_CAM_1.8V", 0, PIN_REGULATOR_ON); SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_ON, 2, gpio_none, 0, "VT_CAM_2.8V", 0, PIN_REGULATOR_ON); SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_ON, 3, gpios_cam_en, 0, NULL, 1000, PIN_OUTPUT_HIGH); SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_ON, 4, gpio_reset, 0, NULL, 0, PIN_OUTPUT_HIGH); SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_ON, 5, gpio_none, 0, "ch", 0, PIN_FUNCTION); SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_ON, 6, gpio_none, 0, NULL, 0, PIN_END); /* FRONT CAMERA - POWER OFF */ SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_OFF, 0, gpio_standby, 0, NULL, 0, PIN_OUTPUT_LOW); SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_OFF, 1, gpio_none, 0, "off", 0, PIN_FUNCTION); SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_OFF, 2, gpio_reset, 0, NULL, 0, PIN_OUTPUT_LOW); SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_OFF, 3, gpios_cam_en, 0, NULL, 0, PIN_OUTPUT_LOW); SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_OFF, 4, gpio_none, 0, "VT_CAM_2.8V", 0, PIN_REGULATOR_OFF); SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_OFF, 5, gpio_none, 0, "VT_CAM_1.8V", 0, PIN_REGULATOR_OFF); SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_OFF, 6, gpio_none, 0, NULL, 0, PIN_END); /* VISION CAMERA - POWER ON */ SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_ON, 0, gpio_reset, 0, NULL, 0, PIN_OUTPUT_LOW); SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_ON, 1, gpio_none, 0, "VT_CAM_1.8V", 0, PIN_REGULATOR_ON); SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_ON, 2, gpio_none, 0, "VT_CAM_2.8V", 0, PIN_REGULATOR_ON); SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_ON, 3, gpios_cam_en, 0, NULL, 1000, PIN_OUTPUT_HIGH); SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_ON, 4, gpio_standby, 0, NULL, 0, PIN_OUTPUT_HIGH); SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_ON, 5, gpio_none, 0, "ch", 0, PIN_FUNCTION); SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_ON, 6, gpio_none, 0, NULL, 0, PIN_END); /* VISION CAMERA - POWER OFF */ SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_OFF, 0, gpio_reset, 0, NULL, 0, PIN_OUTPUT_LOW); SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_OFF, 1, gpio_none, 0, "off", 0, PIN_FUNCTION); SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_OFF, 2, gpio_standby, 0, NULL, 0, PIN_OUTPUT_LOW); SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_OFF, 3, gpios_cam_en, 0, NULL, 0, PIN_OUTPUT_LOW); SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_OFF, 4, gpio_none, 0, "VT_CAM_2.8V", 0, PIN_REGULATOR_OFF); SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_OFF, 5, gpio_none, 0, "VT_CAM_1.8V", 0, PIN_REGULATOR_OFF); SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_OFF, 6, gpio_none, 0, NULL, 0, PIN_END); } #else /*CONFIG_SOC_EXYNOS5430*/ if (id == SENSOR_POSITION_REAR) { /* BACK CAMERA - POWER ON */ SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_ON, 0, gpio_none, 0, NULL, 0, PIN_END); /* BACK CAMERA - POWER OFF */ SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_OFF, 0, gpio_none, 0, NULL, 0, PIN_END); } else { /* FRONT CAMERA - POWER ON */ SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_ON, 0, gpio_standby, 0, NULL, 0, PIN_OUTPUT_LOW); SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_ON, 1, gpio_none, 0, "VT_CAM_1.8V", 0, PIN_REGULATOR_ON); SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_ON, 2, gpio_none, 0, "VT_CAM_2.8V", 0, PIN_REGULATOR_ON); SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_ON, 3, gpio_none, 0, "VT_CAM_1.2V", 1000, PIN_REGULATOR_ON); SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_ON, 4, gpio_reset, 0, NULL, 0, PIN_OUTPUT_HIGH); SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_ON, 5, gpio_none, 0, "ch", 0, PIN_FUNCTION); SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_ON, 6, gpio_none, 0, NULL, 0, PIN_END); /* FRONT CAMERA - POWER OFF */ SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_OFF, 0, gpio_standby, 0, NULL, 0, PIN_OUTPUT_LOW); SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_OFF, 1, gpio_none, 0, "off", 0, PIN_FUNCTION); SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_OFF, 2, gpio_reset, 0, NULL, 0, PIN_OUTPUT_LOW); SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_OFF, 3, gpio_none, 0, "VT_CAM_1.2V", 0, PIN_REGULATOR_OFF); SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_OFF, 4, gpio_none, 0, "VT_CAM_2.8V", 0, PIN_REGULATOR_OFF); SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_OFF, 5, gpio_none, 0, "VT_CAM_1.8V", 0, PIN_REGULATOR_OFF); SET_PIN(pdata, SENSOR_SCENARIO_NORMAL, GPIO_SCENARIO_OFF, 6, gpio_none, 0, NULL, 0, PIN_END); /* VISION CAMERA - POWER ON */ SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_ON, 0, gpio_reset, 0, NULL, 0, PIN_OUTPUT_LOW); SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_ON, 1, gpio_none, 0, "VT_CAM_1.8V", 0, PIN_REGULATOR_ON); SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_ON, 2, gpio_none, 0, "VT_CAM_2.8V", 0, PIN_REGULATOR_ON); SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_ON, 3, gpio_none, 0, "VT_CAM_1.2V", 1000, PIN_REGULATOR_ON); SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_ON, 4, gpio_standby, 0, NULL, 0, PIN_OUTPUT_HIGH); SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_ON, 5, gpio_none, 0, "ch", 0, PIN_FUNCTION); SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_ON, 6, gpio_none, 0, NULL, 0, PIN_END); /* VISION CAMERA - POWER OFF */ SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_OFF, 0, gpio_reset, 0, NULL, 0, PIN_OUTPUT_LOW); SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_OFF, 1, gpio_none, 0, "off", 0, PIN_FUNCTION); SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_OFF, 2, gpio_standby, 0, NULL, 0, PIN_OUTPUT_LOW); SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_OFF, 3, gpio_none, 0, "VT_CAM_1.2V", 0, PIN_REGULATOR_OFF); SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_OFF, 4, gpio_none, 0, "VT_CAM_2.8V", 0, PIN_REGULATOR_OFF); SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_OFF, 5, gpio_none, 0, "VT_CAM_1.8V", 0, PIN_REGULATOR_OFF); SET_PIN(pdata, SENSOR_SCENARIO_VISION, GPIO_SCENARIO_OFF, 6, gpio_none, 0, NULL, 0, PIN_END); } #endif #endif pdev->id = id; dev->platform_data = pdata; pdata->pinctrl = devm_pinctrl_get(dev); if (IS_ERR(pdata->pinctrl)) { err("devm_pinctrl_get is fail"); goto p_err; } else { ret = get_pin_lookup_state(dev, pdata); if (ret < 0) { err("fimc_is_get_pin_lookup_state is fail"); goto p_err; } } return ret; p_err: kfree(pdata); return ret; }
static int parse_fb_variant(struct device_node *np) { u32 temp; char *pprop; DT_READ_U32(np, "nr_windows", g_fb_drvdata.variant.nr_windows); DT_READ_U32(np, "vidcon1", g_fb_drvdata.variant.vidcon1); DT_READ_U32(np, "vidtcon", g_fb_drvdata.variant.vidtcon); DT_READ_U32(np, "wincon", g_fb_drvdata.variant.wincon); DT_READ_U32(np, "winmap", g_fb_drvdata.variant.winmap); DT_READ_U32(np, "keycon", g_fb_drvdata.variant.keycon); DT_READ_U32(np, "osd", g_fb_drvdata.variant.osd); DT_READ_U32(np, "osd_stride", g_fb_drvdata.variant.osd_stride); DT_READ_U32(np, "buf_start", g_fb_drvdata.variant.buf_start); DT_READ_U32(np, "buf_size", g_fb_drvdata.variant.buf_size); DT_READ_U32(np, "buf_end", g_fb_drvdata.variant.buf_end); DT_READ_U32(np, "palette_0", g_fb_drvdata.variant.palette[0]); DT_READ_U32(np, "palette_1", g_fb_drvdata.variant.palette[1]); DT_READ_U32(np, "palette_2", g_fb_drvdata.variant.palette[2]); DT_READ_U32(np, "palette_3", g_fb_drvdata.variant.palette[3]); DT_READ_U32(np, "palette_4", g_fb_drvdata.variant.palette[4]); DT_READ_U32(np, "has_shadowcon", g_fb_drvdata.variant.has_shadowcon); DT_READ_U32(np, "has_blendcon", g_fb_drvdata.variant.has_blendcon); DT_READ_U32(np, "has_alphacon", g_fb_drvdata.variant.has_alphacon); DT_READ_U32(np, "has_fixvclk", g_fb_drvdata.variant.has_fixvclk); return 0; exception: pr_err("%s: no property in the node, fb_variant.\n", pprop); return -EINVAL; }
static int parse_fimd_platdata(struct device_node *np) { u32 temp; char *pprop; /* parse for fimd controller */ DT_READ_U32(np, "samsung,vidcon0", g_fimd_platdata.vidcon0); DT_READ_U32(np, "samsung,vidcon1", g_fimd_platdata.vidcon1); DT_READ_U32(np, "samsung,default_win", g_fimd_platdata.default_win); #ifndef DT_LCD_CONF_IGNORE DT_READ_U32(np, "samsung,left_margin", g_fb_win0.win_mode.left_margin); DT_READ_U32(np, "samsung,right_margin", g_fb_win0.win_mode.right_margin); DT_READ_U32(np, "samsung,upper_margin", g_fb_win0.win_mode.upper_margin); DT_READ_U32(np, "samsung,lower_margin", g_fb_win0.win_mode.lower_margin); DT_READ_U32(np, "samsung,hsync_len", g_fb_win0.win_mode.hsync_len); DT_READ_U32(np, "samsung,vsync_len", g_fb_win0.win_mode.vsync_len); DT_READ_U32(np, "samsung,xres", g_fb_win0.win_mode.xres); DT_READ_U32(np, "samsung,yres", g_fb_win0.win_mode.yres); DT_READ_U32(np, "samsung,virtual_x", g_fb_win0.virtual_x); DT_READ_U32(np, "samsung,virtual_y", g_fb_win0.virtual_y); DT_READ_U32(np, "samsung,width", g_fb_win0.width); DT_READ_U32(np, "samsung,height", g_fb_win0.height); #endif DT_READ_U32(np, "samsung,max_bpp", g_fb_win0.max_bpp); DT_READ_U32(np, "samsung,default_bpp", g_fb_win0.default_bpp); g_fimd_platdata.win[0] = &g_fb_win0; g_fimd_platdata.win[1] = &g_fb_win0; g_fimd_platdata.win[2] = &g_fb_win0; g_fimd_platdata.win[3] = &g_fb_win0; g_fimd_platdata.win[4] = &g_fb_win0; #ifndef DT_LCD_CONF_IGNORE /* parse for mipi-dsi driver */ g_lcd_config.rgb_timing.left_margin = g_fb_win0.win_mode.left_margin; g_lcd_config.rgb_timing.right_margin = g_fb_win0.win_mode.right_margin; g_lcd_config.rgb_timing.upper_margin = g_fb_win0.win_mode.upper_margin; g_lcd_config.rgb_timing.lower_margin = g_fb_win0.win_mode.lower_margin; g_lcd_config.rgb_timing.hsync_len = g_fb_win0.win_mode.hsync_len; g_lcd_config.rgb_timing.vsync_len = g_fb_win0.win_mode.vsync_len; g_lcd_config.lcd_size.width = g_fb_win0.win_mode.xres; g_lcd_config.lcd_size.height = g_fb_win0.win_mode.yres; #endif return 0; exception: pr_err("%s: no property in the node, fb_variant.\n", pprop); return -EINVAL; }