From patchwork Fri Apr 26 13:23: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: 162912 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp747973jan; Fri, 26 Apr 2019 06:23:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqxle2ReSwldp/AxqiN4Qd/xWA5aLtFMxaW6YrgrGCCNiAcHHhnSnujKDsfClGigZ9EAgt88 X-Received: by 2002:a17:902:b40a:: with SMTP id x10mr45874286plr.231.1556285023525; Fri, 26 Apr 2019 06:23:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556285023; cv=none; d=google.com; s=arc-20160816; b=p+8Oak5xhszq5uzsW8kbwi/aR6DDLXpywEsBP2rUBUSF+c6HTvDTbXEhO75HE9XGAy +omGP6wynirWCmNBxyRT6nKUHRjuOAso9MhWdlCCGFaHQuUWRXJEY+J+DUUoeJJsh0/1 4FzUm3g0kwcVzZAwYAzzALWrq33IyqHHCVLBPEt80xINwpcGMrvA7KX3TBtJE505xWUy xsjuS/T1pyDOgCrsoT/txROoHKcDjklCYoyzoiC3XReuK97QwXIR/8hV1/3UhG0UkVua FwYE53oy+u0BN2WDtBh6SuKKyzINQRVjzp1M+y6DDlU2rKkPwRbBcuINypBhbRsT1pI2 eUCA== 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=U+jH6h1GaF3WqBsTsRAyOteNcWHkZ0yHhOVIte7rqhDYX2m8GMoNmsgnQ50TbG0ni2 u1GBZTe12dC4Ua18eKX9XfC0HWOnH5sY2YI9KPP6wvaYhns+C9uoxLVSE76oWz8To9KE 4CP8YoXJZxLvvz1XLDNp+fsckP9MppMMsjPyllEJbONUh8oFmjpf/pGxpMW03Ig719zU gdydnWoqP8P3w10DRPunxY85bP+G/KcBPi2Hkx9os45iBJXppN1c8GworZlvLK2ASpsm d5fKeKiac7BJbQPKMGe2OpZ+9946lMuDxQc/G6qpT7vh+r9xNJM5uw3ipSkqEy1B6KYn P7SQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=S+s20xaF; 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 o4si23183021pgp.160.2019.04.26.06.23.43; Fri, 26 Apr 2019 06:23:43 -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=S+s20xaF; 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 S1726039AbfDZNXm (ORCPT + 7 others); Fri, 26 Apr 2019 09:23:42 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:38974 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726069AbfDZNXm (ORCPT ); Fri, 26 Apr 2019 09:23:42 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x3QDNOHW054675; Fri, 26 Apr 2019 08:23:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1556285004; bh=AQtv1bgNGRZbjvL9U7uoKaFfljaJ55FuLTfopsRT5U0=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=S+s20xaF0fbhQz4mkCzNhF5+Aj3X1zWYUG+8ite4JwMhWPqZzjKp9Wimb8TOYTjFp S3Su3TZwEb9eh0w7iszhpC1D11jqeFPLZdHSBlr+MmtpsdGeGahpE0KUGzSVJ8NL3T BNs5Xl1pVmtyVWULIROXR2VhltEp9k/ilEhqQU54= Received: from DLEE100.ent.ti.com (dlee100.ent.ti.com [157.170.170.30]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x3QDNOu9014785 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 26 Apr 2019 08:23:24 -0500 Received: from DLEE110.ent.ti.com (157.170.170.21) by DLEE100.ent.ti.com (157.170.170.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 26 Apr 2019 08:23:23 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE110.ent.ti.com (157.170.170.21) 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; Fri, 26 Apr 2019 08:23:23 -0500 Received: from jadmar.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id x3QDNFsM024078; Fri, 26 Apr 2019 08:23:21 -0500 From: Jyri Sarha To: , , CC: , , , , , , , , Subject: [PATCH v7 2/6] drm/bridge: sii902x: Set output mode to HDMI or DVI according to EDID Date: Fri, 26 Apr 2019 16:23:11 +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 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; }