Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4942000imm; Tue, 19 Jun 2018 02:22:24 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJkvn0pTKrWaqCteVl8Nm5l8X/yULP/3U34KU/C8ecZrHRcUEsECq9hVE9Xu80vgsVEMH/f X-Received: by 2002:a63:a00a:: with SMTP id r10-v6mr14335125pge.222.1529400144226; Tue, 19 Jun 2018 02:22:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529400144; cv=none; d=google.com; s=arc-20160816; b=fS3ZbW5roN2Mhuc0BoQObi+WIzJmHavEwEZdfFq0sb02fmqfpIJXf00KF6Q6DlVDID iEEHl2lwNMeUJbCUY4bH3NXFYhiZj3JhwhD1QF+Ct8+2AzlCSFypJS4dYusMBF1IurAW qeJG85/TI6YSMZSeuB0bm1naWzU6jEjcLzMF3ZJ77zJyAhnv4S88XqU8wMSKLE86w3WA V8AMC8QuheqUDgVPJ3qSJt1YLZh3ebuusJiERi5x7p+y3tdPTgfXNTkep+UocsG38hnr L624dbWfFsIX6J918WTqR7xrvntYLyM1ztjpPy9ARhaql2ximtk4ni/a2nxpiLZXp9io nRXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=ZCw6JnLVp05/7RW+Ta+9/QzQDzLLCOO4Hjg0AvR0vlE=; b=AbEJoCw/9wnL2jUcyh6zmlzFyzl58HquQMnEhLIWRFcBMDYJO2ns5rO0ubu1zdTsTa G1YH08fA/N680gOWE6E8CgDjZoLGFyU/oQwmn3SVAaxpXCONHQQ4BIWdWXU8H/5SuHDb EZoCvHYFLw9Ga9r6Urns3e8eEQr9z/2vS2SFK0ERCoWoPl5UtPVUXcS5X7BK0D5ql1ia 1y5lwDwkHu6Gc8Zrm0aKbRLyOIdAgOfp/0tFvtPpBOhU6WzA6lm4Ma46oVtzcNYos6Y5 4OpX9Ca5wa2PfFjilHVSmIK+zpAo+v4SjJVLiV9+u9TQzdqTVMq9OUa8v7NqQXUKLtgj N+jA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="aFKn/sFb"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (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 z3-v6si16813357plb.228.2018.06.19.02.22.09; Tue, 19 Jun 2018 02:22:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="aFKn/sFb"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S937452AbeFSJV3 (ORCPT + 99 others); Tue, 19 Jun 2018 05:21:29 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:42115 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S937314AbeFSJV0 (ORCPT ); Tue, 19 Jun 2018 05:21:26 -0400 Received: by mail-pf0-f194.google.com with SMTP id w7-v6so9625488pfn.9 for ; Tue, 19 Jun 2018 02:21:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ZCw6JnLVp05/7RW+Ta+9/QzQDzLLCOO4Hjg0AvR0vlE=; b=aFKn/sFbA8vssGXGdcH6CSO2lC7PVb4T3lxZPK1LdUt/oixb8RmbGmj+zlnoOa9ceJ zSpFu3uyB/lGqQFzwgjtTYZQJ6hq/hlx+yD2QuHDgZMt3HOjLai08UGZP2j31MGF0WlB oS5idkUjxUVBMI94A1gmHBsJPTd+CEeDdLBEg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ZCw6JnLVp05/7RW+Ta+9/QzQDzLLCOO4Hjg0AvR0vlE=; b=eABduRymt4DuzqRpgW32mzsVY3bX/5WDExXa9AaYDSXEH/p2GSJiQOCVucpA74tE/R aoQiIfyIkeSvZrnQBWFie8FJ0AlGKmkMhm5IMV1DBF4t31pGExrpXjUg+QB68dN9WbcF oatNDaUEhF8cudYOomDgi/PdtHYZkQ8LVNG4Mxl/dSKBcHIg/Saf0n1tCpwewHlJeBwV Cg7bJ0wUa64iyiq8MaIxF2vPZhjm/1TVTnAIm2H+Zk7T1w7eqox0yo9dEIoGSnX9k4j8 JJzlP913HgAfCPaudyXaKPV8K5DTRfPT4nrj9s95KClcnfxV49Epqcq+HaHIG2G7qGXe ejDA== X-Gm-Message-State: APt69E3evs7ln/DVUS3Of9wj9v/yWadEpJrs6aA/434FnbcAqjNQjhDp WFzBulkbI0Cn5U8C+0RSl4JAuA== X-Received: by 2002:aa7:854e:: with SMTP id y14-v6mr16947949pfn.165.1529400085158; Tue, 19 Jun 2018 02:21:25 -0700 (PDT) Received: from localhost ([122.171.103.96]) by smtp.gmail.com with ESMTPSA id q8-v6sm37363690pfi.96.2018.06.19.02.21.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jun 2018 02:21:24 -0700 (PDT) Date: Tue, 19 Jun 2018 14:51:22 +0530 From: Viresh Kumar To: Taniya Das Cc: Sudeep Holla , Amit Kucheria , LKML , Linux PM list , "Rafael J. Wysocki" , Stephen Boyd , Rajendra Nayak , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Rob Herring , Saravana Kannan Subject: Re: [PATCH v4 1/2] dt-bindings: cpufreq: Introduce QCOM CPUFREQ FW bindings Message-ID: <20180619092122.ul56qnh5uangti3e@vireshk-i7> References: <1528801355-18719-1-git-send-email-tdas@codeaurora.org> <1528801355-18719-2-git-send-email-tdas@codeaurora.org> <0f3f0223-3539-dc66-5300-8f30d827445d@arm.com> <7abb2da6-c130-117a-5404-d07bb132d915@codeaurora.org> <32e8f874-a58b-8ba3-7a53-dc89cb34f7d9@codeaurora.org> <514eea88-1f98-7959-2341-3d57cff6f66b@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <514eea88-1f98-7959-2341-3d57cff6f66b@codeaurora.org> User-Agent: NeoMutt/20180323-120-3dd1ac Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19-06-18, 13:23, Taniya Das wrote: > Driver code (The below representation is just for example). > ============= > > V1 > #define ENABLE 0x0 > #define LUT_V1 0x110 > #define PERF_V1 0x920 > > V2 > #define LUT_V2 0x150 > #define PERF_V2 0x980 > > V3 > #define LUT_V3 0x120 > .... > > Do you want me to use "compatible" flag to > > if (compatible == v1) > enable = readl_relaxed(X + LUT_V1); > else if (compatible == v2) > enable = readl_relaxed(X + LUT_V2); > else if (compatible == v3) > enable = readl_relaxed(X + LUT_V2); You can have fields in a struct somewhere like enable_offset, which you can fill based on compatible string only once during probe and then the rest of the code would just do: enable = readl_relaxed(X + struct->enable_offset); -- viresh