From patchwork Mon May 27 13:47:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jyri Sarha X-Patchwork-Id: 165212 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp7193027ili; Mon, 27 May 2019 06:48:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqxgMRhWj9ibNGlRm/0M1aLMiXRdgZkKatbm6NgE/OJMqTTOU0i6+kFNrR8wtfc6YdxfE3qt X-Received: by 2002:a63:2b92:: with SMTP id r140mr39131632pgr.363.1558964897798; Mon, 27 May 2019 06:48:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558964897; cv=none; d=google.com; s=arc-20160816; b=u+3YsZ2pBV0NvgkjKtAcDeLdtopMK3d/qp2i4M5vcdmd7CRDg6Y2IaRbcxLazuFv7g t9yQSdOsvOEbWBsUEGotCBmg7+GLFpmNUlR+7xe2bWGN4/Ix6zo6YvIo1yWzghc4vFD7 IILFR1Dj1juobe60Q1eOwWvdPeO98rw2aq1/DRtOyIVs0I/IM27mr8YE2AEFSCpKZqHA mv1jdlBuFN4tl9xFnoiR8gE3hZ1h7/6cf0qotobaUwMYDaiT+9CpUmCdbcO4yggwcCx1 2f9tO08LvMhq2OfNyYvj1KxIrTMyzcH9Fp6qngnaJ/O0LusgWr8683URrLmje4jmxlVD cgXg== 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=otZ7oBFrIjG97sOAgdwFWtusb724sl5J2CgZC04aFMs=; b=WlETnNMiMIPSwVP7ZIuOGyZWD2ZwNo1pk/IgxFxVKK9kPQXsM9gawLWalAn6apk/8M q/3IIBM0Q+VTYao8anuJABDlFEONX2fMDEPZ7l90aDI3Ym9g5mMd8bxOqAszMf9ea3Qx zWFhVggvQigSSVWJzKALaKf+Olz0V2VNPSLqKum7nu6HuP+52cT2i3uzjS5sj4A0kBMO v3PPUsdiBbfu7KtpVRwUBXcc0RiyHsnXQSh4ndQ72Wh32Jj2yJJ5KIILY5kHAUWkGSUt 7YTRRoVjOckeePlVDKALDQCB2pITIt1oeR0jXLxrxvcGZdYsVNji/cBTOChF23m1RZ7z jtTg== 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 b4si17955238pgb.31.2019.05.27.06.48.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 May 2019 06:48:17 -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 049516E218; Mon, 27 May 2019 13:48:14 +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 7C1996E216 for ; Mon, 27 May 2019 13:48:13 +0000 (UTC) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x4RDm68Y073368; Mon, 27 May 2019 08:48:06 -0500 Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x4RDm6xC054858 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 27 May 2019 08:48:06 -0500 Received: from DFLE112.ent.ti.com (10.64.6.33) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Mon, 27 May 2019 08:48:04 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Mon, 27 May 2019 08:48:04 -0500 Received: from jadmar.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id x4RDlviF065947; Mon, 27 May 2019 08:48:02 -0500 From: Jyri Sarha To: , , Subject: [PATCH v8 2/6] drm/bridge: sii902x: Set output mode to HDMI or DVI according to EDID Date: Mon, 27 May 2019 16:47:53 +0300 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=1558964886; bh=Hf8IFHndzk4D6oqYha5f5/8yYRj5fgQTA/zOXHmnD2s=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=GyzUuE8DUCwo1pogTWF8uek1L63iZTVcZKPiu1iQUQ1fWkBeLSW/4r3PW1kL6+Lax iK5y31Ik6dhiV0RVKFqGuiu4NzHynba9GoPc1LiuwzXjR1Ot47ftL4oseyxAAXU8tR WKEE0uAtZp/DYr1soZyH+KIvgAJJ+ZswVP6y9ywA= 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: peter.ujfalusi@ti.com, tomi.valkeinen@ti.com, laurent.pinchart@ideasonboard.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 0d3d730b97ff..128d8fdb4ba6 100644 --- a/drivers/gpu/drm/bridge/sii902x.c +++ b/drivers/gpu/drm/bridge/sii902x.c @@ -181,12 +181,16 @@ static int sii902x_get_modes(struct drm_connector *connector) { struct sii902x *sii902x = connector_to_sii902x(connector); u32 bus_format = MEDIA_BUS_FMT_RGB888_1X24; + u8 output_mode = SII902X_SYS_CTRL_OUTPUT_DVI; struct edid *edid; 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); } @@ -196,6 +200,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; }