From patchwork Mon Dec 25 06:37:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 122692 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5179406qgn; Sun, 24 Dec 2017 22:38:05 -0800 (PST) X-Google-Smtp-Source: ACJfBotMzl1Ct8BZbjvqVDhXNhyYvSyFWU/vshbpa47GRQKc1fSVnlrtBdMcWW16lZKz8LsBZ2Ev X-Received: by 10.98.218.74 with SMTP id w10mr20585777pfl.130.1514183885138; Sun, 24 Dec 2017 22:38:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514183885; cv=none; d=google.com; s=arc-20160816; b=q2wZ7qNjLumsOtiQN9jn7FQV+d2B3jsJWsqSAUJZtoFPwhkScf2viepyaqitpWw7N/ S3bjBxRwoUVxK01xKb+qNXEyMDotbfDODMJgj/dw086Xc1I8X8lRJLnO1CizbFhEyyGi CBHHhlGP+5YHR/YNlsZrTDw3EUB+6O7XAbAwWc36xx+ybDBZmFP6Tub32RTl6Krs+/Ez 9twlqko42kxIk3kkRJt1p1VTodJ4+rX6dt9LGdg/L1tPIjsXnW9OHVo5/qYPQTnxGdEC +wwesoOPNPmgqkmihzpvxnW4bDDDKZ20OAQ4yjDbD7o6KnJ+7TShyZAy/eGnwPreMMsd vEnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=uvUYqPDyG2K3ZSO25Y6Z2S3DKosKOToHQqNbUF3u4oM=; b=BLqLjMdp5XiG1yRoNYPkpEmLWumYd1UHp04cPRH/e9Nh4ewLt+CQU2UHNvxQ+OCbKZ KazclCK+SRqIj6n2DBWSKoIdkFNA9DyHWLclKCQpHdvphqP+1euUDvBaJAif46Owu6OY V7dkMDsEprl4xW05tcTzXW4CN34hYcG5cR0WdvZ0AW6eozAD7TgIAtWzMNIOCtsIA4w6 /Ah/L/t9/pJB8Cs5uURvZkg3Iyzu8/4Yq0WE+ukrzIC/GAnbDIk/qPD4x9ryzdKPqcKI Kw41iohgUk5lxeBlhOTBhTNdkUqd3Rr6DrEQXaES66bw4GzoxCrAKxICZL6nK+yBTnDI mlkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=gRZmHrNm; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g12si20825645pla.817.2017.12.24.22.38.04; Sun, 24 Dec 2017 22:38:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=gRZmHrNm; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750781AbdLYGhz (ORCPT + 6 others); Mon, 25 Dec 2017 01:37:55 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:42250 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750714AbdLYGhy (ORCPT ); Mon, 25 Dec 2017 01:37:54 -0500 Received: by mail-pg0-f68.google.com with SMTP id q67so7496767pga.9 for ; Sun, 24 Dec 2017 22:37: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; bh=7qxzwlx4cyUzXkRlFmJs2ok3toD3GDqmsQbuV5KgsdE=; b=gRZmHrNm5O5vW7wJCrcvwcOeOYVJqoqGXvz44HnB5tXTzydlLwaurCbBRv0nuhIzeL PhyO17IrdA9GKhFKUYKGceNtJ9iSNqDS4LimkWrX7JMsHu8AOe64qtQDt3xrEGMiQFSY grPpXsivZxDxOG9nCueHy+wK3qZSYNppvqM9M= 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; bh=7qxzwlx4cyUzXkRlFmJs2ok3toD3GDqmsQbuV5KgsdE=; b=OdU9oxgG1rm6//FAUqz0Qum72iA1okDypTgtmf7tNjhJprBKvbK8P09OecAYDlyi7g ti8OMP6Oi239HZd4EUIwwE03Qhl/FdOmRoH/TD2L8NHr0lRNeR8LmzPaEuYdQYA0Kpmv brNQPxNXCNS1TGT7Dj5c+jKe7jkrE9SuGUJQQvSIx/BYfcIJcuV1TpmSUnaxvrCuMeT1 Md/mgwJhoZx+BTI/V9hqXU9A57nEsXpzvsU2clKQR+yAGAskdX6c/4AbwRw81+Vjwgxq GC3wXBngzzgz3im3CcARpc8z84LuAREVGCN9YeofmLiSSJwNxDJXTvgpHpqj7QpRS6ke lFQQ== X-Gm-Message-State: AKGB3mLUFa9CwnfeSLTqOaZ2hTqSAM9aZeWs6wW118zWq5iayhvka78o pRaE/cm7M/M3mMqiAFAUq6L5Ew== X-Received: by 10.99.115.81 with SMTP id d17mr18862393pgn.279.1514183873818; Sun, 24 Dec 2017 22:37:53 -0800 (PST) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id n66sm24007668pfn.64.2017.12.24.22.37.50 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 24 Dec 2017 22:37:53 -0800 (PST) From: Baolin Wang To: lee.jones@linaro.org, arnd@arndb.de, robh+dt@kernel.org, mark.rutland@arm.com, broonie@kernel.org Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, baolin.wang@linaro.org Subject: [PATCH v7 1/2] regmap: Add one flag to indicate if a hwlock should be used Date: Mon, 25 Dec 2017 14:37:09 +0800 Message-Id: <29fa88f883dae4c1f8a3acb2656cbd7c5a539d40.1514180039.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Since the hwlock id 0 is valid for hardware spinlock core, but now id 0 is treated as one invalid value for regmap. Thus we should add one extra flag for regmap config to indicate if a hardware spinlock should be used, then id 0 can be valid for regmap to request. Signed-off-by: Baolin Wang --- - Add this new patch in V7. --- drivers/base/regmap/regmap.c | 2 +- include/linux/regmap.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Reviewed-by: Arnd Bergmann diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index f25ab18..d23a5c9 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@ -671,7 +671,7 @@ struct regmap *__regmap_init(struct device *dev, map->lock = config->lock; map->unlock = config->unlock; map->lock_arg = config->lock_arg; - } else if (config->hwlock_id) { + } else if (config->use_hwlock) { map->hwlock = hwspin_lock_request_specific(config->hwlock_id); if (!map->hwlock) { ret = -ENXIO; diff --git a/include/linux/regmap.h b/include/linux/regmap.h index 15eddc1..c78e005 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h @@ -317,6 +317,7 @@ struct regmap_access_table { * * @ranges: Array of configuration entries for virtual address ranges. * @num_ranges: Number of range configuration entries. + * @use_hwlock: Indicate if a hardware spinlock should be used. * @hwlock_id: Specify the hardware spinlock id. * @hwlock_mode: The hardware spinlock mode, should be HWLOCK_IRQSTATE, * HWLOCK_IRQ or 0. @@ -365,6 +366,7 @@ struct regmap_config { const struct regmap_range_cfg *ranges; unsigned int num_ranges; + bool use_hwlock; unsigned int hwlock_id; unsigned int hwlock_mode; };