From patchwork Wed Feb 27 21:54:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jyri Sarha X-Patchwork-Id: 159298 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp4939352jad; Wed, 27 Feb 2019 13:54:49 -0800 (PST) X-Google-Smtp-Source: AHgI3Ia/bJ9fQRPjYjP7M6XMGdSS8El9uJCJ9236P6wtcYrnYCw8BXNjJEufSJ/WqZ3js2NlM5Ph X-Received: by 2002:a65:5281:: with SMTP id y1mr5208143pgp.59.1551304489880; Wed, 27 Feb 2019 13:54:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551304489; cv=none; d=google.com; s=arc-20160816; b=z/YXeafFZUTCXyGllKn5Atl9BoYoCXxE/aB/7PtyCVAlt0AYnNQc6zRlm2eyV3pvYj FdEoQ3CKvo+JZRN0bmpl1RA9AwOFmIjk4Iw/YF9NPu5TapxMyxwh0Sp/DeftShEWS7er SPWpnrTJ3ZnxLayOvYn3SHbdrmQ6e6i0jG0TMX/LymdIrx+emc6BZ8Xvxi+wvrJXoOz0 f/B/YZVVoiVEaY4u1QIdoxefgn33nqalEiUync/loEJT5j8tl4V79Ogix5VJbczc5BSN k/NEbed/UCalBxashPfEOCxBzcyWjAJJXUbhNn12DZYt5xV0798HGCM2IdGjG1FAm5CT P4WA== 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=Qr1pZOa0KFwYZm0HU8GIdEYPsQm7pmVFUF+oIZkTgCA=; b=NWGuQcC7s7vveCad1eQn1oQBDVDL0I4kCRdgPn5mYR8cIIJOqv523b9sU+Hru/4eNe JTOcB6cHdbByiW3zuRDNed9Q44fsGlZ1yWmuf0za6l1dbf7BYQjQl1O+ZUUjM0mtjLAa 5fFtC1G0x56aL2kZ0AOjdm3RG+1JgRu8iFLiQb52zC1UGajHxDMj+CWpGJdQ66pyYy3b Heh6aD0zqzWCjgiJTXjmFP2wUQbLf5hN8Wru6DHEOmu8An8M43HPz+mj5ybjVxQAXe+f eomO7QiTSuwPWB9IViD6dW6xQY2+9cr2+FG3ASbr3QC8U6H4oMtU83xfKx/5pqyNiOvF FyMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="RyF3/BCG"; 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 g84si6132260pfd.187.2019.02.27.13.54.49; Wed, 27 Feb 2019 13:54:49 -0800 (PST) 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="RyF3/BCG"; 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 S1728397AbfB0Vyt (ORCPT + 7 others); Wed, 27 Feb 2019 16:54:49 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:48096 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726594AbfB0Vys (ORCPT ); Wed, 27 Feb 2019 16:54:48 -0500 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x1RLsV1P007131; Wed, 27 Feb 2019 15:54:31 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1551304471; bh=Qr1pZOa0KFwYZm0HU8GIdEYPsQm7pmVFUF+oIZkTgCA=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=RyF3/BCGUCk2HYO3uPyoe86CQKVulO6xN8UiTLdzcOLkSakI36sndJ6ErbZS0lgd9 7V3QnnGm41mcEqbLUOnncqdtGtNtQK2Rd/SedkuRImzcZsYFPwXXqWzzQqAf6Sy1IN WnZiyWsxcHN4zs2D5Tx9XRd7HuZai+faivFMy100= 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 x1RLsVZd005615 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 27 Feb 2019 15:54:31 -0600 Received: from DFLE110.ent.ti.com (10.64.6.31) 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; Wed, 27 Feb 2019 15:54:31 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE110.ent.ti.com (10.64.6.31) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Wed, 27 Feb 2019 15:54:31 -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 x1RLsNed017712; Wed, 27 Feb 2019 15:54:29 -0600 From: Jyri Sarha To: , CC: , , , , , , , , Subject: [PATCH v2 2/5] drm/bridge: sii902x: Set output mode to HDMI or DVI according to EDID Date: Wed, 27 Feb 2019 23:54:20 +0200 Message-ID: <08d50e5eec760273a3b3699ea98732f5ec66ad25.1551303673.git.jsarha@ti.com> 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 --- 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..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; }