From patchwork Thu Mar 14 11:27:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jyri Sarha X-Patchwork-Id: 160322 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp15385065jad; Thu, 14 Mar 2019 04:28:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqy3p28T2ZXkZ3x7XQBGV0AW5nnLktUs1waXWJ25+Xu6H2ISujk03BFwbhBZ1VkLil5VPc1N X-Received: by 2002:a17:902:22f:: with SMTP id 44mr44757235plc.138.1552562895349; Thu, 14 Mar 2019 04:28:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552562895; cv=none; d=google.com; s=arc-20160816; b=FhB2fH6EZPej3yJC4lJ98d322Vi2alsHlFi5G5wYrYYpfcNSk49mr1IzANoL5ZNtEd Zia+TfEyf4G1QvZSTWv+vvXolnNSvbTJ1i2Tw6bNQ+rdOfwiYSb/St8tw2vGWYli/3EU 6XC30ky8ALCoX7A79oeFO0zvDRRkWBEoOB6VCVUxfmP22/fX7it6JKegnsDj0bYYzqNL RmTIIPhCFyKwsfETvJDp60XyJJ74COBGWmQY6AJ/Uu6rKv1wSbwgRXxojjNeFON6mus7 nFjKxnVUg3OjNjatjW2uiC24t6tBXwC7sc6o7x21QNsCBGaWOqUBDJ9Y8Umcad0U3yRG 4Zew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to; bh=aazlihE8KwWDzKlZcxHdmMTgQ1c/qFajSk8q1CFUgJ0=; b=hFgQMXeSxZZ77y+HiXHZE7OVob8abgIV/j1falKqKgW2eRvVwc1gJJIwhD6n7Qv/5A g6eGYZkr7Phj5bT7/eQ8wI92I+IQX89TwRJ7yvexT/iwXDYopfO4tPrfe6pRxbuyyjIS rP1uUqMUvhumAlmUo0nnogAUNAjqpzh5XXi9+njKEr5q4rROu8Qiu1tEwY6U8/FOoLIi BvrB5TWoijnJM+TF1833FlcxZNBUC5u1B9vSl+BvzXtCxzgN8AYn8xQtTBMiwKan/MSU 1I/x2Sgayo2GLKxmeYNEiZHWhcvnZarzj9D9fdLMABVuXOByZenqbIGze+qnRbZpfLO7 9h+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id x1si13061634plo.58.2019.03.14.04.28.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 Mar 2019 04:28:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B06426E1B3; Thu, 14 Mar 2019 11:28:13 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by gabe.freedesktop.org (Postfix) with ESMTPS id B8B866E1B3 for ; Thu, 14 Mar 2019 11:28:11 +0000 (UTC) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x2EBS1pe019610; Thu, 14 Mar 2019 06:28:01 -0500 Received: from DFLE106.ent.ti.com (dfle106.ent.ti.com [10.64.6.27]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x2EBS1ro096049 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 14 Mar 2019 06:28:01 -0500 Received: from DFLE104.ent.ti.com (10.64.6.25) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Thu, 14 Mar 2019 06:28:01 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Thu, 14 Mar 2019 06:28:01 -0500 Received: from jadmar.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id x2EBRrtv010136; Thu, 14 Mar 2019 06:27:58 -0500 From: Jyri Sarha To: , Subject: [PATCH v4 2/6] drm/bridge: sii902x: Set output mode to HDMI or DVI according to EDID Date: Thu, 14 Mar 2019 13:27:48 +0200 Message-ID: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1552562881; bh=uB260r+P4IXU1sWBt8lBYkDM+AGM+YpeJ3xtx99ykXE=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=S5P59xUb+VbNjIVUBtBszD0KFVKS7CmkrBHKJ0PqovQdONAYQ1G4URdFoVaEJTnqi NHGHDO3GUtj99opVMlIza0Abd61/TkFfmKk7h3nQFfgMEH59e1aywKOR7LYWEebAj6 pn+dUypkrgPOZaA6uzMaqCsQrnU0BCQiqo1G7BhE= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fabrizio.castro@bp.renesas.com, Songjun.Wu@atmel.com, peter.ujfalusi@ti.com, tomi.valkeinen@ti.com, laurent.pinchart@ideasonboard.com, voice.shen@atmel.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Set output mode to HDMI or DVI according to EDID HDMI signature. Signed-off-by: Jyri Sarha Reviewed-by: Andrzej Hajda Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/bridge/sii902x.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c index 1afa000141d5..0e21fa419d27 100644 --- a/drivers/gpu/drm/bridge/sii902x.c +++ b/drivers/gpu/drm/bridge/sii902x.c @@ -181,11 +181,15 @@ static int sii902x_get_modes(struct drm_connector *connector) struct sii902x *sii902x = connector_to_sii902x(connector); u32 bus_format = MEDIA_BUS_FMT_RGB888_1X24; struct edid *edid; + u8 output_mode = SII902X_SYS_CTRL_OUTPUT_DVI; int num = 0, ret; edid = drm_get_edid(connector, sii902x->i2cmux->adapter[0]); drm_connector_update_edid_property(connector, edid); if (edid) { + if (drm_detect_hdmi_monitor(edid)) + output_mode = SII902X_SYS_CTRL_OUTPUT_HDMI; + num = drm_add_edid_modes(connector, edid); kfree(edid); } @@ -195,6 +199,11 @@ static int sii902x_get_modes(struct drm_connector *connector) if (ret) return ret; + ret = regmap_update_bits(sii902x->regmap, SII902X_SYS_CTRL_DATA, + SII902X_SYS_CTRL_OUTPUT_MODE, output_mode); + if (ret) + return ret; + return num; }