From patchwork Tue Jan 3 19:41:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 9495501 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D6A6D606A9 for ; Tue, 3 Jan 2017 19:42:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C586A272F9 for ; Tue, 3 Jan 2017 19:42:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B8A2E27B2F; Tue, 3 Jan 2017 19:42:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1E387272F9 for ; Tue, 3 Jan 2017 19:42:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C687F6E131; Tue, 3 Jan 2017 19:42:19 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg0-x22b.google.com (mail-pg0-x22b.google.com [IPv6:2607:f8b0:400e:c05::22b]) by gabe.freedesktop.org (Postfix) with ESMTPS id DDEFB6E13E for ; Tue, 3 Jan 2017 19:41:54 +0000 (UTC) Received: by mail-pg0-x22b.google.com with SMTP id y62so165908131pgy.1 for ; Tue, 03 Jan 2017 11:41:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=LAT3cokR6pRKZ+T3W9X8vh7mdESbDVTww0VYuBH1ZCw=; b=bSU0aQCO+Edvzr0JibxJkbHrHXyeM6Z92k+Kc8+4yFbUeIYj2XqLgAYWU5ruxjMoRs YPQWaooabuMsHthGfG7DHFKqS2I/LLy5uOaQXWHEYo6QqgpKVdmHb8MBfluhva2mVm/t 73OxtYnY5wruI93Pcdarbf0Nd0SZxnCX1jjlo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=LAT3cokR6pRKZ+T3W9X8vh7mdESbDVTww0VYuBH1ZCw=; b=X9NUo4bU14YBuNkNfdt8NAva8m/AzWEkH9Vyack+z6JbPTW6YEBWo4KgF/S38hKzY9 +YS5rndQNWKB5hXbfwuVD31HlsEQvYDWcw5IlJVhSPXeEQz4cs8fC+hKne82Jjogv50q DJK44L+Km05XZS/rbhJ6l2kJReEYymWoXfTvhdjoCzpUadc4k6oozdZDkU00ilhPtC2V K1W+mB4thxJBjb13Nl/o2h8phCaaXJqZ3FXQO2f3ds3rftdNJZ2dWYIKsIgAf0gGauw7 5gDf/7z8bXTo7bJM4lmspnDsFhkWd43byn547grX7yi9otcF6grCZ7pfM/P3XX6W6qvU 31RA== X-Gm-Message-State: AIkVDXKYu81xXrfokxDuIDgYEKCytTOAtX2YUYmlmPK2mT29C1Li6OgkZeggWZhCzcLdOYtG X-Received: by 10.98.158.133 with SMTP id f5mr51057550pfk.173.1483472514056; Tue, 03 Jan 2017 11:41:54 -0800 (PST) Received: from localhost.localdomain ([2601:1c2:1002:83f0:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id y62sm77865957pfk.52.2017.01.03.11.41.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 Jan 2017 11:41:53 -0800 (PST) From: John Stultz To: lkml Subject: [PATCH 4/5 v3] drm/bridge: adv7511: Rework adv7511_power_on/off() so they can be reused internally Date: Tue, 3 Jan 2017 11:41:41 -0800 Message-Id: <1483472502-16403-5-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1483472502-16403-1-git-send-email-john.stultz@linaro.org> References: <1483472502-16403-1-git-send-email-john.stultz@linaro.org> Cc: dri-devel@lists.freedesktop.org, Wolfram Sang , Laurent Pinchart X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP In chasing down issues with EDID probing, I found some duplicated but incomplete logic used to power the chip on and off. This patch refactors the adv7511_power_on/off functions, so they can be used for internal needs. Cc: David Airlie Cc: Archit Taneja Cc: Wolfram Sang Cc: Lars-Peter Clausen Cc: Laurent Pinchart Cc: dri-devel@lists.freedesktop.org Signed-off-by: John Stultz Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c index 4b90975..dbdb71c 100644 --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c @@ -325,7 +325,7 @@ static void adv7511_set_link_config(struct adv7511 *adv7511, adv7511->rgb = config->input_colorspace == HDMI_COLORSPACE_RGB; } -static void adv7511_power_on(struct adv7511 *adv7511) +static void __adv7511_power_on(struct adv7511 *adv7511) { adv7511->current_edid_segment = -1; @@ -359,24 +359,30 @@ static void adv7511_power_on(struct adv7511 *adv7511) * Most of the registers are reset during power down or when HPD is low. */ regcache_sync(adv7511->regmap); +} +static void adv7511_power_on(struct adv7511 *adv7511) +{ + __adv7511_power_on(adv7511); if (adv7511->type == ADV7533) adv7533_dsi_power_on(adv7511); - adv7511->powered = true; } -static void adv7511_power_off(struct adv7511 *adv7511) +static void __adv7511_power_off(struct adv7511 *adv7511) { /* TODO: setup additional power down modes */ regmap_update_bits(adv7511->regmap, ADV7511_REG_POWER, ADV7511_POWER_POWER_DOWN, ADV7511_POWER_POWER_DOWN); regcache_mark_dirty(adv7511->regmap); +} +static void adv7511_power_off(struct adv7511 *adv7511) +{ + __adv7511_power_off(adv7511); if (adv7511->type == ADV7533) adv7533_dsi_power_off(adv7511); - adv7511->powered = false; }