From patchwork Fri Mar 22 08:06:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jyri Sarha X-Patchwork-Id: 160872 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp519195jan; Fri, 22 Mar 2019 01:06:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqxsN2XbA81A9BXPA8DiZYkJafhJBgVh0Gim4Tsat7dSTM01dAHSJZT2hmpcHlccr6CTmeTB X-Received: by 2002:a62:54c5:: with SMTP id i188mr7696788pfb.188.1553242006568; Fri, 22 Mar 2019 01:06:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553242006; cv=none; d=google.com; s=arc-20160816; b=wa1XX9dQVNHgNp2+1718pan+cJjP7cGiw50SrC7+5IKu+xPQFhF3R8tfFm+YZVZlqe vG+IGQiUCcK+igZ9+cSuH92wqo1/0bHQ19jrdv6Ux32UZ+udz4HojzabZUPub9PvEE51 zp4irJeimOiSmLqtnf511tR8uCe3CTSnvQkKxD8TRTdXheZpdQXi677eWm+Vcxi9VLl1 KqpX00UYUph8HareYDI27cqB1O1Ln324KWcpjZM12r7hephuK+nDulE8YZbNkPKe3HwE nv9C5lnKhrphxVQ7favnyKFS7FARbjjEq0wwI4KHJV+AxfBY6MuJDKgdB5hDtVBqoUTJ 0VRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=AQtv1bgNGRZbjvL9U7uoKaFfljaJ55FuLTfopsRT5U0=; b=w1kb81YmFGCetNURi90C6SHFwLmvyfxxMAZRSZBS1CCi1oVd9CmbaZ9w4G1WVilIv7 2zrJS5Tp7pevkLCDFXDe2jS+fK04aOkb+ehoNPGgE3RX/0TmFXF4IEZkbjgz8mElfwVV LF9ij0qFPwU/9LxQAgr1DmZaYVgjgA5Zog0I1QTARzFDCo76caoQ5jgAtZYg7ZX2ngn0 MVcIat9b3tAGR8lp6m0KccbhYvs1PuBsEfNS7cx1PFUDViS+AcQXCdDV8jqxs7bGpLZ1 +WAsRv0pnEJKEzXGARQH8mN0u0GmEdKdK/IJRhXI8bnNwJJx066dUgjxkFk/tso74tVQ G6Ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=ZkHFNz8l; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i7si6805977plb.410.2019.03.22.01.06.46; Fri, 22 Mar 2019 01:06:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=ZkHFNz8l; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727461AbfCVIGq (ORCPT + 7 others); Fri, 22 Mar 2019 04:06:46 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:57830 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726055AbfCVIGp (ORCPT ); Fri, 22 Mar 2019 04:06:45 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x2M86OIV018665; Fri, 22 Mar 2019 03:06:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1553241984; bh=AQtv1bgNGRZbjvL9U7uoKaFfljaJ55FuLTfopsRT5U0=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=ZkHFNz8lSyAsGzmu6iLNQ3WYeQGPZISAHJJ3G3GzH0ZsBTa08SV9x0mBDgteuJvr8 u5wvlB1QInmKAse5Do6NOECPwBGM+tty4xcvRzuZ/MmwXTb1LqMgsGkVoSFOiUpNe4 hFq/wbdMb4U6bq58ntowtXMsNQ94QSjfWRCqA2TU= Received: from DFLE105.ent.ti.com (dfle105.ent.ti.com [10.64.6.26]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x2M86OUG125772 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 22 Mar 2019 03:06:24 -0500 Received: from DFLE114.ent.ti.com (10.64.6.35) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 22 Mar 2019 03:06:24 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1713.5 via Frontend Transport; Fri, 22 Mar 2019 03:06:24 -0500 Received: from jadmar.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id x2M86GbZ003094; Fri, 22 Mar 2019 03:06:22 -0500 From: Jyri Sarha To: , , CC: , , , , , , , , Subject: [PATCH v5 2/6] drm/bridge: sii902x: Set output mode to HDMI or DVI according to EDID Date: Fri, 22 Mar 2019 10:06:11 +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 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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(+) -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c index 1afa000141d5..f73eaa6d729a 100644 --- a/drivers/gpu/drm/bridge/sii902x.c +++ b/drivers/gpu/drm/bridge/sii902x.c @@ -180,12 +180,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); } @@ -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; }