From patchwork Tue Apr 2 07:29: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: 161617 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1410663jan; Tue, 2 Apr 2019 00:29:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqyi+JVq4ryw2lHT+oMOWa+PsyAfJS5TTFnavneojIqPklUmqMiq1uHT+g9nNDDjl9AqjOXO X-Received: by 2002:aa7:92d5:: with SMTP id k21mr777703pfa.223.1554190184966; Tue, 02 Apr 2019 00:29:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554190184; cv=none; d=google.com; s=arc-20160816; b=q6Tj2INm0SQA169hJOYU3AVXsE5bGuLL1QQPachvdcY6Sx1px57cXuVLLK3KiG6a4v YdrcKYfr/5Nj0VRTc+0xOjJeGVSvYoiY8384z8sSXtL8kqfIyIEPwnuPf9lqgg0Ubkct UxQ/YO4XA2Aw/enV1GMcyAv3xBq2AN1WsaD9frz/aGBxK4CvD24/0Zl+hERp4mtGfWP0 93LnYTcTbjb96DnGiNgwfySKJwTqQMenrEfUBc4osoqUjXvMZXVOlZtg5XuB6mAfdCUY KsYfASDaHIxNCYoathFEtN2apCQww6IIAOZFx12xpAJiCsUxugcMu4sPDUY902gDWwfb 1Ydg== 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=kVnLSCE4/lLSXds4ABP6AeESVVw5uZ7tKsRt0bBITDw=; b=tSiEZX+Y7KpknEFM87zDReX4owliXoJHNgtiUlOYjhc9ZVCAqsRmpI47VyY/Qhzdwn ZhSipEGqJo8z/oUAs8uRcoOeo+DCPulxZ4T2zDVUuwrExHcvnEVbay86dhvqEvKiG9/m y4ZIwxgjwRrUXIK5w4nzt7/y4he/6lm8AsKGY+lulkYo7le6TehsS3ZrGfYVlqAL4j1X lm38y6MNtgvE3+7a0stYV3HZK0dKDNRTcI99OH0mlLeI2euU5ksy0wnFzy7JBXs3KpeS oiH5khddbW+pu+R9xRdUcDb4uG+9IPaJBDSwvSwfqOR19fyEvQNy9coqdJHnzY6FHbW8 B6Iw== 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 p187si11065086pfp.89.2019.04.02.00.29.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 02 Apr 2019 00:29:44 -0700 (PDT) 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 26E8E89EFF; Tue, 2 Apr 2019 07:29:42 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7B2F68946E for ; Tue, 2 Apr 2019 07:29:40 +0000 (UTC) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x327TPN8079067; Tue, 2 Apr 2019 02:29:25 -0500 Received: from DLEE105.ent.ti.com (dlee105.ent.ti.com [157.170.170.35]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x327TPQG124738 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 2 Apr 2019 02:29:25 -0500 Received: from DLEE108.ent.ti.com (157.170.170.38) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Tue, 2 Apr 2019 02:29:23 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE108.ent.ti.com (157.170.170.38) 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; Tue, 2 Apr 2019 02:29:24 -0500 Received: from jadmar.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x327TFXL130596; Tue, 2 Apr 2019 02:29:21 -0500 From: Jyri Sarha To: , , Subject: [PATCH v6 2/6] drm/bridge: sii902x: Set output mode to HDMI or DVI according to EDID Date: Tue, 2 Apr 2019 10:29: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 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1554190165; bh=AQtv1bgNGRZbjvL9U7uoKaFfljaJ55FuLTfopsRT5U0=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=T3E+TITwORK2ZIBPUD+BoZizK0jhMdbXIxaxW1d7s9gMnRFgSUDZSNbYj5XPExC0A C2H9HHSzfjpvn0ht7XWkDRPTStqlowzxLBSiHKuA+DCOgDZOcGaak6LGXkHQZcZJ1l nh6zQdkZByCQaarZHaCPC+a2NMMFaGQEkB43wSis= 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, 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 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 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; }