Commit 39febc01 authored by Shawn Guo's avatar Shawn Guo

mtd: nand: gpmi: adopt pinctrl support

Cc: linux-mtd@lists.infradead.org
Cc: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: default avatarShawn Guo <shawn.guo@linaro.org>
parent 9c92cf24
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/mtd/gpmi-nand.h> #include <linux/mtd/gpmi-nand.h>
#include <linux/mtd/partitions.h> #include <linux/mtd/partitions.h>
#include <linux/pinctrl/consumer.h>
#include "gpmi-nand.h" #include "gpmi-nand.h"
/* add our owner bbt descriptor */ /* add our owner bbt descriptor */
...@@ -476,6 +477,7 @@ static int __devinit acquire_dma_channels(struct gpmi_nand_data *this) ...@@ -476,6 +477,7 @@ static int __devinit acquire_dma_channels(struct gpmi_nand_data *this)
static int __devinit acquire_resources(struct gpmi_nand_data *this) static int __devinit acquire_resources(struct gpmi_nand_data *this)
{ {
struct resources *res = &this->resources; struct resources *res = &this->resources;
struct pinctrl *pinctrl;
int ret; int ret;
ret = acquire_register_block(this, GPMI_NAND_GPMI_REGS_ADDR_RES_NAME); ret = acquire_register_block(this, GPMI_NAND_GPMI_REGS_ADDR_RES_NAME);
...@@ -494,6 +496,12 @@ static int __devinit acquire_resources(struct gpmi_nand_data *this) ...@@ -494,6 +496,12 @@ static int __devinit acquire_resources(struct gpmi_nand_data *this)
if (ret) if (ret)
goto exit_dma_channels; goto exit_dma_channels;
pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
if (IS_ERR(pinctrl)) {
ret = PTR_ERR(pinctrl);
goto exit_pin;
}
res->clock = clk_get(&this->pdev->dev, NULL); res->clock = clk_get(&this->pdev->dev, NULL);
if (IS_ERR(res->clock)) { if (IS_ERR(res->clock)) {
pr_err("can not get the clock\n"); pr_err("can not get the clock\n");
...@@ -503,6 +511,7 @@ static int __devinit acquire_resources(struct gpmi_nand_data *this) ...@@ -503,6 +511,7 @@ static int __devinit acquire_resources(struct gpmi_nand_data *this)
return 0; return 0;
exit_clock: exit_clock:
exit_pin:
release_dma_channels(this); release_dma_channels(this);
exit_dma_channels: exit_dma_channels:
release_bch_irq(this); release_bch_irq(this);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment