mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-27 14:43:58 +08:00
1802d0beec
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 655 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Richard Fontana <rfontana@redhat.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070034.575739538@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
60 lines
1.6 KiB
C
60 lines
1.6 KiB
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
/*
|
|
* Copyright (c) 2015 MediaTek Inc.
|
|
* Author: Hongzhou.Yang <hongzhou.yang@mediatek.com>
|
|
*/
|
|
|
|
#include <linux/init.h>
|
|
#include <linux/platform_device.h>
|
|
#include <linux/of.h>
|
|
#include <linux/of_device.h>
|
|
#include <linux/pinctrl/pinctrl.h>
|
|
#include <linux/pinctrl/pinconf-generic.h>
|
|
#include <linux/mfd/mt6397/core.h>
|
|
|
|
#include "pinctrl-mtk-common.h"
|
|
#include "pinctrl-mtk-mt6397.h"
|
|
|
|
#define MT6397_PIN_REG_BASE 0xc000
|
|
|
|
static const struct mtk_pinctrl_devdata mt6397_pinctrl_data = {
|
|
.pins = mtk_pins_mt6397,
|
|
.npins = ARRAY_SIZE(mtk_pins_mt6397),
|
|
.dir_offset = (MT6397_PIN_REG_BASE + 0x000),
|
|
.ies_offset = MTK_PINCTRL_NOT_SUPPORT,
|
|
.smt_offset = MTK_PINCTRL_NOT_SUPPORT,
|
|
.pullen_offset = (MT6397_PIN_REG_BASE + 0x020),
|
|
.pullsel_offset = (MT6397_PIN_REG_BASE + 0x040),
|
|
.dout_offset = (MT6397_PIN_REG_BASE + 0x080),
|
|
.din_offset = (MT6397_PIN_REG_BASE + 0x0a0),
|
|
.pinmux_offset = (MT6397_PIN_REG_BASE + 0x0c0),
|
|
.type1_start = 41,
|
|
.type1_end = 41,
|
|
.port_shf = 3,
|
|
.port_mask = 0x3,
|
|
.port_align = 2,
|
|
};
|
|
|
|
static int mt6397_pinctrl_probe(struct platform_device *pdev)
|
|
{
|
|
struct mt6397_chip *mt6397;
|
|
|
|
mt6397 = dev_get_drvdata(pdev->dev.parent);
|
|
return mtk_pctrl_init(pdev, &mt6397_pinctrl_data, mt6397->regmap);
|
|
}
|
|
|
|
static const struct of_device_id mt6397_pctrl_match[] = {
|
|
{ .compatible = "mediatek,mt6397-pinctrl", },
|
|
{ }
|
|
};
|
|
|
|
static struct platform_driver mtk_pinctrl_driver = {
|
|
.probe = mt6397_pinctrl_probe,
|
|
.driver = {
|
|
.name = "mediatek-mt6397-pinctrl",
|
|
.of_match_table = mt6397_pctrl_match,
|
|
},
|
|
};
|
|
|
|
builtin_platform_driver(mtk_pinctrl_driver);
|