Re: [PATCH v4 1/2] dt-bindings: cpufreq: Introduce QCOM CPUFREQ FW bindings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux