linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
To: Paul Cercueil <paul@crapouillou.net>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Ralf Baechle <ralf@linux-mips.org>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Boris Brezillon <boris.brezillon@free-electrons.com>,
	Thierry Reding <thierry.reding@gmail.com>,
	Maarten ter Huurne <maarten@treewalker.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Paul Burton <paul.burton@imgtec.com>,
	linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-mips@linux-mips.org,
	linux-mmc@vger.kernel.org, linux-mtd@lists.infradead.org,
	linux-pwm@vger.kernel.org, linux-fbdev@vger.kernel.org,
	james.hogan@imgtec.com
Subject: Re: [PATCH v3 12/14] fbdev: jz4740-fb: Let the pinctrl driver configure the pins
Date: Mon, 30 Jan 2017 17:10:59 +0100	[thread overview]
Message-ID: <4646116.fubHeuC3Nm@amdc3058> (raw)
In-Reply-To: <20170125185207.23902-13-paul@crapouillou.net>


Hi,

On Wednesday, January 25, 2017 07:52:05 PM Paul Cercueil wrote:
> Now that the JZ4740 and similar SoCs have a pinctrl driver, we rely on
> the pins being properly configured before the driver probes.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>

Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

> ---
>  drivers/video/fbdev/jz4740_fb.c | 104 ++--------------------------------------
>  1 file changed, 3 insertions(+), 101 deletions(-)
> 
> v2: No changes
> v3: No changes
> 
> diff --git a/drivers/video/fbdev/jz4740_fb.c b/drivers/video/fbdev/jz4740_fb.c
> index 87790e9644d0..b57df83fdbd3 100644
> --- a/drivers/video/fbdev/jz4740_fb.c
> +++ b/drivers/video/fbdev/jz4740_fb.c
> @@ -17,6 +17,7 @@
>  #include <linux/module.h>
>  #include <linux/mutex.h>
>  #include <linux/platform_device.h>
> +#include <linux/pinctrl/consumer.h>
>  
>  #include <linux/clk.h>
>  #include <linux/delay.h>
> @@ -27,7 +28,6 @@
>  #include <linux/dma-mapping.h>
>  
>  #include <asm/mach-jz4740/jz4740_fb.h>
> -#include <asm/mach-jz4740/gpio.h>
>  
>  #define JZ_REG_LCD_CFG		0x00
>  #define JZ_REG_LCD_VSYNC	0x04
> @@ -146,93 +146,6 @@ static const struct fb_fix_screeninfo jzfb_fix = {
>  	.accel		= FB_ACCEL_NONE,
>  };
>  
> -static const struct jz_gpio_bulk_request jz_lcd_ctrl_pins[] = {
> -	JZ_GPIO_BULK_PIN(LCD_PCLK),
> -	JZ_GPIO_BULK_PIN(LCD_HSYNC),
> -	JZ_GPIO_BULK_PIN(LCD_VSYNC),
> -	JZ_GPIO_BULK_PIN(LCD_DE),
> -	JZ_GPIO_BULK_PIN(LCD_PS),
> -	JZ_GPIO_BULK_PIN(LCD_REV),
> -	JZ_GPIO_BULK_PIN(LCD_CLS),
> -	JZ_GPIO_BULK_PIN(LCD_SPL),
> -};
> -
> -static const struct jz_gpio_bulk_request jz_lcd_data_pins[] = {
> -	JZ_GPIO_BULK_PIN(LCD_DATA0),
> -	JZ_GPIO_BULK_PIN(LCD_DATA1),
> -	JZ_GPIO_BULK_PIN(LCD_DATA2),
> -	JZ_GPIO_BULK_PIN(LCD_DATA3),
> -	JZ_GPIO_BULK_PIN(LCD_DATA4),
> -	JZ_GPIO_BULK_PIN(LCD_DATA5),
> -	JZ_GPIO_BULK_PIN(LCD_DATA6),
> -	JZ_GPIO_BULK_PIN(LCD_DATA7),
> -	JZ_GPIO_BULK_PIN(LCD_DATA8),
> -	JZ_GPIO_BULK_PIN(LCD_DATA9),
> -	JZ_GPIO_BULK_PIN(LCD_DATA10),
> -	JZ_GPIO_BULK_PIN(LCD_DATA11),
> -	JZ_GPIO_BULK_PIN(LCD_DATA12),
> -	JZ_GPIO_BULK_PIN(LCD_DATA13),
> -	JZ_GPIO_BULK_PIN(LCD_DATA14),
> -	JZ_GPIO_BULK_PIN(LCD_DATA15),
> -	JZ_GPIO_BULK_PIN(LCD_DATA16),
> -	JZ_GPIO_BULK_PIN(LCD_DATA17),
> -};
> -
> -static unsigned int jzfb_num_ctrl_pins(struct jzfb *jzfb)
> -{
> -	unsigned int num;
> -
> -	switch (jzfb->pdata->lcd_type) {
> -	case JZ_LCD_TYPE_GENERIC_16_BIT:
> -		num = 4;
> -		break;
> -	case JZ_LCD_TYPE_GENERIC_18_BIT:
> -		num = 4;
> -		break;
> -	case JZ_LCD_TYPE_8BIT_SERIAL:
> -		num = 3;
> -		break;
> -	case JZ_LCD_TYPE_SPECIAL_TFT_1:
> -	case JZ_LCD_TYPE_SPECIAL_TFT_2:
> -	case JZ_LCD_TYPE_SPECIAL_TFT_3:
> -		num = 8;
> -		break;
> -	default:
> -		num = 0;
> -		break;
> -	}
> -	return num;
> -}
> -
> -static unsigned int jzfb_num_data_pins(struct jzfb *jzfb)
> -{
> -	unsigned int num;
> -
> -	switch (jzfb->pdata->lcd_type) {
> -	case JZ_LCD_TYPE_GENERIC_16_BIT:
> -		num = 16;
> -		break;
> -	case JZ_LCD_TYPE_GENERIC_18_BIT:
> -		num = 18;
> -		break;
> -	case JZ_LCD_TYPE_8BIT_SERIAL:
> -		num = 8;
> -		break;
> -	case JZ_LCD_TYPE_SPECIAL_TFT_1:
> -	case JZ_LCD_TYPE_SPECIAL_TFT_2:
> -	case JZ_LCD_TYPE_SPECIAL_TFT_3:
> -		if (jzfb->pdata->bpp == 18)
> -			num = 18;
> -		else
> -			num = 16;
> -		break;
> -	default:
> -		num = 0;
> -		break;
> -	}
> -	return num;
> -}
> -
>  /* Based on CNVT_TOHW macro from skeletonfb.c */
>  static inline uint32_t jzfb_convert_color_to_hw(unsigned val,
>  	struct fb_bitfield *bf)
> @@ -487,8 +400,7 @@ static void jzfb_enable(struct jzfb *jzfb)
>  
>  	clk_prepare_enable(jzfb->ldclk);
>  
> -	jz_gpio_bulk_resume(jz_lcd_ctrl_pins, jzfb_num_ctrl_pins(jzfb));
> -	jz_gpio_bulk_resume(jz_lcd_data_pins, jzfb_num_data_pins(jzfb));
> +	pinctrl_pm_select_default_state(&jzfb->pdev->dev);
>  
>  	writel(0, jzfb->base + JZ_REG_LCD_STATE);
>  
> @@ -511,8 +423,7 @@ static void jzfb_disable(struct jzfb *jzfb)
>  		ctrl = readl(jzfb->base + JZ_REG_LCD_STATE);
>  	} while (!(ctrl & JZ_LCD_STATE_DISABLED));
>  
> -	jz_gpio_bulk_suspend(jz_lcd_ctrl_pins, jzfb_num_ctrl_pins(jzfb));
> -	jz_gpio_bulk_suspend(jz_lcd_data_pins, jzfb_num_data_pins(jzfb));
> +	pinctrl_pm_select_sleep_state(&jzfb->pdev->dev);
>  
>  	clk_disable_unprepare(jzfb->ldclk);
>  }
> @@ -701,9 +612,6 @@ static int jzfb_probe(struct platform_device *pdev)
>  	fb->mode = NULL;
>  	jzfb_set_par(fb);
>  
> -	jz_gpio_bulk_request(jz_lcd_ctrl_pins, jzfb_num_ctrl_pins(jzfb));
> -	jz_gpio_bulk_request(jz_lcd_data_pins, jzfb_num_data_pins(jzfb));
> -
>  	ret = register_framebuffer(fb);
>  	if (ret) {
>  		dev_err(&pdev->dev, "Failed to register framebuffer: %d\n", ret);
> @@ -715,9 +623,6 @@ static int jzfb_probe(struct platform_device *pdev)
>  	return 0;
>  
>  err_free_devmem:
> -	jz_gpio_bulk_free(jz_lcd_ctrl_pins, jzfb_num_ctrl_pins(jzfb));
> -	jz_gpio_bulk_free(jz_lcd_data_pins, jzfb_num_data_pins(jzfb));
> -
>  	fb_dealloc_cmap(&fb->cmap);
>  	jzfb_free_devmem(jzfb);
>  err_framebuffer_release:
> @@ -731,9 +636,6 @@ static int jzfb_remove(struct platform_device *pdev)
>  
>  	jzfb_blank(FB_BLANK_POWERDOWN, jzfb->fb);
>  
> -	jz_gpio_bulk_free(jz_lcd_ctrl_pins, jzfb_num_ctrl_pins(jzfb));
> -	jz_gpio_bulk_free(jz_lcd_data_pins, jzfb_num_data_pins(jzfb));
> -
>  	fb_dealloc_cmap(&jzfb->fb->cmap);
>  	jzfb_free_devmem(jzfb);

  parent reply	other threads:[~2017-01-30 16:21 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20170117231421.16310-1-paul@crapouillou.net>
2017-01-18  7:15 ` [PATCH 00/13] Ingenic JZ4740 / JZ4780 pinctrl driver Thierry Reding
     [not found]   ` <27071da2f01d48141e8ac3dfaa13255d@mail.crapouillou.net>
2017-01-20  8:40     ` Linus Walleij
     [not found]     ` <20170122144947.16158-1-paul@crapouillou.net>
     [not found]       ` <20170122144947.16158-11-paul@crapouillou.net>
2017-01-23 10:40         ` [PATCH v2 10/14] mmc: jz4740: Let the pinctrl driver configure the pins Ulf Hansson
     [not found]       ` <20170122144947.16158-2-paul@crapouillou.net>
2017-01-27 11:18         ` [PATCH v2 01/14] Documentation: dt/bindings: Document pinctrl-ingenic Linus Walleij
     [not found]           ` <08e9505d2d366557950f8e6a4e81f57a@mail.crapouillou.net>
2017-01-31 12:59             ` Linus Walleij
     [not found]     ` <CGME20170125185254epcas5p15b40cad57649dc77afe8d2fd316687ff@epcas5p1.samsung.com>
     [not found]       ` <20170125185207.23902-13-paul@crapouillou.net>
2017-01-30 16:10         ` Bartlomiej Zolnierkiewicz [this message]
     [not found]     ` <20170125185207.23902-1-paul@crapouillou.net>
     [not found]       ` <20170125185207.23902-3-paul@crapouillou.net>
2017-01-30 20:33         ` [PATCH v3 02/14] Documentation: dt/bindings: Document pinctrl-gpio Rob Herring
     [not found]       ` <20170125185207.23902-2-paul@crapouillou.net>
2017-01-30 20:36         ` [PATCH v3 01/14] Documentation: dt/bindings: Document pinctrl-ingenic Rob Herring
     [not found]           ` <12dc62a7255bd453ff4e5e89f93ebc58@mail.crapouillou.net>
2017-01-31 13:09             ` Linus Walleij
     [not found]               ` <fd3c507484a9ee34a08c9f92e60624db@mail.crapouillou.net>
2017-02-20 13:56                 ` Linus Walleij
     [not found]                   ` <f19fea79c2616455f5f08070923428cc@crapouillou.net>
2017-02-23  9:59                     ` Linus Walleij
     [not found]         ` <20170402204244.14216-1-paul@crapouillou.net>
     [not found]           ` <20170402204244.14216-7-paul@crapouillou.net>
2017-04-03  9:57             ` [PATCH v4 06/14] MIPS: jz4740: DTS: Add nodes for ingenic pinctrl and gpio drivers Sergei Shtylyov
     [not found]               ` <cf809000718514ba612b4f7b477586a9@crapouillou.net>
2017-04-03 10:32                 ` Sergei Shtylyov
2017-04-07  9:44             ` Linus Walleij
     [not found]               ` <e4aaf8c3e8a54df2c5878f8e873e290f@crapouillou.net>
2017-04-24 12:58                 ` Linus Walleij
     [not found]           ` <20170402204244.14216-2-paul@crapouillou.net>
2017-04-04 14:48             ` [PATCH v4 01/14] dt/bindings: Document pinctrl-ingenic Rob Herring
     [not found]             ` <20170428200824.10906-1-paul@crapouillou.net>
     [not found]               ` <20170428200824.10906-3-paul@crapouillou.net>
2017-05-05 19:57                 ` [PATCH v5 02/14] dt/bindings: Document gpio-ingenic Rob Herring
     [not found]               ` <20170428200824.10906-4-paul@crapouillou.net>
     [not found]                 ` <7941dbfbaeaf5c23bb177e66165060d3@crapouillou.net>
2017-05-11 11:01                   ` [PATCH v5 03/14] pinctrl: add a pinctrl driver for the Ingenic jz47xx SoCs Linus Walleij
     [not found]               ` <20170428200824.10906-5-paul@crapouillou.net>
     [not found]                 ` <3a779fca-5a56-44e5-2acf-12b8abdaf906@crapouillou.net>
2017-05-11 11:06                   ` [PATCH v5 04/14] GPIO: Add gpio-ingenic driver Linus Walleij
     [not found]               ` <20170428200824.10906-6-paul@crapouillou.net>
2017-05-11 11:08                 ` [PATCH v5 05/14] MIPS: ingenic: Enable pinctrl for all ingenic SoCs Linus Walleij
2017-05-22 15:31                 ` Linus Walleij
2017-07-02 16:35                   ` Paul Cercueil
2017-07-03  9:07                     ` Linus Walleij
2017-07-03 13:55                       ` Ralf Baechle
2017-07-31 13:29                         ` Linus Walleij
     [not found]           ` <20170402204244.14216-3-paul@crapouillou.net>
2017-04-04 14:52             ` [PATCH v4 02/14] dt/bindings: Document gpio-ingenic Rob Herring
     [not found]           ` <20170402204244.14216-14-paul@crapouillou.net>
2017-04-06 14:40             ` [PATCH v4 13/14] pwm: jz4740: Let the pinctrl driver configure the pins Thierry Reding
     [not found]           ` <20170402204244.14216-5-paul@crapouillou.net>
2017-04-03 14:15             ` [PATCH v4 04/14] GPIO: Add gpio-ingenic driver kbuild test robot
2017-04-07  9:34             ` Linus Walleij
     [not found]           ` <20170402204244.14216-4-paul@crapouillou.net>
2017-04-07  9:41             ` [PATCH v4 03/14] pinctrl-ingenic: add a pinctrl driver for the Ingenic jz47xx SoCs Linus Walleij
2017-04-07 10:56               ` Lee Jones
     [not found]       ` <20170125185207.23902-4-paul@crapouillou.net>
2017-01-31 14:05         ` [PATCH v3 " Linus Walleij
     [not found]       ` <20170125185207.23902-5-paul@crapouillou.net>
2017-01-31 14:13         ` [PATCH v3 04/14] GPIO: Add gpio-ingenic driver Linus Walleij
     [not found]           ` <b032ad924ae905ce4fd11535d08c29a8@mail.crapouillou.net>
2017-02-12 20:48             ` Linus Walleij
2017-01-31 14:20         ` Linus Walleij
     [not found]           ` <699f0c63e95ecdafe6946fdcdbb97a37@mail.crapouillou.net>
2017-02-03 13:58             ` Linus Walleij
     [not found]       ` <20170125185207.23902-7-paul@crapouillou.net>
2017-01-31 14:16         ` [PATCH v3 06/14] MIPS: jz4740: DTS: Add nodes for ingenic pinctrl and gpio drivers Linus Walleij
     [not found] ` <20170117231421.16310-13-paul@crapouillou.net>
2017-01-18  7:20   ` [PATCH 12/13] pwm: jz4740: Let the pinctrl driver configure the pins Thierry Reding
     [not found] ` <20170117231421.16310-14-paul@crapouillou.net>
2017-01-18  7:27   ` [PATCH 13/13] MIPS: jz4740: Remove custom GPIO code Thierry Reding
2017-01-19  9:07   ` Linus Walleij
     [not found] ` <20170117231421.16310-3-paul@crapouillou.net>
2017-01-18 10:16   ` [PATCH 02/13] pinctrl-jz4740: add a pinctrl driver for the Ingenic jz4740 SoC Linus Walleij
     [not found] ` <20170117231421.16310-2-paul@crapouillou.net>
2017-01-18 23:45   ` [PATCH 01/13] Documentation: dt/bindings: Document pinctrl-ingenic Linus Walleij
     [not found] ` <20170117231421.16310-6-paul@crapouillou.net>
2017-01-18 23:50   ` [PATCH 05/13] MIPS: jz4740: DTS: Add node for the jz4740-pinctrl driver Linus Walleij
2017-01-19  6:38 ` [PATCH 00/13] Ingenic JZ4740 / JZ4780 pinctrl driver Linus Walleij
     [not found] ` <20170117231421.16310-10-paul@crapouillou.net>
2017-01-19 10:55   ` [PATCH 09/13] mmc: jz4740: Let the pinctrl driver configure the pins Ulf Hansson
     [not found] ` <20170117231421.16310-11-paul@crapouillou.net>
2017-01-27 17:33   ` [PATCH 10/13] mtd: nand: " Boris Brezillon

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=4646116.fubHeuC3Nm@amdc3058 \
    --to=b.zolnierkie@samsung.com \
    --cc=boris.brezillon@free-electrons.com \
    --cc=devicetree@vger.kernel.org \
    --cc=james.hogan@imgtec.com \
    --cc=lars@metafoo.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=maarten@treewalker.org \
    --cc=mark.rutland@arm.com \
    --cc=paul.burton@imgtec.com \
    --cc=paul@crapouillou.net \
    --cc=ralf@linux-mips.org \
    --cc=robh+dt@kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=ulf.hansson@linaro.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).