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: 89724 Delivered-To: patches@linaro.org Received: by 10.140.20.101 with SMTP id 92csp8166389qgi; Tue, 3 Jan 2017 11:41:54 -0800 (PST) X-Received: by 10.99.113.82 with SMTP id b18mr102404325pgn.118.1483472514338; Tue, 03 Jan 2017 11:41:54 -0800 (PST) Return-Path: Received: from mail-pg0-x22c.google.com (mail-pg0-x22c.google.com. [2607:f8b0:400e:c05::22c]) by mx.google.com with ESMTPS id z3si69859036pge.291.2017.01.03.11.41.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Jan 2017 11:41:54 -0800 (PST) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 2607:f8b0:400e:c05::22c as permitted sender) client-ip=2607:f8b0:400e:c05::22c; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of john.stultz@linaro.org designates 2607:f8b0:400e:c05::22c as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by mail-pg0-x22c.google.com with SMTP id i5so153131229pgh.2 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=g+65Xxq6qr/EEGDzREYfAyfIzIhkljhCBv8hT7O6bVxpJvae2URR7U1MsrHzSvnLc1 2G3lXdiXz5hgVWkl5YdpEF/SwK9wXrYUwtj//7Dw+aIARlAkjNWvRPWSEDNp/u+n8/uK wsFq0C78YBNl5auM3y62l2+kOZNb5dbGi4XcEnluITaKQsremLcR6ADHe5Wb+EJe9vr4 qiNP9l5zORlsaRQ6smudJxyKGccS+Nv47iwtblwQ4j/+aukL6mlUsu8XRXIs1R48GVh2 Up1bJcDwqe3hVlS97UME0gAzV8i8kFVndfTlyMoGDwsz1rGKvq6uACfyCqv/vzi0AoNG lBmw== X-Gm-Message-State: AIkVDXI4P2uqy8+zAfqhVUrIUU19afpE1NFrw99N9SVN/Jk0jsKS8YBEF7tk9mIK4S78ta+i3xY= X-Received: by 10.98.158.133 with SMTP id f5mr51057550pfk.173.1483472514056; Tue, 03 Jan 2017 11:41:54 -0800 (PST) Return-Path: 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 Cc: John Stultz , David Airlie , Archit Taneja , Wolfram Sang , Lars-Peter Clausen , Laurent Pinchart , dri-devel@lists.freedesktop.org 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> 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(-) -- 2.7.4 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; }