diff mbox series

[v2,4/4] drm: rcar-du: lvds: Rename pclk enable/disable functions

Message ID 20220822130513.119029-5-tomi.valkeinen@ideasonboard.com (mailing list archive)
State New, archived
Headers show
Series drm: rcar-du: DSI fixes | expand

Commit Message

Tomi Valkeinen Aug. 22, 2022, 1:05 p.m. UTC
From: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>

Rename LVDS pclk enable/disable functions to match what we use for DSI.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
---
 drivers/gpu/drm/rcar-du/rcar_du_crtc.c |  4 ++--
 drivers/gpu/drm/rcar-du/rcar_lvds.c    |  4 ++--
 drivers/gpu/drm/rcar-du/rcar_lvds.h    | 10 +++++-----
 3 files changed, 9 insertions(+), 9 deletions(-)

Comments

Laurent Pinchart Aug. 22, 2022, 1:52 p.m. UTC | #1
Hi Tomi,

Thank you for the patch.

On Mon, Aug 22, 2022 at 04:05:12PM +0300, Tomi Valkeinen wrote:
> From: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
> 
> Rename LVDS pclk enable/disable functions to match what we use for DSI.

I'd explain here the rationale for the new names:

The DU driver uses the rcar_lvds_clk_enable() and
rcar_lvds_clk_disable() functions enable or disable the pixel clock
generated by the LVDS encoder, as it requires that clock for proper DU
operation. Rename the functions by replacing "clk" with "pclk" to make
it clearer that they related to the pixel clock.

Then the patch could move to the beginning of the series.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
> ---
>  drivers/gpu/drm/rcar-du/rcar_du_crtc.c |  4 ++--
>  drivers/gpu/drm/rcar-du/rcar_lvds.c    |  4 ++--
>  drivers/gpu/drm/rcar-du/rcar_lvds.h    | 10 +++++-----
>  3 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
> index 31e33270e6db..3619e1ddeb62 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
> @@ -745,7 +745,7 @@ static void rcar_du_crtc_atomic_enable(struct drm_crtc *crtc,
>  		const struct drm_display_mode *mode =
>  			&crtc->state->adjusted_mode;
>  
> -		rcar_lvds_clk_enable(bridge, mode->clock * 1000);
> +		rcar_lvds_pclk_enable(bridge, mode->clock * 1000);
>  	}
>  
>  	/*
> @@ -790,7 +790,7 @@ static void rcar_du_crtc_atomic_disable(struct drm_crtc *crtc,
>  		 * Disable the LVDS clock output, see
>  		 * rcar_du_crtc_atomic_enable().
>  		 */
> -		rcar_lvds_clk_disable(bridge);
> +		rcar_lvds_pclk_disable(bridge);
>  	}
>  
>  	if ((rcdu->info->dsi_clk_mask & BIT(rcrtc->index)) &&
> diff --git a/drivers/gpu/drm/rcar-du/rcar_lvds.c b/drivers/gpu/drm/rcar-du/rcar_lvds.c
> index d85aa4bc7f84..f438d7d858c7 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_lvds.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_lvds.c
> @@ -306,7 +306,7 @@ static void rcar_lvds_pll_setup_d3_e3(struct rcar_lvds *lvds, unsigned int freq)
>   * Clock - D3/E3 only
>   */
>  
> -int rcar_lvds_clk_enable(struct drm_bridge *bridge, unsigned long freq)
> +int rcar_lvds_pclk_enable(struct drm_bridge *bridge, unsigned long freq)
>  {
>  	struct rcar_lvds *lvds = bridge_to_rcar_lvds(bridge);
>  	int ret;
> @@ -326,7 +326,7 @@ int rcar_lvds_clk_enable(struct drm_bridge *bridge, unsigned long freq)
>  }
>  EXPORT_SYMBOL_GPL(rcar_lvds_clk_enable);
>  
> -void rcar_lvds_clk_disable(struct drm_bridge *bridge)
> +void rcar_lvds_pclk_disable(struct drm_bridge *bridge)
>  {
>  	struct rcar_lvds *lvds = bridge_to_rcar_lvds(bridge);
>  
> diff --git a/drivers/gpu/drm/rcar-du/rcar_lvds.h b/drivers/gpu/drm/rcar-du/rcar_lvds.h
> index 3097bf749bec..bee7033b60d6 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_lvds.h
> +++ b/drivers/gpu/drm/rcar-du/rcar_lvds.h
> @@ -13,17 +13,17 @@
>  struct drm_bridge;
>  
>  #if IS_ENABLED(CONFIG_DRM_RCAR_LVDS)
> -int rcar_lvds_clk_enable(struct drm_bridge *bridge, unsigned long freq);
> -void rcar_lvds_clk_disable(struct drm_bridge *bridge);
> +int rcar_lvds_pclk_enable(struct drm_bridge *bridge, unsigned long freq);
> +void rcar_lvds_pclk_disable(struct drm_bridge *bridge);
>  bool rcar_lvds_dual_link(struct drm_bridge *bridge);
>  bool rcar_lvds_is_connected(struct drm_bridge *bridge);
>  #else
> -static inline int rcar_lvds_clk_enable(struct drm_bridge *bridge,
> -				       unsigned long freq)
> +static inline int rcar_lvds_pclk_enable(struct drm_bridge *bridge,
> +					unsigned long freq)
>  {
>  	return -ENOSYS;
>  }
> -static inline void rcar_lvds_clk_disable(struct drm_bridge *bridge) { }
> +static inline void rcar_lvds_pclk_disable(struct drm_bridge *bridge) { }
>  static inline bool rcar_lvds_dual_link(struct drm_bridge *bridge)
>  {
>  	return false;
Tomi Valkeinen Aug. 22, 2022, 1:56 p.m. UTC | #2
On 22/08/2022 16:52, Laurent Pinchart wrote:
> Hi Tomi,
> 
> Thank you for the patch.
> 
> On Mon, Aug 22, 2022 at 04:05:12PM +0300, Tomi Valkeinen wrote:
>> From: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
>>
>> Rename LVDS pclk enable/disable functions to match what we use for DSI.
> 
> I'd explain here the rationale for the new names:
> 
> The DU driver uses the rcar_lvds_clk_enable() and
> rcar_lvds_clk_disable() functions enable or disable the pixel clock
> generated by the LVDS encoder, as it requires that clock for proper DU
> operation. Rename the functions by replacing "clk" with "pclk" to make
> it clearer that they related to the pixel clock.
> 
> Then the patch could move to the beginning of the series.

Sounds good to me.

  Tomi
kernel test robot Aug. 23, 2022, 8:09 p.m. UTC | #3
Hi Tomi,

I love your patch! Yet something to improve:

[auto build test ERROR on pinchartl-media/drm/du/next]
[also build test ERROR on linus/master v6.0-rc2 next-20220823]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Tomi-Valkeinen/drm-rcar-du-DSI-fixes/20220822-210756
base:   git://linuxtv.org/pinchartl/media.git drm/du/next
config: arm-defconfig (https://download.01.org/0day-ci/archive/20220824/202208240422.wr7amM6Y-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/2c77c282d07b279cf94254b358b048d48a8a745b
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Tomi-Valkeinen/drm-rcar-du-DSI-fixes/20220822-210756
        git checkout 2c77c282d07b279cf94254b358b048d48a8a745b
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/gpu/drm/rcar-du/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   In file included from include/linux/linkage.h:7,
                    from include/linux/kernel.h:8,
                    from include/linux/clk.h:13,
                    from drivers/gpu/drm/rcar-du/rcar_lvds.c:10:
>> drivers/gpu/drm/rcar-du/rcar_lvds.c:326:19: error: 'rcar_lvds_clk_enable' undeclared here (not in a function); did you mean 'rcar_lvds_pclk_enable'?
     326 | EXPORT_SYMBOL_GPL(rcar_lvds_clk_enable);
         |                   ^~~~~~~~~~~~~~~~~~~~
   include/linux/export.h:98:23: note: in definition of macro '___EXPORT_SYMBOL'
      98 |         extern typeof(sym) sym;                                                 \
         |                       ^~~
   include/linux/export.h:160:41: note: in expansion of macro '__EXPORT_SYMBOL'
     160 | #define _EXPORT_SYMBOL(sym, sec)        __EXPORT_SYMBOL(sym, sec, "")
         |                                         ^~~~~~~~~~~~~~~
   include/linux/export.h:164:41: note: in expansion of macro '_EXPORT_SYMBOL'
     164 | #define EXPORT_SYMBOL_GPL(sym)          _EXPORT_SYMBOL(sym, "_gpl")
         |                                         ^~~~~~~~~~~~~~
   drivers/gpu/drm/rcar-du/rcar_lvds.c:326:1: note: in expansion of macro 'EXPORT_SYMBOL_GPL'
     326 | EXPORT_SYMBOL_GPL(rcar_lvds_clk_enable);
         | ^~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/rcar-du/rcar_lvds.c:341:19: error: 'rcar_lvds_clk_disable' undeclared here (not in a function); did you mean 'rcar_lvds_pclk_disable'?
     341 | EXPORT_SYMBOL_GPL(rcar_lvds_clk_disable);
         |                   ^~~~~~~~~~~~~~~~~~~~~
   include/linux/export.h:98:23: note: in definition of macro '___EXPORT_SYMBOL'
      98 |         extern typeof(sym) sym;                                                 \
         |                       ^~~
   include/linux/export.h:160:41: note: in expansion of macro '__EXPORT_SYMBOL'
     160 | #define _EXPORT_SYMBOL(sym, sec)        __EXPORT_SYMBOL(sym, sec, "")
         |                                         ^~~~~~~~~~~~~~~
   include/linux/export.h:164:41: note: in expansion of macro '_EXPORT_SYMBOL'
     164 | #define EXPORT_SYMBOL_GPL(sym)          _EXPORT_SYMBOL(sym, "_gpl")
         |                                         ^~~~~~~~~~~~~~
   drivers/gpu/drm/rcar-du/rcar_lvds.c:341:1: note: in expansion of macro 'EXPORT_SYMBOL_GPL'
     341 | EXPORT_SYMBOL_GPL(rcar_lvds_clk_disable);
         | ^~~~~~~~~~~~~~~~~


vim +326 drivers/gpu/drm/rcar-du/rcar_lvds.c

02f2b30032c12b Laurent Pinchart 2019-01-17  303  
02f2b30032c12b Laurent Pinchart 2019-01-17  304  /* -----------------------------------------------------------------------------
02f2b30032c12b Laurent Pinchart 2019-01-17  305   * Clock - D3/E3 only
02f2b30032c12b Laurent Pinchart 2019-01-17  306   */
02f2b30032c12b Laurent Pinchart 2019-01-17  307  
2c77c282d07b27 Tomi Valkeinen   2022-08-22  308  int rcar_lvds_pclk_enable(struct drm_bridge *bridge, unsigned long freq)
02f2b30032c12b Laurent Pinchart 2019-01-17  309  {
02f2b30032c12b Laurent Pinchart 2019-01-17  310  	struct rcar_lvds *lvds = bridge_to_rcar_lvds(bridge);
02f2b30032c12b Laurent Pinchart 2019-01-17  311  	int ret;
02f2b30032c12b Laurent Pinchart 2019-01-17  312  
02f2b30032c12b Laurent Pinchart 2019-01-17  313  	if (WARN_ON(!(lvds->info->quirks & RCAR_LVDS_QUIRK_EXT_PLL)))
02f2b30032c12b Laurent Pinchart 2019-01-17  314  		return -ENODEV;
02f2b30032c12b Laurent Pinchart 2019-01-17  315  
02f2b30032c12b Laurent Pinchart 2019-01-17  316  	dev_dbg(lvds->dev, "enabling LVDS PLL, freq=%luHz\n", freq);
02f2b30032c12b Laurent Pinchart 2019-01-17  317  
02f2b30032c12b Laurent Pinchart 2019-01-17  318  	ret = clk_prepare_enable(lvds->clocks.mod);
02f2b30032c12b Laurent Pinchart 2019-01-17  319  	if (ret < 0)
02f2b30032c12b Laurent Pinchart 2019-01-17  320  		return ret;
02f2b30032c12b Laurent Pinchart 2019-01-17  321  
02f2b30032c12b Laurent Pinchart 2019-01-17  322  	__rcar_lvds_pll_setup_d3_e3(lvds, freq, true);
02f2b30032c12b Laurent Pinchart 2019-01-17  323  
02f2b30032c12b Laurent Pinchart 2019-01-17  324  	return 0;
02f2b30032c12b Laurent Pinchart 2019-01-17  325  }
02f2b30032c12b Laurent Pinchart 2019-01-17 @326  EXPORT_SYMBOL_GPL(rcar_lvds_clk_enable);
02f2b30032c12b Laurent Pinchart 2019-01-17  327  
2c77c282d07b27 Tomi Valkeinen   2022-08-22  328  void rcar_lvds_pclk_disable(struct drm_bridge *bridge)
02f2b30032c12b Laurent Pinchart 2019-01-17  329  {
02f2b30032c12b Laurent Pinchart 2019-01-17  330  	struct rcar_lvds *lvds = bridge_to_rcar_lvds(bridge);
02f2b30032c12b Laurent Pinchart 2019-01-17  331  
02f2b30032c12b Laurent Pinchart 2019-01-17  332  	if (WARN_ON(!(lvds->info->quirks & RCAR_LVDS_QUIRK_EXT_PLL)))
02f2b30032c12b Laurent Pinchart 2019-01-17  333  		return;
02f2b30032c12b Laurent Pinchart 2019-01-17  334  
02f2b30032c12b Laurent Pinchart 2019-01-17  335  	dev_dbg(lvds->dev, "disabling LVDS PLL\n");
02f2b30032c12b Laurent Pinchart 2019-01-17  336  
02f2b30032c12b Laurent Pinchart 2019-01-17  337  	rcar_lvds_write(lvds, LVDPLLCR, 0);
02f2b30032c12b Laurent Pinchart 2019-01-17  338  
02f2b30032c12b Laurent Pinchart 2019-01-17  339  	clk_disable_unprepare(lvds->clocks.mod);
02f2b30032c12b Laurent Pinchart 2019-01-17  340  }
02f2b30032c12b Laurent Pinchart 2019-01-17 @341  EXPORT_SYMBOL_GPL(rcar_lvds_clk_disable);
02f2b30032c12b Laurent Pinchart 2019-01-17  342
diff mbox series

Patch

diff --git a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
index 31e33270e6db..3619e1ddeb62 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
@@ -745,7 +745,7 @@  static void rcar_du_crtc_atomic_enable(struct drm_crtc *crtc,
 		const struct drm_display_mode *mode =
 			&crtc->state->adjusted_mode;
 
-		rcar_lvds_clk_enable(bridge, mode->clock * 1000);
+		rcar_lvds_pclk_enable(bridge, mode->clock * 1000);
 	}
 
 	/*
@@ -790,7 +790,7 @@  static void rcar_du_crtc_atomic_disable(struct drm_crtc *crtc,
 		 * Disable the LVDS clock output, see
 		 * rcar_du_crtc_atomic_enable().
 		 */
-		rcar_lvds_clk_disable(bridge);
+		rcar_lvds_pclk_disable(bridge);
 	}
 
 	if ((rcdu->info->dsi_clk_mask & BIT(rcrtc->index)) &&
diff --git a/drivers/gpu/drm/rcar-du/rcar_lvds.c b/drivers/gpu/drm/rcar-du/rcar_lvds.c
index d85aa4bc7f84..f438d7d858c7 100644
--- a/drivers/gpu/drm/rcar-du/rcar_lvds.c
+++ b/drivers/gpu/drm/rcar-du/rcar_lvds.c
@@ -306,7 +306,7 @@  static void rcar_lvds_pll_setup_d3_e3(struct rcar_lvds *lvds, unsigned int freq)
  * Clock - D3/E3 only
  */
 
-int rcar_lvds_clk_enable(struct drm_bridge *bridge, unsigned long freq)
+int rcar_lvds_pclk_enable(struct drm_bridge *bridge, unsigned long freq)
 {
 	struct rcar_lvds *lvds = bridge_to_rcar_lvds(bridge);
 	int ret;
@@ -326,7 +326,7 @@  int rcar_lvds_clk_enable(struct drm_bridge *bridge, unsigned long freq)
 }
 EXPORT_SYMBOL_GPL(rcar_lvds_clk_enable);
 
-void rcar_lvds_clk_disable(struct drm_bridge *bridge)
+void rcar_lvds_pclk_disable(struct drm_bridge *bridge)
 {
 	struct rcar_lvds *lvds = bridge_to_rcar_lvds(bridge);
 
diff --git a/drivers/gpu/drm/rcar-du/rcar_lvds.h b/drivers/gpu/drm/rcar-du/rcar_lvds.h
index 3097bf749bec..bee7033b60d6 100644
--- a/drivers/gpu/drm/rcar-du/rcar_lvds.h
+++ b/drivers/gpu/drm/rcar-du/rcar_lvds.h
@@ -13,17 +13,17 @@ 
 struct drm_bridge;
 
 #if IS_ENABLED(CONFIG_DRM_RCAR_LVDS)
-int rcar_lvds_clk_enable(struct drm_bridge *bridge, unsigned long freq);
-void rcar_lvds_clk_disable(struct drm_bridge *bridge);
+int rcar_lvds_pclk_enable(struct drm_bridge *bridge, unsigned long freq);
+void rcar_lvds_pclk_disable(struct drm_bridge *bridge);
 bool rcar_lvds_dual_link(struct drm_bridge *bridge);
 bool rcar_lvds_is_connected(struct drm_bridge *bridge);
 #else
-static inline int rcar_lvds_clk_enable(struct drm_bridge *bridge,
-				       unsigned long freq)
+static inline int rcar_lvds_pclk_enable(struct drm_bridge *bridge,
+					unsigned long freq)
 {
 	return -ENOSYS;
 }
-static inline void rcar_lvds_clk_disable(struct drm_bridge *bridge) { }
+static inline void rcar_lvds_pclk_disable(struct drm_bridge *bridge) { }
 static inline bool rcar_lvds_dual_link(struct drm_bridge *bridge)
 {
 	return false;