From patchwork Mon Dec 12 21:00:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 9471355 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 CCA1D60573 for ; Mon, 12 Dec 2016 21:00:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C2248284CA for ; Mon, 12 Dec 2016 21:00:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B6CFF2851D; Mon, 12 Dec 2016 21:00:56 +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 6CEEB284CA for ; Mon, 12 Dec 2016 21:00:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F3AB56E35D; Mon, 12 Dec 2016 21:00:52 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg0-x232.google.com (mail-pg0-x232.google.com [IPv6:2607:f8b0:400e:c05::232]) by gabe.freedesktop.org (Postfix) with ESMTPS id C93DE6E35D for ; Mon, 12 Dec 2016 21:00:49 +0000 (UTC) Received: by mail-pg0-x232.google.com with SMTP id p66so39082756pga.2 for ; Mon, 12 Dec 2016 13:00:49 -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=aGj0kRPzeVHLqhLkVhDScGlJs/wgRbhhasFCgYpDanh9tP4Xr00RGkSLu7hFaJ0ftM 5KWzX4NUHwSAyxihS/qIdPe2KiMNN9ieVbnLCASTp/fI/GsesJEoNph2WtepbjxC1gc0 wl1HZVOSMbeFaxWE4C2jOL1V+yLD2QIEPqBKE= 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=LAT3cokR6pRKZ+T3W9X8vh7mdESbDVTww0VYuBH1ZCw=; b=lLH2CO7ZwwRp97BzctD9q7yMWYBBsyv541JVgEiCLkfnDQFDQHN9gYe5X98QMQUdW6 vZmszlr/g5PqlP6TXKI2Q8R2evDckDdK02fQhKJpeZQFCY7E2o2KLWBe1IIwl50OTaCy Nb/f2pbha20rU2ZFB5EFD/PaetHxVPFlYp+uRyhKgwDazxKyISyK2UyWlNnjO2jGcC+E XkM+tRkLa5gPYq26x33YWxtMKDJ6vpl7ACs3tiwD3S4enSA/HkF0yGKPRVPos1mUBbwY djaayhlzjJhCzobVGKkatAmbOYFAkdmbsclVUl8ABkvghVt3YkjZAGWitNVRqTHYcPSx HWzA== X-Gm-Message-State: AKaTC00WpvLkdyAGfhLZqTxZgru3yVvEPatpsT8AH6gqkEf50SATj3ZNxVLncWTZBsxpUvrO X-Received: by 10.99.107.4 with SMTP id g4mr172364115pgc.108.1481576449079; Mon, 12 Dec 2016 13:00:49 -0800 (PST) Received: from localhost.localdomain ([2601:1c2:1002:83f0:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id f3sm41074078pga.45.2016.12.12.13.00.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Dec 2016 13:00:48 -0800 (PST) From: John Stultz To: lkml Subject: [RFC][PATCH 4/5 v3] drm/bridge: adv7511: Rework adv7511_power_on/off() so they can be reused internally Date: Mon, 12 Dec 2016 13:00:40 -0800 Message-Id: <1481576441-23529-5-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1481576441-23529-1-git-send-email-john.stultz@linaro.org> References: <1481576441-23529-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 --- 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; }