On 04/05/16 12:39, Laxman Dewangan wrote:
+ return -EINVAL;
+
+ for (i = 0; i < soc->num_io_pads; ++i) {
+ if (soc->io_pads_control[i].pad_id == pad_id)
+ return soc->io_pads_control[i].dpd_bit_pos;
+ }
Do we need a loop here? Can't we just make the table a look-up table now
that the ID is just an index?
+ return !!(status & BIT(dpd_bit % 32));This is generic interface and hence. So in future if we have more option, we will not need change in interface.
+}
+EXPORT_SYMBOL(tegra_io_pads_power_is_enabled);
+
+int tegra_io_pads_configure_voltage(int io_pad_id, int io_volt_uv)
s/io_pad_id/id/
I think I prefer tegra_io_pads_set/get_voltage_conf(). What is the point
in passing uV here if in device-tree you are using the enum for the
voltage level? I know that I had suggested this, but given we are not
going to use voltage in the DT then, not sure it has any value here.
+#define TEGRA_IO_PADS_CONTROL(_pad, _dpd, _pwr) \
+{ \
+ .pad_id = (TEGRA_IO_PAD_##_pad), \
Not sure this needs to be part of the structure as it is just an index.
+#define TEGRA_IO_PAD_USB2 41Enum?
+#define TEGRA_IO_PAD_USB3 42
+#define TEGRA_IO_PAD_USB_BIAS 43
In genernal this feels like 3 patches ...
#endif /* CONFIG_ARCH_TEGRA */
1. Patch to add the new APIs
2. Patch to convert SOR to use new APIs
3. Patch to remove old APIs
May be let's see what Thierry thinks.