On 05/05/16 11:32, Laxman Dewangan wrote:
On Thursday 05 May 2016 03:43 PM, Jon Hunter wrote:That does make it tricky.
On 04/05/16 12:39, Laxman Dewangan wrote:We do not support the table for all pads and so for those non supported
+ 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?
pad index, it will be 0 (default) and 0 is the valid bit position here.
If you want table then we will need one more information for making thatAnother option would be, to have a single table for all devices and the
index as valid/invalid.
We can pack the valid/invalid with bit position to make u32.
make the valid field a valid mask which has a bit for each SoC.
We have defines in the dt binding header.Yes but apart from the SOR driver should only be used by the pinctrl+ return !!(status & BIT(dpd_bit % 32));This is generic interface and hence. So in future if we have more
+}
+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.
option, we will not need change in interface.
driver (I hope).
Otherwise, make enums for 1.8/3.3 and pass as enum here. So in future ifYou already have added the enum for the pinctrl driver and you would
we have any other voltage then again add enums.
I wanted to avoid this.
have to change that enum in the future anyway. So why not use it here?
I think that this is exactly what enums are for, then you don't have to+#define TEGRA_IO_PADS_CONTROL(_pad, _dpd, _pwr) \it is there for matching.
+{ \
+ .pad_id = (TEGRA_IO_PAD_##_pad), \
Not sure this needs to be part of the structure as it is just an index.
Yaah, that will also be possible. Then then argument is+#define TEGRA_IO_PAD_USB2 41Enum?
+#define TEGRA_IO_PAD_USB3 42
+#define TEGRA_IO_PAD_USB_BIAS 43
enum tegra_io_pad_id id
instead of unsigned int.
May be not much benifit here.
explicitly define each number.