All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jon Hunter <jonathanh@nvidia.com>
To: Laxman Dewangan <ldewangan@nvidia.com>,
	thierry.reding@gmail.com, airlied@linux.ie,
	swarren@wwwdotorg.org, gnurou@gmail.com
Cc: linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH V4 3/3] soc/tegra: pmc: Add support for IO pads power state and voltage
Date: Fri, 6 May 2016 15:37:20 +0100	[thread overview]
Message-ID: <572CAC20.9030307@nvidia.com> (raw)
In-Reply-To: <1462531548-12914-4-git-send-email-ldewangan@nvidia.com>


On 06/05/16 11:45, Laxman Dewangan wrote:
> 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 <ldewangan@nvidia.com>
> 
> ---
> 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(-)

[...]

> +/* 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,
> +	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?

> +};
> +
> +/* 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,


> -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
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: Jon Hunter <jonathanh@nvidia.com>
To: Laxman Dewangan <ldewangan@nvidia.com>,
	<thierry.reding@gmail.com>, <airlied@linux.ie>,
	<swarren@wwwdotorg.org>, <gnurou@gmail.com>
Cc: <dri-devel@lists.freedesktop.org>, <linux-tegra@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH V4 3/3] soc/tegra: pmc: Add support for IO pads power state and voltage
Date: Fri, 6 May 2016 15:37:20 +0100	[thread overview]
Message-ID: <572CAC20.9030307@nvidia.com> (raw)
In-Reply-To: <1462531548-12914-4-git-send-email-ldewangan@nvidia.com>


On 06/05/16 11:45, Laxman Dewangan wrote:
> 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 <ldewangan@nvidia.com>
> 
> ---
> 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(-)

[...]

> +/* 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,
> +	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?

> +};
> +
> +/* 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,


> -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

  reply	other threads:[~2016-05-06 14:37 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-06 10:45 [PATCH V4 0/3] soc/tegra: Add support for IO pads power and voltage control Laxman Dewangan
2016-05-06 10:45 ` Laxman Dewangan
2016-05-06 10:45 ` [PATCH V4 1/3] soc/tegra: pmc: Use BIT macro for register field definition Laxman Dewangan
2016-05-06 10:45   ` Laxman Dewangan
2016-05-06 14:12   ` Jon Hunter
2016-05-06 14:12     ` Jon Hunter
2016-05-06 10:45 ` [PATCH V4 2/3] soc/tegra: pmc: Correct type of variable for tegra_pmc_readl() Laxman Dewangan
2016-05-06 10:45   ` Laxman Dewangan
     [not found]   ` <1462531548-12914-3-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-05-06 14:15     ` Jon Hunter
2016-05-06 14:15       ` Jon Hunter
2016-05-06 10:45 ` [PATCH V4 3/3] soc/tegra: pmc: Add support for IO pads power state and voltage Laxman Dewangan
2016-05-06 10:45   ` Laxman Dewangan
2016-05-06 14:37   ` Jon Hunter [this message]
2016-05-06 14:37     ` Jon Hunter
     [not found]     ` <572CAC20.9030307-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-05-06 15:32       ` Laxman Dewangan
2016-05-06 15:32         ` Laxman Dewangan
2016-05-08 12:13         ` Jon Hunter
2016-05-08 12:13           ` Jon Hunter
     [not found]           ` <572F2D84.3060505-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-05-11 13:28             ` Laxman Dewangan
2016-05-11 13:28               ` Laxman Dewangan
     [not found]               ` <57333366.2040500-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-05-11 15:35                 ` Jon Hunter
2016-05-11 15:35                   ` Jon Hunter
     [not found]                   ` <5733513E.9080606-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-05-11 17:22                     ` Laxman Dewangan
2016-05-11 17:22                       ` Laxman Dewangan
2016-05-11 19:59                       ` Jon Hunter
2016-05-11 19:59                         ` Jon Hunter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=572CAC20.9030307@nvidia.com \
    --to=jonathanh@nvidia.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gnurou@gmail.com \
    --cc=ldewangan@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=swarren@wwwdotorg.org \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.