static struct regulator *of_dp_pad;
static struct regulator *of_dp_hdmi_5v0;
-char dc_or_node_names[TEGRA_MAX_DC][13];
-
#ifdef CONFIG_TEGRA_DC_CMU
static struct tegra_dc_cmu default_cmu = {
/* lut1 maps sRGB to linear space. */
return false;
}
-static struct device_node *dc_get_or_node(struct device *dev)
-{
- struct device_node *np = NULL;
- const struct platform_device *pdev;
- struct tegra_dc *dc;
-
- pdev = container_of(dev, struct platform_device, dev);
- BUG_ON(!pdev);
- dc = platform_get_drvdata(pdev);
- BUG_ON(!dc);
-
- np = of_find_node_by_path(dc_or_node_names[dc->ndev->id]);
- return np;
-}
-
-struct device_node *tegra_dc_get_hdmi_node(int id)
-{
-#ifdef CONFIG_ARCH_TEGRA_21x_SOC
- return of_find_node_by_path(dc_or_node_names[id]);
-#else
- return of_find_node_by_path(HDMI_NODE);
-#endif
-}
-
static int parse_disp_default_out(struct platform_device *ndev,
struct device_node *np,
struct tegra_dc_out *default_out,
int hotplug_gpio = 0;
enum of_gpio_flags flags;
struct device_node *ddc;
- struct device_node *np_hdmi = tegra_dc_get_hdmi_node(ndev->id);
+ struct device_node *np_hdmi =
+ of_find_node_by_path(HDMI_NODE);
struct device_node *np_sor =
- of_find_node_by_path(dc_or_node_names[ndev->id]);
+ (ndev->id) ? of_find_node_by_path(SOR1_NODE) :
+ of_find_node_by_path(SOR_NODE);
struct property *prop;
const __be32 *p;
u32 u;
const struct platform_device *pdev;
struct tegra_dc *dc;
int gpio;
- struct device_node *np_dp = dc_get_or_node(dev);
+ struct device_node *np_dp =
+ of_find_node_by_path(SOR1_NODE);
pdev = container_of(dev, struct platform_device, dev);
BUG_ON(!pdev);
static int dc_hdmi_out_enable(struct device *dev)
{
int err = 0;
+
struct device_node *np_hdmi =
- tegra_dc_get_hdmi_node(to_platform_device(dev)->id);
+ of_find_node_by_path(HDMI_NODE);
if (!np_hdmi || !of_device_is_available(np_hdmi)) {
pr_info("%s: no valid hdmi node\n", __func__);
int err = 0;
struct device_node *np_hdmi =
- tegra_dc_get_hdmi_node(to_platform_device(dev)->id);
+ of_find_node_by_path(HDMI_NODE);
if (!np_hdmi || !of_device_is_available(np_hdmi)) {
pr_info("%s: no valid hdmi node\n", __func__);
const __be32 *p;
int err;
u32 temp;
- const char *dc_or_node;
/*
* Memory for pdata, pdata->default_out, pdata->fb
goto fail_parse;
}
- err = of_property_read_string(np, "nvidia,dc-or-node", &dc_or_node);
- if (err)
- pr_info("%s: No dc-or-node is defined in DT\n", __func__);
- else
- pr_info("%s: DC OR node is connected to %s\n", __func__,
- dc_or_node);
-
- if (!err && (!strcmp(dc_or_node, "/host1x/sor") ||
- !strcmp(dc_or_node, "/host1x/sor1")))
- strncpy(dc_or_node_names[ndev->id], dc_or_node, 13);
- else
- strncpy(dc_or_node_names[ndev->id],
- ndev->id ? "/host1x/sor1" : "/host1x/sor", 13);
-
/*
* determine dc out type,
* dc node defines nvidia,out-type to indicate
} else if (pdata->default_out->type == TEGRA_DC_OUT_DP ||
pdata->default_out->type == TEGRA_DC_OUT_NVSR_DP ||
pdata->default_out->type == TEGRA_DC_OUT_FAKE_DP) {
- np_sor = of_find_node_by_path(dc_or_node_names[ndev->id]);
+ np_sor = (ndev->id) ? of_find_node_by_path(SOR1_NODE) :
+ of_find_node_by_path(SOR_NODE);
if (!np_sor) {
pr_err("%s: could not find sor node\n", __func__);
}
} else if (pdata->default_out->type == TEGRA_DC_OUT_HDMI) {
bool hotplug_report = false;
- np_hdmi = tegra_dc_get_hdmi_node(ndev->id);
+ np_hdmi = of_find_node_by_path(HDMI_NODE);
if (ndev->id == 0)
np_target_disp
dc_hdmi_hotplug_report;
}
} else if (pdata->default_out->type == TEGRA_DC_OUT_LVDS) {
- np_sor = of_find_node_by_path(dc_or_node_names[ndev->id]);
+ np_sor = of_find_node_by_path(SOR_NODE);
if (!np_sor) {
pr_err("%s: could not find sor node\n", __func__);