--- /dev/null
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * 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.
+ */
+
+#define PIN_PULL_DIS 0
+#define PIN_PULL_DOWN 1
+#define PIN_PULL_UP 3
+
+#define PIN_DRV_LV1 0x0
+#define PIN_DRV_LV2 0x1
+#define PIN_DRV_LV3 0x2
+#define PIN_DRV_LV4 0x3
+#define PIN_DRV_LV5 0x4
+#define PIN_DRV_LV6 0x5
+#define PIN_DRV_SLOW_LV1 0x8
+#define PIN_DRV_SLOW_LV2 0x9
+#define PIN_DRV_SLOW_LV3 0xA
+#define PIN_DRV_SLOW_LV4 0xB
+#define PIN_DRV_SLOW_LV5 0xC
+#define PIN_DRV_SLOW_LV6 0xF
+
+#define PIN_PDN_OUT0 0
+#define PIN_PDN_OUT1 1
+#define PIN_PDN_IN 2
+#define PIN_PDN_PREV 3
+
+#define PIN_IN(_pin, _pull, _drv) \
+ _pin { \
+ samsung,pins = #_pin; \
+ samsung,pin-function = <0>; \
+ samsung,pin-pud = <PIN_PULL_##_pull>; \
+ samsung,pin-drv = <PIN_DRV_##_drv>; \
+ }
+
+#define PIN_OUT(_pin, _drv) \
+ _pin { \
+ samsung,pins = #_pin; \
+ samsung,pin-function = <1>; \
+ samsung,pin-pud = <0>; \
+ samsung,pin-drv = <PIN_DRV_##_drv>; \
+ }
+
+#define PIN_PUD(_pin, _pud) \
+ _pin { \
+ samsung,pins = #_pin; \
+ samsung,pin-pud = <PIN_PULL_##_pud>; \
+ }
+
+#define PIN_IN_PUD(_pin, _pud) \
+ _pin { \
+ samsung,pins = #_pin; \
+ samsung,pin-function = <0>; \
+ samsung,pin-pud = <PIN_PULL_ ##_pud>; \
+ }
+
+#define PIN_FUNC_PUD(_pin, _pud) \
+ _pin { \
+ samsung,pins = #_pin; \
+ samsung,pin-function = <2>; \
+ samsung,pin-pud = <PIN_PULL_ ##_pud>; \
+ }
+
+#define PIN_EINT_PUD(_pin, _pud) \
+ _pin { \
+ samsung,pins = #_pin; \
+ samsung,pin-function = <0xf>; \
+ samsung,pin-pud = <PIN_PULL_ ##_pud>; \
+ }
+
+#define PIN_OUT_SET(_pin, _val, _drv) \
+ _pin { \
+ samsung,pins = #_pin; \
+ samsung,pin-function = <1>; \
+ samsung,pin-pud = <0>; \
+ samsung,pin-drv = <PIN_DRV_##_drv>; \
+ samsung,pin-val = <_val>; \
+ }
+
+#define PIN_SLP(_pin, _mode, _pull) \
+ _pin { \
+ samsung,pins = #_pin; \
+ samsung,pin-con-pdn = <PIN_PDN_##_mode>; \
+ samsung,pin-pud-pdn = <PIN_PULL_##_pull>; \
+ }
--- /dev/null
+/*
+ * drivers/soc/samsung/exynos-sleepgpio.c
+ *
+ * The driver for setting exynos gpio configuration
+ *
+ * Copyright (C) 2018, Samsung Electronics.
+ *
+ * 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
+ */
+
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/of.h>
+#include <linux/of_gpio.h>
+
+//int is_set_pdn_conf;
+
+#ifdef CONFIG_OF
+static const struct of_device_id exynos_sleepgpio_dt_match[] = {
+ {.compatible = "samsung,exynos-sleepgpio",
+ .data = NULL },
+ {},
+};
+MODULE_DEVICE_TABLE(of, exynos_gpio_dt_match);
+#endif
+
+//#if 0
+#ifdef CONFIG_PM_SLEEP
+static int exynos_sleepgpio_suspend(struct device *dev)
+{
+ struct pinctrl *pinctrl;
+
+ pinctrl = pinctrl_get_select(dev, PINCTRL_STATE_SLEEP);
+ if (IS_ERR(pinctrl)) {
+ pr_err("%s: Do not have sleep pinctrl state\n", __func__);
+ return IS_ERR(pinctrl);
+ }
+
+ dev_info(dev, "Set sleep gpio \n");
+
+ return 0;
+}
+
+static int exynos_sleepgpio_resume(struct device *dev)
+{
+ struct pinctrl *pinctrl = pinctrl_get(dev);
+
+ pinctrl = devm_pinctrl_get_select(dev, PINCTRL_STATE_DEFAULT);
+ if (IS_ERR(pinctrl))
+ pr_err("%s: Do not have default pinctrl state.\n", __func__);
+
+ dev_info(dev, "Release sleep gpio \n");
+
+ return 0;
+}
+
+const struct dev_pm_ops exynos_sleepgpio_pm_ops = {
+ SET_LATE_SYSTEM_SLEEP_PM_OPS(
+ exynos_sleepgpio_suspend,
+ exynos_sleepgpio_resume)
+};
+#endif
+
+static int exynos_sleepgpio_probe(struct platform_device *pdev)
+{
+ pr_info("%s: Exynos sleepgpio driver probe is done.\n", __func__);
+ return 0;
+}
+
+static int exynos_sleepgpio_remove(struct platform_device *pdev)
+{
+ return 0;
+}
+
+static struct platform_driver exynos_sleepgpio = {
+ .driver = {
+ .name = "exynos_sleepgpio",
+ .owner = THIS_MODULE,
+#ifdef CONFIG_OF
+ .of_match_table = of_match_ptr(exynos_sleepgpio_dt_match),
+#endif
+#ifdef CONFIG_PM_SLEEP
+ .pm = &exynos_sleepgpio_pm_ops,
+#endif
+ },
+ .probe = exynos_sleepgpio_probe,
+ .remove = exynos_sleepgpio_remove,
+};
+
+module_platform_driver(exynos_sleepgpio);
+
+MODULE_AUTHOR("soomin.kim@samsung.com");
+MODULE_DESCRIPTION("GPIO setting driver for exynos");
+MODULE_LICENSE("GPL");