From patchwork Tue Nov 29 05:04:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 9450951 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 3EF836074E for ; Tue, 29 Nov 2016 05:05:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 338CB201BD for ; Tue, 29 Nov 2016 05:05:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2860327F46; Tue, 29 Nov 2016 05:05:29 +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 CC183201BD for ; Tue, 29 Nov 2016 05:05:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CBF386E4D5; Tue, 29 Nov 2016 05:05:18 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf0-x22a.google.com (mail-pf0-x22a.google.com [IPv6:2607:f8b0:400e:c00::22a]) by gabe.freedesktop.org (Postfix) with ESMTPS id 80E3E6E4B5 for ; Tue, 29 Nov 2016 05:04:56 +0000 (UTC) Received: by mail-pf0-x22a.google.com with SMTP id c4so29441908pfb.1 for ; Mon, 28 Nov 2016 21:04:56 -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=M38/EaiJWocAtTAGjLHd4fzwjBaU0J3nwZHbNTqsBrs=; b=RQqPIrvnLncKNoaoRYD0T6Omrbm5t2ngu9GVKYJ577bqDIL4Ux6wmKCY4b035eh1QS yggq6MyR3JUnDctsrcbfOVAzR9v2ystSKaX3rb9EGvAJ/ih5R6WLxzeqDtoTO3QNYke1 2EEsmwzrKu0dGZzid67X/Cun6vd+0jV4IB+eI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=M38/EaiJWocAtTAGjLHd4fzwjBaU0J3nwZHbNTqsBrs=; b=Q4VLQsbdFTrhB2zZYrL7pVI/vBfXtzq/fI0u+yUTX2tNhvmyFCHzG9CxYPe4bWledn ZSn+qaqD7sBsCk5pGguywezB/hLMX2xS2AlYqhnZVh20Q/HizBmrV5UmL82ZGWnfjCRD eY/51QWQFpXnWENzIQag/XmYV3pCqR1Ent2v4tkFrdSfjqrIkkdGCl+tuvgb4+J7/4dI Hz240bun5mu6vhBGCgZYmDr/kbxkU0BUi75mOmNSt5UgJMLX5v9H7RowByIAMY57Vu+n ZWH0RKmS8GmsHRK7zZIs6VsFw1/SpFnHITa9ukebH3z5RdDzXdt61hxzSnIY+Xk/+eCx reCw== X-Gm-Message-State: AKaTC01BGwL7vH5yIANiLPfv/lwykYqbCuHzQfacDz+4KwroDqYOTX5NJztARLoJdKNVKx1t X-Received: by 10.98.41.3 with SMTP id p3mr26288265pfp.22.1480395895907; Mon, 28 Nov 2016 21:04:55 -0800 (PST) Received: from localhost.localdomain ([2601:1c2:1002:83f0:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id b29sm73191498pgn.48.2016.11.28.21.04.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 Nov 2016 21:04:54 -0800 (PST) From: John Stultz To: lkml Subject: [RFC][PATCH 4/5 v2] drm/bridge: adv7511: Rework adv7511_power_on/off() so they can be reused internally Date: Mon, 28 Nov 2016 21:04:43 -0800 Message-Id: <1480395884-5471-5-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1480395884-5471-1-git-send-email-john.stultz@linaro.org> References: <1480395884-5471-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 --- v2: Split into two patches to make change more clear 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 9f8dffd..1948968 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; }