From patchwork Fri Jan 9 10:15:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 426997 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id F2B9C140119 for ; Fri, 9 Jan 2015 21:15:39 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756839AbbAIKPi (ORCPT ); Fri, 9 Jan 2015 05:15:38 -0500 Received: from mail-we0-f175.google.com ([74.125.82.175]:57691 "EHLO mail-we0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756789AbbAIKPg (ORCPT ); Fri, 9 Jan 2015 05:15:36 -0500 Received: by mail-we0-f175.google.com with SMTP id k11so7101186wes.6; Fri, 09 Jan 2015 02:15:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=v1N247Do4VB6h8B32i/qVkQHry3U7E7swTV7K5qEhio=; b=f+cMpS91DhSw07Of+h/hdJ6OpOKGsRz7YGzLb+tPtdmuFSboPbus1Xeu/TK6sA/hK4 EkSa9/X72xuFn3FVzp9NWdaZACHOKqQ2LjkHlZEjY9IJu/fKwFYBYn8WgZdIS2TKYVsw rq49TRYWefQOLLzoP5l8bLEblg6G6Qpymaat7ccptNIMKBZjL9ueGm8IX2pxOg4lMGpM /koIK7GKQQlvXpzLJCI/DIkw59qvN6mWlS+8kchWteCCjTLnHnuD4VIiqAa3iYQ0S4b/ OyyvzNOJdfHzphBVqIqedhWACQthWCeJYUZB1MSrKLHhP3Z3+Aknj01XDDy2EtYD4UmR w7hA== X-Received: by 10.194.81.104 with SMTP id z8mr30130999wjx.45.1420798535232; Fri, 09 Jan 2015 02:15:35 -0800 (PST) Received: from localhost (port-6838.pppoe.wtnet.de. [84.46.26.208]) by mx.google.com with ESMTPSA id n4sm25147814wia.7.2015.01.09.02.15.34 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Jan 2015 02:15:34 -0800 (PST) From: Thierry Reding To: linux-tegra@vger.kernel.org Cc: Stephen Warren , Alexandre Courbot , Paul Walmsley , linux-arm-kernel@lists.infradead.org, linux-soc@vger.kernel.org Subject: [PATCH v2] soc/tegra: pmc: Add Tegra132 support Date: Fri, 9 Jan 2015 11:15:33 +0100 Message-Id: <1420798533-4036-1-git-send-email-thierry.reding@gmail.com> X-Mailer: git-send-email 2.1.3 In-Reply-To: <1420701657-32543-1-git-send-email-thierry.reding@gmail.com> References: <1420701657-32543-1-git-send-email-thierry.reding@gmail.com> Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org From: Thierry Reding Tegra132 uses the same GPU as Tegra124 and therefore requires the same method to remove clamps. However Tegra132 has a separate chip ID, so in order to avoid having to extend the list of chip IDs for the special case, add a feature flag to the SoC data. Reviewed-by: Paul Walmsley Signed-off-by: Thierry Reding --- Changes in v2: - reword the commit message to be less misleading (Paul Walmsley) drivers/soc/tegra/pmc.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c index 4bdc654bd747..0f096e76574a 100644 --- a/drivers/soc/tegra/pmc.c +++ b/drivers/soc/tegra/pmc.c @@ -88,6 +88,8 @@ struct tegra_pmc_soc { const char *const *powergates; unsigned int num_cpu_powergates; const u8 *cpu_powergates; + + bool has_gpu_clamps; }; /** @@ -225,11 +227,11 @@ int tegra_powergate_remove_clamping(int id) return -EINVAL; /* - * The Tegra124 GPU has a separate register (with different semantics) - * to remove clamps. + * On Tegra124 and later, the clamps for the GPU are controlled by a + * separate register (with different semantics). */ - if (tegra_get_chip_id() == TEGRA124) { - if (id == TEGRA_POWERGATE_3D) { + if (id == TEGRA_POWERGATE_3D) { + if (pmc->soc->has_gpu_clamps) { tegra_pmc_writel(0, GPU_RG_CNTRL); return 0; } @@ -773,6 +775,7 @@ static const struct tegra_pmc_soc tegra20_pmc_soc = { .powergates = tegra20_powergates, .num_cpu_powergates = 0, .cpu_powergates = NULL, + .has_gpu_clamps = false, }; static const char * const tegra30_powergates[] = { @@ -804,6 +807,7 @@ static const struct tegra_pmc_soc tegra30_pmc_soc = { .powergates = tegra30_powergates, .num_cpu_powergates = ARRAY_SIZE(tegra30_cpu_powergates), .cpu_powergates = tegra30_cpu_powergates, + .has_gpu_clamps = false, }; static const char * const tegra114_powergates[] = { @@ -839,6 +843,7 @@ static const struct tegra_pmc_soc tegra114_pmc_soc = { .powergates = tegra114_powergates, .num_cpu_powergates = ARRAY_SIZE(tegra114_cpu_powergates), .cpu_powergates = tegra114_cpu_powergates, + .has_gpu_clamps = false, }; static const char * const tegra124_powergates[] = { @@ -880,6 +885,7 @@ static const struct tegra_pmc_soc tegra124_pmc_soc = { .powergates = tegra124_powergates, .num_cpu_powergates = ARRAY_SIZE(tegra124_cpu_powergates), .cpu_powergates = tegra124_cpu_powergates, + .has_gpu_clamps = true, }; static const struct of_device_id tegra_pmc_match[] = {