soc/tegra: Add support for IO pads power and voltage control
v4 cover soc/tegra: Add support for IO pads power and voltage control
The IO pins of Tegra SoCs are grouped for common control of IO interface like setting voltage signal levels and power state of the interface. The group is generally referred as IO pads. The power state and voltage control of IO pins can be done at IO pads level.
Tegra124 onwards IO pads support the power down state when system is active. The voltage levels on IO pads are auto detected on Tegra124/ Tegra132 but it is not in Tegra210. For Tegra210, the SW need to explicitly configure the voltage levels of IO pads
This series add the interface for the IO pad power state and voltage configurations. Modifies the client to use new APIs. Register the child devices to provide the client interface to configure IO pads power state and voltage from Device tree.
---
Changes from V2:
- Drop the pinctrl driver from series till pmc interfce is finalise.
- Move client to use the new APIs.
- Remove older APIs to configure IO rail and related macros.
Changes from V2:
- keep value to be unsigned long in the dpd_prepare.
- Make all pad_id/io_pad_id to id.
- tegra_io_pad_ -> tegra_io_pads
- dpd_bit -> bit, pwr_mask/bit to mask/bit.
- Rename function to tegra_io_pads_{set,get}_voltage_config
- Make the io pad tables common for all SoC.
- Make io_pads enums.
- Add enums for voltage.
- Drop patch of adding sub devs
Laxman Dewangan (3):
soc/tegra: pmc: Use BIT macro for register field definition soc/tegra: pmc: Correct type of variable for tegra_pmc_readl() soc/tegra: pmc: Add support for IO pads power state and voltage
drivers/gpu/drm/tegra/sor.c | 8 +- drivers/soc/tegra/pmc.c | 273 +++++++++++++++++++++++++++++++++++--------- include/soc/tegra/pmc.h | 132 +++++++++++++++------ 3 files changed, 321 insertions(+), 92 deletions(-)
Signature · 1 line
2.1.4
PATCH v4 1/3 soc/tegra: pmc: Use BIT macro for register field definition
Use BIT macro for register field definition and make constant as U when using in shift operator like (3 << 30) to (3U << 30)
---
Changes from V1:
- Remove the indenting of line which is not for BIT macro usage. Changes from V2:
- None
--- drivers/soc/tegra/pmc.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-)
drivers/soc/tegra/pmc.c +20 -20
@@ -45,28 +45,28 @@#include <soc/tegra/pmc.h> #define PMC_CNTRL 0x0 -#define PMC_CNTRL_SYSCLK_POLARITY (1 << 10)/* sys clk polarity */ -#define PMC_CNTRL_SYSCLK_OE (1 << 11)/* system clock enable */ -#define PMC_CNTRL_SIDE_EFFECT_LP0 (1 << 14)/* LP0 when CPU pwr gated */ -#define PMC_CNTRL_CPU_PWRREQ_POLARITY (1 << 15)/* CPU pwr req polarity */ -#define PMC_CNTRL_CPU_PWRREQ_OE (1 << 16)/* CPU pwr req enable */ -#define PMC_CNTRL_INTR_POLARITY (1 << 17)/* inverts INTR polarity */ +#define PMC_CNTRL_SYSCLK_POLARITY BIT(10)/* sys clk polarity */ +#define PMC_CNTRL_SYSCLK_OE BIT(11)/* system clock enable */ +#define PMC_CNTRL_SIDE_EFFECT_LP0 BIT(14)/* LP0 when CPU pwr gated */ +#define PMC_CNTRL_CPU_PWRREQ_POLARITY BIT(15)/* CPU pwr req polarity */ +#define PMC_CNTRL_CPU_PWRREQ_OE BIT(16)/* CPU pwr req enable */ +#define PMC_CNTRL_INTR_POLARITY BIT(17)/* inverts INTR polarity */ #define DPD_SAMPLE 0x020 -#define DPD_SAMPLE_ENABLE (1 << 0) -#define DPD_SAMPLE_DISABLE (0 << 0) +#define DPD_SAMPLE_ENABLE BIT(0) +#define DPD_SAMPLE_DISABLE (0 << 0)#define PWRGATE_TOGGLE 0x30 -#define PWRGATE_TOGGLE_START (1 << 8) +#define PWRGATE_TOGGLE_START BIT(8)#define REMOVE_CLAMPING 0x34#define PWRGATE_STATUS 0x38#define PMC_SCRATCH0 0x50 -#define PMC_SCRATCH0_MODE_RECOVERY (1 << 31) -#define PMC_SCRATCH0_MODE_BOOTLOADER (1 << 30) -#define PMC_SCRATCH0_MODE_RCM (1 << 1) +#define PMC_SCRATCH0_MODE_RECOVERY BIT(31) +#define PMC_SCRATCH0_MODE_BOOTLOADER BIT(30) +#define PMC_SCRATCH0_MODE_RCM BIT(1)#define PMC_SCRATCH0_MODE_MASK (PMC_SCRATCH0_MODE_RECOVERY | \ PMC_SCRATCH0_MODE_BOOTLOADER | \ PMC_SCRATCH0_MODE_RCM)
@@ -77,14 +77,14 @@#define PMC_SCRATCH41 0x140#define PMC_SENSOR_CTRL 0x1b0 -#define PMC_SENSOR_CTRL_SCRATCH_WRITE (1 << 2) -#define PMC_SENSOR_CTRL_ENABLE_RST (1 << 1) +#define PMC_SENSOR_CTRL_SCRATCH_WRITE BIT(2) +#define PMC_SENSOR_CTRL_ENABLE_RST BIT(1)#define IO_DPD_REQ 0x1b8 -#define IO_DPD_REQ_CODE_IDLE (0 << 30) -#define IO_DPD_REQ_CODE_OFF (1 << 30) -#define IO_DPD_REQ_CODE_ON (2 << 30) -#define IO_DPD_REQ_CODE_MASK (3 << 30) +#define IO_DPD_REQ_CODE_IDLE (0 << 30) +#define IO_DPD_REQ_CODE_OFF (1U << 30) +#define IO_DPD_REQ_CODE_ON (2U << 30) +#define IO_DPD_REQ_CODE_MASK (3U << 30)#define IO_DPD_STATUS 0x1bc#define IO_DPD2_REQ 0x1c0
@@ -96,10 +96,10 @@#define PMC_SCRATCH54_ADDR_SHIFT 0#define PMC_SCRATCH55 0x25c -#define PMC_SCRATCH55_RESET_TEGRA (1 << 31) +#define PMC_SCRATCH55_RESET_TEGRA BIT(31)#define PMC_SCRATCH55_CNTRL_ID_SHIFT 27#define PMC_SCRATCH55_PINMUX_SHIFT 24 -#define PMC_SCRATCH55_16BITOP (1 << 15) +#define PMC_SCRATCH55_16BITOP BIT(15)#define PMC_SCRATCH55_CHECKSUM_SHIFT 16#define PMC_SCRATCH55_I2CSLV1_SHIFT 0
Signature · 1 line
2.1.4
PATCH v4 2/3 soc/tegra: pmc: Correct type of variable for tegra_pmc_readl()
In reply to Laxman DewanganThe function tegra_pmc_readl() returns the u32 type data and hence change the data type of variable where this data is stored to u32 type.
---
Changes from V1:
-This is new in series as per discussion on V1 series to use u32 for tegra_pmc_readl.
Changes from V2:
- Make unsigned long to u32 for some missed variable from V1.
Changes from V3:
- Revert back the value to ulong where time calcualtion is done.
--- drivers/soc/tegra/pmc.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)
drivers/soc/tegra/pmc.c +9 -7
@@ -875,10 +875,10 @@ static int tegra_io_rail_prepare(unsigned int id, unsigned long *request,return 0 ; } -static int tegra_io_rail_poll (unsigned long offset,unsigned long mask, -unsigned long val,unsigned long timeout) +static int tegra_io_rail_poll (unsigned long offset,u32 mask, +u32 val,unsigned long timeout) { -unsigned long value; +u32 value; timeout = jiffies +msecs_to_jiffies (timeout);
@@ -900,8 +900,9 @@ static void tegra_io_rail_unprepare(void)int tegra_io_rail_power_on (unsigned int id) { -unsigned long request, status, value; -unsigned int bit, mask; +unsigned long request, status; +unsigned int bit; +u32 value, mask;int err;mutex_lock (&pmc->powergates_lock);
@@ -935,8 +936,9 @@ EXPORT_SYMBOL(tegra_io_rail_power_on);int tegra_io_rail_power_off (unsigned int id) { -unsigned long request, status, value; -unsigned int bit, mask; +unsigned long request, status; +unsigned int bit; +u32 value, mask;int err;mutex_lock (&pmc->powergates_lock);
Signature · 1 line
2.1.4
PATCH v4 3/3 soc/tegra: pmc: Add support for IO pads power state and voltage
In reply to Laxman DewanganThe IO pins of Tegra SoCs are grouped for common control of IO interface like setting voltage signal levels and power state of the interface. The group is generally referred as IO pads. The power state and voltage control of IO pins can be done at IO pads level.
Tegra generation SoC supports the power down of IO pads when it is not used even in the active state of system. This saves power from that IO interface. Also it supports multiple voltage level in IO pins for interfacing on some of pads. The IO pad voltage is automatically detected till T124, hence SW need not to configure this. But from T210, the automatically detection logic has been removed, hence SW need to explicitily set the IO pad voltage into IO pad configuration registers.
Add support to set the power states and voltage level of the IO pads from client driver. The implementation for the APIs are in generic which is applicable for all generation os Tegra SoC.
IO pads ID and information of bit field for power state and voltage level controls are added for Tegra124, Tegra132 and Tegra210. The SOR driver is modified to use the new APIs.
---
Changes from V1:
This is reworked on earlier path to have separation between IO rails and io pads and add power state and voltage control APIs in single call.
Changes from V2:
- Remove the tegra_io_rail_power_off/on() apis and change client (sor) driver to use the new APIs for IO pad power.
- Remove the TEGRA_IO_RAIL_ macros.
Changes from V3:
- Make all pad_id/io_pad_id to id.
- tegra_io_pad_ -> tegra_io_pads
- dpd_bit -> bit, pwr_mask/bit to mask/bit.
- Rename function to tegra_io_pads_{set,get}_voltage_config
- Make the io pad tables common for all SoC.
- Make io_pads enums.
- Add enums for voltage.
--- drivers/gpu/drm/tegra/sor.c | 8 +- drivers/soc/tegra/pmc.c | 221 ++++++++++++++++++++++++++++++++++++++------ include/soc/tegra/pmc.h | 132 ++++++++++++++++++-------- 3 files changed, 294 insertions(+), 67 deletions(-)
drivers/gpu/drm/tegra/sor.c +4 -4
@@ -1134,7 +1134,7 @@ static void tegra_sor_edp_disable(struct drm_encoder *encoder)dev_err (sor->dev,"failed to disable DP: %d\n" , err); } - err =tegra_io_rail_power_off (TEGRA_IO_RAIL_LVDS ); + err =tegra_io_pads_power_disable (TEGRA_IO_PAD_LVDS );if (err <0 )dev_err (sor->dev,"failed to power off I/O rail: %d\n" , err);
@@ -1296,7 +1296,7 @@ static void tegra_sor_edp_enable(struct drm_encoder *encoder)tegra_sor_writel (sor, value,SOR_DP_PADCTL0 );/* step 2 */ - err =tegra_io_rail_power_on (TEGRA_IO_RAIL_LVDS ); + err =tegra_io_pads_power_enable (TEGRA_IO_PAD_LVDS );if (err <0 )dev_err (sor->dev,"failed to power on I/O rail: %d\n" , err);
@@ -1748,7 +1748,7 @@ static void tegra_sor_hdmi_disable(struct drm_encoder *encoder)if (err <0 )dev_err (sor->dev,"failed to power down SOR: %d\n" , err); - err =tegra_io_rail_power_off (TEGRA_IO_RAIL_HDMI ); + err =tegra_io_pads_power_disable (TEGRA_IO_PAD_HDMI );if (err <0 )dev_err (sor->dev,"failed to power off HDMI rail: %d\n" , err);
@@ -1787,7 +1787,7 @@ static void tegra_sor_hdmi_enable(struct drm_encoder *encoder) div =clk_get_rate (sor->clk) /1000000 *4 ; - err =tegra_io_rail_power_on (TEGRA_IO_RAIL_HDMI ); + err =tegra_io_pads_power_enable (TEGRA_IO_PAD_HDMI );if (err <0 )dev_err (sor->dev,"failed to power on HDMI rail: %d\n" , err);
drivers/soc/tegra/pmc.c +195 -26
334 lines not on this page · raw message
include/soc/tegra/pmc.h +95 -37
154 lines not on this page · raw message
Signature · 1 line
2.1.4
Re: [PATCH V4 1/3] soc/tegra: pmc: Use BIT macro for register field definition
In reply to Laxman DewanganQuoted 82 lines · Laxman Dewangan
Use BIT macro for register field definition and make constant as U when using in shift operator like (3 << 30) to (3U << 30)
Signed-off-by Laxman Dewangan <[email protected]>---
Changes from V1:
- Remove the indenting of line which is not for BIT macro usage. Changes from V2:
- None--- drivers/soc/tegra/pmc.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-)drivers/soc/tegra/pmc.c +18
-18@@ -45,28 +45,28 @@#include <soc/tegra/pmc.h> #define PMC_CNTRL 0x0 -#define PMC_CNTRL_SYSCLK_POLARITY (1 << 10)/* sys clk polarity */ -#define PMC_CNTRL_SYSCLK_OE (1 << 11)/* system clock enable */ -#define PMC_CNTRL_SIDE_EFFECT_LP0 (1 << 14)/* LP0 when CPU pwr gated */ -#define PMC_CNTRL_CPU_PWRREQ_POLARITY (1 << 15)/* CPU pwr req polarity */ -#define PMC_CNTRL_CPU_PWRREQ_OE (1 << 16)/* CPU pwr req enable */ -#define PMC_CNTRL_INTR_POLARITY (1 << 17)/* inverts INTR polarity */ +#define PMC_CNTRL_SYSCLK_POLARITY BIT(10)/* sys clk polarity */ +#define PMC_CNTRL_SYSCLK_OE BIT(11)/* system clock enable */ +#define PMC_CNTRL_SIDE_EFFECT_LP0 BIT(14)/* LP0 when CPU pwr gated */ +#define PMC_CNTRL_CPU_PWRREQ_POLARITY BIT(15)/* CPU pwr req polarity */ +#define PMC_CNTRL_CPU_PWRREQ_OE BIT(16)/* CPU pwr req enable */ +#define PMC_CNTRL_INTR_POLARITY BIT(17)/* inverts INTR polarity */ #define DPD_SAMPLE 0x020 -#define DPD_SAMPLE_ENABLE (1 << 0) -#define DPD_SAMPLE_DISABLE (0 << 0) +#define DPD_SAMPLE_ENABLE BIT(0) +#define DPD_SAMPLE_DISABLE (0 << 0)#define PWRGATE_TOGGLE 0x30 -#define PWRGATE_TOGGLE_START (1 << 8) +#define PWRGATE_TOGGLE_START BIT(8)#define REMOVE_CLAMPING 0x34#define PWRGATE_STATUS 0x38#define PMC_SCRATCH0 0x50 -#define PMC_SCRATCH0_MODE_RECOVERY (1 << 31) -#define PMC_SCRATCH0_MODE_BOOTLOADER (1 << 30) -#define PMC_SCRATCH0_MODE_RCM (1 << 1) +#define PMC_SCRATCH0_MODE_RECOVERY BIT(31) +#define PMC_SCRATCH0_MODE_BOOTLOADER BIT(30) +#define PMC_SCRATCH0_MODE_RCM BIT(1)#define PMC_SCRATCH0_MODE_MASK (PMC_SCRATCH0_MODE_RECOVERY | \ PMC_SCRATCH0_MODE_BOOTLOADER | \ PMC_SCRATCH0_MODE_RCM)@@ -77,14 +77,14 @@#define PMC_SCRATCH41 0x140#define PMC_SENSOR_CTRL 0x1b0 -#define PMC_SENSOR_CTRL_SCRATCH_WRITE (1 << 2) -#define PMC_SENSOR_CTRL_ENABLE_RST (1 << 1) +#define PMC_SENSOR_CTRL_SCRATCH_WRITE BIT(2) +#define PMC_SENSOR_CTRL_ENABLE_RST BIT(1)#define IO_DPD_REQ 0x1b8 -#define IO_DPD_REQ_CODE_IDLE (0 << 30) -#define IO_DPD_REQ_CODE_OFF (1 << 30) -#define IO_DPD_REQ_CODE_ON (2 << 30) -#define IO_DPD_REQ_CODE_MASK (3 << 30) +#define IO_DPD_REQ_CODE_IDLE (0 << 30) +#define IO_DPD_REQ_CODE_OFF (1U << 30) +#define IO_DPD_REQ_CODE_ON (2U << 30) +#define IO_DPD_REQ_CODE_MASK (3U << 30)#define IO_DPD_STATUS 0x1bc#define IO_DPD2_REQ 0x1c0@@ -96,10 +96,10 @@#define PMC_SCRATCH54_ADDR_SHIFT 0
drivers/soc/tegra/pmc.c line 104
Quoted 10 lines
drivers/soc/tegra/pmc.c +2
-2#define PMC_SCRATCH55 0x25c -#define PMC_SCRATCH55_RESET_TEGRA (1 << 31) +#define PMC_SCRATCH55_RESET_TEGRA BIT(31)#define PMC_SCRATCH55_CNTRL_ID_SHIFT 27#define PMC_SCRATCH55_PINMUX_SHIFT 24 -#define PMC_SCRATCH55_16BITOP (1 << 15) +#define PMC_SCRATCH55_16BITOP BIT(15)#define PMC_SCRATCH55_CHECKSUM_SHIFT 16#define PMC_SCRATCH55_I2CSLV1_SHIFT 0
Cheers
Jon
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH V4 2/3] soc/tegra: pmc: Correct type of variable for tegra_pmc_readl()
In reply to Laxman DewanganQuoted 53 lines · Laxman Dewangan
The function
tegra_pmc_readl()returns the u32 type data and hence change the data type of variable where this data is stored to u32 type.Signed-off-by Laxman Dewangan <[email protected]>---
Changes from V1:
-This is new in series as per discussion on V1 series to use u32 fortegra_pmc_readl.Changes from V2:
- Make unsigned long to u32 for some missed variable from V1.Changes from V3:
- Revert back the value to ulong where time calcualtion is done.--- drivers/soc/tegra/pmc.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)drivers/soc/tegra/pmc.c +6
-5@@ -875,10 +875,10 @@ static int tegra_io_rail_prepare(unsigned int id, unsigned long *request,return 0 ; } -static int tegra_io_rail_poll (unsigned long offset,unsigned long mask, -unsigned long val,unsigned long timeout) +static int tegra_io_rail_poll (unsigned long offset,u32 mask, +u32 val,unsigned long timeout) { -unsigned long value; +u32 value; timeout = jiffies +msecs_to_jiffies (timeout);@@ -900,8 +900,9 @@ static void tegra_io_rail_unprepare(void)int tegra_io_rail_power_on (unsigned int id) { -unsigned long request, status, value; -unsigned int bit, mask; +unsigned long request, status; +unsigned int bit; +u32 value, mask;int err;mutex_lock (&pmc->powergates_lock);@@ -935,8 +936,9 @@ EXPORT_SYMBOL(tegra_io_rail_power_on);
drivers/soc/tegra/pmc.c EXPORT_SYMBOL(tegra_io_rail_power_on); · line 944
Quoted 10 lines
drivers/soc/tegra/pmc.c +3
-2int tegra_io_rail_power_off (unsigned int id) { -unsigned long request, status, value; -unsigned int bit, mask; +unsigned long request, status; +unsigned int bit; +u32 value, mask;int err;mutex_lock (&pmc->powergates_lock);
Cheers
Jon
Jon Hunter
maintainerRe: [PATCH V4 3/3] soc/tegra: pmc: Add support for IO pads power state and voltage
In reply to Laxman DewanganQuoted 48 lines · Laxman Dewangan
The IO pins of Tegra SoCs are grouped for common control of IO interface like setting voltage signal levels and power state of the interface. The group is generally referred as IO pads. The power state and voltage control of IO pins can be done at IO pads level.
Tegra generation SoC supports the power down of IO pads when it is not used even in the active state of system. This saves power from that IO interface. Also it supports multiple voltage level in IO pins for interfacing on some of pads. The IO pad voltage is automatically detected till T124, hence SW need not to configure this. But from T210, the automatically detection logic has been removed, hence SW need to explicitily set the IO pad voltage into IO pad configuration registers.
Add support to set the power states and voltage level of the IO pads from client driver. The implementation for the APIs are in generic which is applicable for all generation os Tegra SoC.
IO pads ID and information of bit field for power state and voltage level controls are added for Tegra124, Tegra132 and Tegra210. The SOR driver is modified to use the new APIs.
Signed-off-by Laxman Dewangan <[email protected]>---
Changes from V1:
This is reworked on earlier path to have separation between IO rails and io pads and add power state and voltage control APIs in single call.Changes from V2:
- Remove the tegra_io_rail_power_off/on() apis and change client (sor) driver to use the new APIs for IO pad power.
- Remove theTEGRA_IO_RAIL_macros.Changes from V3:
- Make all pad_id/io_pad_id to id.
-tegra_io_pad_->tegra_io_pads
-dpd_bit-> bit, pwr_mask/bit to mask/bit.
- Rename function to tegra_io_pads_{set,get}_voltage_config
- Make the io pad tables common for all SoC.
- Makeio_padsenums.
- Add enums for voltage.--- drivers/gpu/drm/tegra/sor.c | 8 +- drivers/soc/tegra/pmc.c | 221 ++++++++++++++++++++++++++++++++++++++------ include/soc/tegra/pmc.h | 132 ++++++++++++++++++-------- 3 files changed, 294 insertions(+), 67 deletions(-)
[...]
Quoted 45 lines
include/soc/tegra/pmc.h +45
-0+/* TEGRA_IO_PAD: The IO pins of Tegra SoCs are grouped for common control +* of IO interface like setting voltage signal levels, power state of the +* interface. The group is generally referred as io-pads. The power and +* voltage control of IO pins are available at io-pads level. +* The following macros make the super list all IO pads found on Tegra SoC +* generations. +*/ +enum tegra_io_pads { +TEGRA_IO_PAD_AUDIO , +TEGRA_IO_PAD_AUDIO_HV , +TEGRA_IO_PAD_BB , +TEGRA_IO_PAD_CAM , +TEGRA_IO_PAD_COMP , +TEGRA_IO_PAD_CSIA , +TEGRA_IO_PAD_CSIB , +TEGRA_IO_PAD_CSIC , +TEGRA_IO_PAD_CSID , +TEGRA_IO_PAD_CSIE , +TEGRA_IO_PAD_CSIF , +TEGRA_IO_PAD_DBG , +TEGRA_IO_PAD_DEBUG_NONAO , +TEGRA_IO_PAD_DMIC , +TEGRA_IO_PAD_DP , +TEGRA_IO_PAD_DSI , +TEGRA_IO_PAD_DSIB , +TEGRA_IO_PAD_DSIC , +TEGRA_IO_PAD_DSID , +TEGRA_IO_PAD_EMMC , +TEGRA_IO_PAD_EMMC2 , +TEGRA_IO_PAD_GPIO , +TEGRA_IO_PAD_HDMI , +TEGRA_IO_PAD_HSIC , +TEGRA_IO_PAD_HV , +TEGRA_IO_PAD_LVDS , +TEGRA_IO_PAD_MIPI_BIAS , +TEGRA_IO_PAD_NAND , +TEGRA_IO_PAD_PEX_BIAS , +TEGRA_IO_PAD_PEX_CLK1 , +TEGRA_IO_PAD_PEX_CLK2 , +TEGRA_IO_PAD_PEX_CNTRL , +TEGRA_IO_PAD_SDMMC1 , +TEGRA_IO_PAD_SDMMC3 , +TEGRA_IO_PAD_SDMMC4 , +TEGRA_IO_PAD_SPI , +TEGRA_IO_PAD_SPI_HV ,
include/soc/tegra/pmc.h int tegra_pmc_cpu_remove_clamping(unsigned int cpuid); · line 133
Quoted 10 lines
include/soc/tegra/pmc.h +10
-0+TEGRA_IO_PAD_SYS_DDC , +TEGRA_IO_PAD_UART , +TEGRA_IO_PAD_USB0 , +TEGRA_IO_PAD_USB1 , +TEGRA_IO_PAD_USB2 , +TEGRA_IO_PAD_USB3 , +TEGRA_IO_PAD_USB_BIAS , + +/* Last entry */ + TEGRA_IO_PAD_MAX,
Nit should these be TEGRA_IO_PADS_xxx?
include/soc/tegra/pmc.h int tegra_pmc_cpu_remove_clamping(unsigned int cpuid); · line 142
Quoted 9 lines
include/soc/tegra/pmc.h +9
-0+}; + +/* tegra_io_pads_source_voltage: The voltage level of IO rails which source +* the IO pads. +*/ +enum tegra_io_pads_source_voltage { +TEGRA_IO_PADS_SOURCE_VOLTAGE_1800000UV , +TEGRA_IO_PADS_SOURCE_VOLTAGE_3300000UV , +};
Nit I wonder if we can make this shorter ...
enum tegra_io_pads_vconf {
TEGRA_IO_PADS_VCONF_1V8,
TEGRA_IO_PADS_VCONF_3V3,include/soc/tegra/pmc.h int tegra_powergate_remove_clamping(unsigned int id); · line 162
Quoted 11 lines
include/soc/tegra/pmc.h +9
-2-int tegra_io_rail_power_on (unsigned int id); -int tegra_io_rail_power_off (unsigned int id); +/* Power enable/disable of the IO pads */ +int tegra_io_pads_power_enable (enum tegra_io_pads id); +int tegra_io_pads_power_disable (enum tegra_io_pads id); +int tegra_io_pads_power_is_enabled (enum tegra_io_pads id); + +/* Set/get Tegra IO pads voltage config registers */ +int tegra_io_pads_set_voltage_config (enum tegra_io_pads id, +enum tegra_io_pads_source_voltage rail_uv); +int tegra_io_pads_get_voltage_config (enum tegra_io_pads id);
Ideally, for public function we should have kernel-doc descriptions.
Otherwise looks fine. I would not rev this unless Thierry has some comments.
Cheers
Jon
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH V4 3/3] soc/tegra: pmc: Add support for IO pads power state and voltage
Quoted 5 lines · Jon Hunter
On 06/05/16 11:45, Laxman Dewangan wrote:
include/soc/tegra/pmc.h +3
-0+ +/* Last entry */ + TEGRA_IO_PAD_MAX,Nit should these be
TEGRA_IO_PADS_xxx?
Because this was name of single pad and hence I said TEGRA_IO_PAD_XXX.
Quoted 11 lines
include/soc/tegra/pmc.h int tegra_pmc_cpu_remove_clamping(unsigned int cpuid); · line 142
Quoted 9 lines
include/soc/tegra/pmc.h +9
-0+}; + +/* tegra_io_pads_source_voltage: The voltage level of IO rails which source +* the IO pads. +*/ +enum tegra_io_pads_source_voltage { +TEGRA_IO_PADS_SOURCE_VOLTAGE_1800000UV , +TEGRA_IO_PADS_SOURCE_VOLTAGE_3300000UV , +};Nit I wonder if we can make this shorter ...
Quoted 3 lines
enum tegra_io_pads_vconf {
TEGRA_IO_PADS_VCONF_1V8,
TEGRA_IO_PADS_VCONF_3V3,This looks good but for voltage and current, unit is used uV/uV across the system. So wanted to have same unit.
Quoted 13 lines
include/soc/tegra/pmc.h int tegra_powergate_remove_clamping(unsigned int id); · line 162
Quoted 12 lines
include/soc/tegra/pmc.h +9
-2-int tegra_io_rail_power_on (unsigned int id); -int tegra_io_rail_power_off (unsigned int id); +/* Power enable/disable of the IO pads */ +int tegra_io_pads_power_enable (enum tegra_io_pads id); +int tegra_io_pads_power_disable (enum tegra_io_pads id); +int tegra_io_pads_power_is_enabled (enum tegra_io_pads id); + +/* Set/get Tegra IO pads voltage config registers */ +int tegra_io_pads_set_voltage_config (enum tegra_io_pads id, +enum tegra_io_pads_source_voltage rail_uv); +int tegra_io_pads_get_voltage_config (enum tegra_io_pads id);Ideally, for public function we should have kernel-doc descriptions.
I think we can have different patches for describing all the public interfaces with proper arguments description. May be after this series, I can work on this.
Quoted 5 lines
Otherwise looks fine. I would not rev this unless Thierry has some comments.
Cheers
Jon
Jon Hunter
maintainerRe: [PATCH V4 3/3] soc/tegra: pmc: Add support for IO pads power state and voltage
Quoted 9 lines · Laxman Dewangan
Quoted 5 lines · Jon Hunter
On 06/05/16 11:45, Laxman Dewangan wrote:
include/soc/tegra/pmc.h +3
-0+ +/* Last entry */ + TEGRA_IO_PAD_MAX,Nit should these be
TEGRA_IO_PADS_xxx?Because this was name of single pad and hence I said
TEGRA_IO_PAD_XXX.
Aren't these used to set the voltage level and power state for the entire group of IOs? Confused :-(
Quoted 12 lines
Quoted 12 lines
include/soc/tegra/pmc.h int tegra_pmc_cpu_remove_clamping(unsigned int cpuid); · line 142
Quoted 10 lines
drivers/soc/tegra/pmc.c +3
-0+}; + +/* tegra_io_pads_source_voltage: The voltage level of IO rails which source
+ * the IO pads.
+ */include/soc/tegra/pmc.h +4
-0+enum tegra_io_pads_source_voltage { +TEGRA_IO_PADS_SOURCE_VOLTAGE_1800000UV , +TEGRA_IO_PADS_SOURCE_VOLTAGE_3300000UV , +};Nit I wonder if we can make this shorter ...
Quoted 6 lines
Quoted 3 lines
enum tegra_io_pads_vconf { TEGRA_IO_PADS_VCONF_1V8, TEGRA_IO_PADS_VCONF_3V3,This looks good but for voltage and current, unit is used uV/uV across the system. So wanted to have same unit.
Now it is an enum does it matter? Or maybe just have ...
enum tegra_io_pads_vconf {
TEGRA_IO_PADS_1800000UV,
TEGRA_IO_PADS_3300000UV,
};Cheers
Jon
Re: [PATCH V4 3/3] soc/tegra: pmc: Add support for IO pads power state and voltage
Quoted 10 lines · Jon Hunter
Quoted 7 lines · Laxman Dewangan
Quoted 5 lines · Jon Hunter
On 06/05/16 11:45, Laxman Dewangan wrote:
include/soc/tegra/pmc.h +3
-0+ +/* Last entry */ + TEGRA_IO_PAD_MAX,Nit should these be
TEGRA_IO_PADS_xxx?Because this was name of single pad and hence I said
TEGRA_IO_PAD_XXX.Aren't these used to set the voltage level and power state for the entire group of IOs? Confused :-(
One IO pad can have multiple IO pins.
IO Pad control the power state and voltage of all pins belongs to that IO pad.
Now what should we say PADS or PAD here? TEGRA_IO_PAD_UART or TEGRA_IO_PADS_UART?
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
include/soc/tegra/pmc.h int tegra_pmc_cpu_remove_clamping(unsigned int cpuid); · line 142
Quoted 10 lines
drivers/soc/tegra/pmc.c +3
-0+}; + +/* tegra_io_pads_source_voltage: The voltage level of IO rails which source
+ * the IO pads.
+ */include/soc/tegra/pmc.h +4
-0+enum tegra_io_pads_source_voltage { +TEGRA_IO_PADS_SOURCE_VOLTAGE_1800000UV , +TEGRA_IO_PADS_SOURCE_VOLTAGE_3300000UV , +};Nit I wonder if we can make this shorter ...
enum tegra_io_pads_vconf { TEGRA_IO_PADS_VCONF_1V8, TEGRA_IO_PADS_VCONF_3V3,
Quoted 9 lines
Quoted 2 lines
This looks good but for voltage and current, unit is used uV/uV across the system. So wanted to have same unit.
Now it is an enum does it matter? Or maybe just have ...
enum tegra_io_pads_vconf { TEGRA_IO_PADS_1800000UV, TEGRA_IO_PADS_3300000UV, };
OK, TEGRA_IO_PADS_VCONF_1800000UV and TEGRA_IO_PADS_VCONF_3300000UV. Fine?
Jon Hunter
maintainerRe: [PATCH V4 3/3] soc/tegra: pmc: Add support for IO pads power state and voltage
Quoted 8 lines · Laxman Dewangan
Quoted 7 lines · Jon Hunter
Quoted 6 lines · Laxman Dewangan
Quoted 5 lines · Jon Hunter
On 06/05/16 11:45, Laxman Dewangan wrote:
include/soc/tegra/pmc.h +3
-0+ +/* Last entry */ + TEGRA_IO_PAD_MAX,Nit should these be
TEGRA_IO_PADS_xxx?
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Because this was name of single pad and hence I said
TEGRA_IO_PAD_XXX.Aren't these used to set the voltage level and power state for the entire group of IOs? Confused :-(
One IO pad can have multiple IO pins.
IO Pad control the power state and voltage of all pins belongs to that IO pad.
Ugh ... I remember for xusb there was something similar we the Tegra docs used pad to imply multiple. However, in general pad == pin == ball or at least should.
Quoted 2 lines
Now what should we say PADS or PAD here?
TEGRA_IO_PAD_UARTorTEGRA_IO_PADS_UART?
Personally, I think pads and that is purely because it aligns with the APIs. I think that the APIs names, tegra_io_pads_xxx() should be consistent with the enum naming.
Quoted 19 lines
Quoted 19 lines
Quoted 12 lines
Quoted 12 lines
include/soc/tegra/pmc.h int tegra_pmc_cpu_remove_clamping(unsigned int cpuid); · line 142
Quoted 10 lines
drivers/soc/tegra/pmc.c +3
-0+}; + +/* tegra_io_pads_source_voltage: The voltage level of IO rails which source
+ * the IO pads.
+ */include/soc/tegra/pmc.h +4
-0+enum tegra_io_pads_source_voltage { +TEGRA_IO_PADS_SOURCE_VOLTAGE_1800000UV , +TEGRA_IO_PADS_SOURCE_VOLTAGE_3300000UV , +};Nit I wonder if we can make this shorter ...
Quoted 5 lines
Quoted 3 lines
enum tegra_io_pads_vconf { TEGRA_IO_PADS_VCONF_1V8, TEGRA_IO_PADS_VCONF_3V3,This looks good but for voltage and current, unit is used uV/uV across the system. So wanted to have same unit.
Now it is an enum does it matter? Or maybe just have ...
Quoted 8 lines
Quoted 5 lines
enum tegra_io_pads_vconf { TEGRA_IO_PADS_1800000UV, TEGRA_IO_PADS_3300000UV, };OK,
TEGRA_IO_PADS_VCONF_1800000UVandTEGRA_IO_PADS_VCONF_3300000UV. Fine?
Fine :-)
Jon
Re: [PATCH V4 3/3] soc/tegra: pmc: Add support for IO pads power state and voltage
Quoted 10 lines · Jon Hunter
Quoted 9 lines · Laxman Dewangan
Quoted 8 lines · Jon Hunter
Quoted 7 lines · Laxman Dewangan
Quoted 5 lines · Jon Hunter
On 06/05/16 11:45, Laxman Dewangan wrote:
include/soc/tegra/pmc.h +3
-0+ +/* Last entry */ + TEGRA_IO_PAD_MAX,Nit should these be
TEGRA_IO_PADS_xxx?Because this was name of single pad and hence I said
TEGRA_IO_PAD_XXX.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Aren't these used to set the voltage level and power state for the entire group of IOs? Confused :-(
One IO pad can have multiple IO pins.
IO Pad control the power state and voltage of all pins belongs to that IO pad.Ugh ... I remember for xusb there was something similar we the Tegra docs used pad to imply multiple. However, in general pad == pin == ball or at least should.
when we say sddmc3 IO pads, we deal with all signal pins of sdmm3.
Jon Hunter
maintainerRe: [PATCH V4 3/3] soc/tegra: pmc: Add support for IO pads power state and voltage
Quoted 14 lines · Laxman Dewangan
Quoted 12 lines · Jon Hunter
Quoted 11 lines · Laxman Dewangan
Quoted 10 lines · Jon Hunter
Quoted 7 lines · Laxman Dewangan
Quoted 5 lines · Jon Hunter
On 06/05/16 11:45, Laxman Dewangan wrote:
(quoted diff) +3
-0+ + /* Last entry */ + TEGRA_IO_PAD_MAX,Nit should these be
TEGRA_IO_PADS_xxx?Because this was name of single pad and hence I said
TEGRA_IO_PAD_XXX.Aren't these used to set the voltage level and power state for the entire group of IOs? Confused :-(
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
One IO pad can have multiple IO pins.
IO Pad control the power state and voltage of all pins belongs to that IO pad.Ugh ... I remember for xusb there was something similar we the Tegra docs used pad to imply multiple. However, in general pad == pin == ball or at least should.
when we say sddmc3 IO pads, we deal with all signal pins of sdmm3.
Right but now you are saying io-pads and not io-pad. Yes io-pads would mean more than one, but IMO io-pad implies singular. Anyway, enough bike-shedding ...
Jon
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel