From patchwork Mon Feb 25 11:23:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jyri Sarha X-Patchwork-Id: 159172 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp1907889jad; Mon, 25 Feb 2019 03:23:40 -0800 (PST) X-Google-Smtp-Source: AHgI3IbortJWPSEFIs7fPU29dn+7bEYBU+zyJNQu9jF79X33kG6LdJfJazEC0vXWrg6wMixHFgc3 X-Received: by 2002:a63:6903:: with SMTP id e3mr484039pgc.147.1551093820702; Mon, 25 Feb 2019 03:23:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551093820; cv=none; d=google.com; s=arc-20160816; b=YUsiB94FtK7306cZ973lBJJPJFXSpLOh+bRoQebo4XW5mnL6RIhzUnyFvuZw6RIzGv CVhAB8gjBlKvAuvaOcqYtNn1WYc8rsCJlHSbgDAcK2P1h9N/lJKBFHGEAB3nJpNYAc7s GOf4EXdmfb4AONz8GgoA40FOcsFETJgMbg7VlYiykrBRKjZf7KwYaC8/3Jrz9zljoAwI u/Ri5MmM81QBjR7vybIFTH220Wr7cbQS8mbpWb37UD0LpObOmp92+mqrVTCNLs+HhBEG dY+yP34VAZSGOrVUYOkN/hzZX+N0s57upNzUZPBgAYoJ0tGGMVnmMW6mndIGLQ21Ti94 EpXQ== 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=Y++nEFbLLpUOliTnJgzxtq3Wu8gldFTW/zqpk9rVA8Q=; b=XwefC5RT0kmAPDce4viCnqOd9aDaYf5E1DSgMyBWE97vbO9hpGwxyeqN/lQ5fN45X8 W5n1oZhU4lozBVkJHkdbwW6yF+Q1Yx4BEcTIAbaWTON7Bu1WRoGwV1ISCoW+WKcAspOF +9XzuDczdnRe+HG4pvflCMELNMJQjInxiM+FeRYtNpvo8eo4bG1OCUFZF22cC8jpmKXZ NSJx6WWOSLiX+1eJDktrhYO2IsL9PCmdwnL5L0kNjUoL3Z0xH4EDHJbFMMiqiz9e2PG1 jUVm4HPMUGQiIczVoXXRyXVaig387XlYdprOIifWptzltf1KRdjOFmfFFsG2JvFVk9kc X1fA== 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 131.252.210.177 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. [131.252.210.177]) by mx.google.com with ESMTPS id m8si9048148pgp.322.2019.02.25.03.23.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Feb 2019 03:23:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 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 CA7158953E; Mon, 25 Feb 2019 11:23:36 +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 B9B45894DC for ; Mon, 25 Feb 2019 11:23:31 +0000 (UTC) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x1PBNMt6071832; Mon, 25 Feb 2019 05:23:22 -0600 Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x1PBNMh4101936 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 25 Feb 2019 05:23:22 -0600 Received: from DFLE101.ent.ti.com (10.64.6.22) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Mon, 25 Feb 2019 05:23:20 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE101.ent.ti.com (10.64.6.22) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Mon, 25 Feb 2019 05:23:20 -0600 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 x1PBND7P010192; Mon, 25 Feb 2019 05:23:18 -0600 From: Jyri Sarha To: Subject: [PATCH 2/4] drm/bridge: sii902x: Set output mode to HDMI or DVI according to EDID Date: Mon, 25 Feb 2019 13:23:10 +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=1551093802; bh=7lR6a5WeOO2C9UVDmpmlHjn6GP/t4tiRTM33r1cs3Ks=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Xw28aHLlNCaMMO3pJXm6tz/ecjsNEfGGtbZ+qi13pqelLjfhNxSvwcoyV4cJDI8YO xWneYPgrD4kSfZTJSeyvL1aonJgOlvx8+haetvKp9LQdnjaTe2TYtKxY2Akv7cYESy 0tszjYfS9nFT7qO4nuAAAxWLAbfCCsROVnlUxcPU= 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, boris.brezillon@free-electrons.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 --- 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; }