Commit 45043ce3 authored by Joey Gouly's avatar Joey Gouly
Browse files

pinctrl: add clock code



This will not be needed once power domain support is added.
Signed-off-by: Joey Gouly's avatarJoey Gouly <joey.gouly@arm.com>
parent 660dd2cc
......@@ -11,6 +11,7 @@
*/
#include <dt-bindings/pinctrl/apple.h>
#include <linux/clk.h>
#include <linux/gpio/driver.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
......@@ -452,6 +453,7 @@ static int apple_gpio_gpio_register(struct apple_gpio_pinctrl *pctl)
static int apple_gpio_pinctrl_probe(struct platform_device *pdev)
{
struct apple_gpio_pinctrl *pctl;
struct clk *clk;
struct pinctrl_pin_desc *pins;
unsigned int npins;
const char **pin_names;
......@@ -487,6 +489,17 @@ static int apple_gpio_pinctrl_probe(struct platform_device *pdev)
if (IS_ERR(pctl->base))
return PTR_ERR(pctl->base);
clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(clk)) {
dev_err(&pdev->dev, "unable to get clock: %ld.\n",
PTR_ERR(clk));
return PTR_ERR(clk);
}
res = clk_prepare_enable(clk);
if (res)
return res;
pctl->map =
devm_regmap_init_mmio(&pdev->dev, pctl->base, &regmap_config);
if (IS_ERR(pctl->map)) {
......
Supports Markdown
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