DUMP_REG(NV_SOR_DP_SPARE(1));
DUMP_REG(NV_SOR_DP_TPG);
DUMP_REG(NV_SOR_HDMI2_CTRL);
- if (sor->instance) { /* sor1 */
+ if (sor->dc->ndev->id == 1) { /* sor1 */
DUMP_REG(NV_SOR_DP_AUDIO_CTRL);
DUMP_REG(NV_SOR_DP_GENERIC_INFOFRAME_HEADER);
struct clk *brick_clk = NULL;
struct clk *src_clk = NULL;
struct device_node *np = dc->ndev->dev.of_node;
- int sor_num = tegra_dc_which_sor(dc);
struct device_node *np_sor =
- sor_num ? of_find_node_by_path(SOR1_NODE) :
+ dc->ndev->id ? of_find_node_by_path(SOR1_NODE) :
of_find_node_by_path(SOR_NODE);
- const char *res_name = sor_num ? "sor1" : "sor0";
+ const char *res_name = dc->ndev->id ? "sor1" : "sor0";
+
+ if (dc->out->type == TEGRA_DC_OUT_HDMI) {
+ of_node_put(np_sor);
+ np_sor = of_find_node_by_path(SOR1_NODE);
+ res_name = "sor1";
+ }
sor = devm_kzalloc(&dc->ndev->dev, sizeof(*sor), GFP_KERNEL);
if (!sor) {
err = -ENOMEM;
goto err_allocate;
}
- sor->instance = sor_num;
if (np) {
if (np_sor && (of_device_is_available(np_sor) ||
void tegra_dc_sor_destroy(struct tegra_dc_sor_data *sor)
{
- struct device_node *np_sor = sor->instance ?
+ struct device_node *np_sor = (sor->dc->ndev->id) ?
of_find_node_by_path(SOR1_NODE) :
of_find_node_by_path(SOR_NODE);
+ if (sor->dc->out->type == TEGRA_DC_OUT_HDMI) {
+ of_node_put(np_sor);
+ np_sor = of_find_node_by_path(SOR1_NODE);
+ }
+
clk_put(sor->sor_clk);
if (sor->safe_clk)
clk_put(sor->safe_clk);
static void tegra_dc_sor_enable_sor(struct tegra_dc_sor_data *sor, bool enable)
{
struct tegra_dc *dc = sor->dc;
- int sor_num = sor->instance;
u32 reg_val = tegra_dc_readl(sor->dc, DC_DISP_DISP_WIN_OPTIONS);
- u32 enb = sor_num ? SOR1_ENABLE : SOR_ENABLE;
+ u32 enb = dc->ndev->id ? SOR1_ENABLE : SOR_ENABLE;
/* Do not disable SOR during seamless boot */
if (sor->dc->initialized && !enable)
return;
if (sor->dc->out->type == TEGRA_DC_OUT_HDMI)
- enb = sor_num ? SOR1_ENABLE : SOR_ENABLE;
+ enb = SOR1_ENABLE;
if (dc->out->type == TEGRA_DC_OUT_HDMI)
enb |= SOR1_TIMING_CYA;