1 From: Christian Lamparter <chunkeey@googlemail.com>
2 Subject: SoC: add qualcomm syscon
3 --- a/drivers/soc/qcom/Makefile
4 +++ b/drivers/soc/qcom/Makefile
5 @@ -23,6 +23,7 @@ obj-$(CONFIG_QCOM_SOCINFO) += socinfo.o
6 obj-$(CONFIG_QCOM_SPM) += spm.o
7 obj-$(CONFIG_QCOM_STATS) += qcom_stats.o
8 obj-$(CONFIG_QCOM_WCNSS_CTRL) += wcnss_ctrl.o
9 +obj-$(CONFIG_QCOM_TCSR) += qcom_tcsr.o
10 obj-$(CONFIG_QCOM_APR) += apr.o
11 obj-$(CONFIG_QCOM_LLCC) += llcc-qcom.o
12 obj-$(CONFIG_QCOM_RPMHPD) += rpmhpd.o
13 --- a/drivers/soc/qcom/Kconfig
14 +++ b/drivers/soc/qcom/Kconfig
15 @@ -213,6 +213,13 @@ config QCOM_STATS
16 various SoC level low power modes statistics and export to debugfs
20 + tristate "QCOM Top Control and Status Registers"
21 + depends on ARCH_QCOM
23 + Say y here to enable TCSR support. The TCSR provides control
24 + functions for various peripherals.
26 config QCOM_WCNSS_CTRL
27 tristate "Qualcomm WCNSS control driver"
28 depends on ARCH_QCOM || COMPILE_TEST
30 +++ b/drivers/soc/qcom/qcom_tcsr.c
33 + * Copyright (c) 2014, The Linux foundation. All rights reserved.
35 + * This program is free software; you can redistribute it and/or modify
36 + * it under the terms of the GNU General Public License rev 2 and
37 + * only rev 2 as published by the free Software foundation.
39 + * This program is distributed in the hope that it will be useful,
40 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
41 + * MERCHANTABILITY or fITNESS fOR A PARTICULAR PURPOSE. See the
42 + * GNU General Public License for more details.
45 +#include <linux/clk.h>
46 +#include <linux/err.h>
47 +#include <linux/io.h>
48 +#include <linux/module.h>
49 +#include <linux/of.h>
50 +#include <linux/of_platform.h>
51 +#include <linux/platform_device.h>
53 +#define TCSR_USB_PORT_SEL 0xb0
55 +static int tcsr_probe(struct platform_device *pdev)
57 + struct resource *res;
58 + const struct device_node *node = pdev->dev.of_node;
62 + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
63 + base = devm_ioremap_resource(&pdev->dev, res);
65 + return PTR_ERR(base);
67 + if (!of_property_read_u32(node, "qcom,usb-ctrl-select", &val)) {
68 + dev_err(&pdev->dev, "setting usb port select = %d\n", val);
69 + writel(val, base + TCSR_USB_PORT_SEL);
75 +static const struct of_device_id tcsr_dt_match[] = {
76 + { .compatible = "qcom,tcsr", },
80 +MODULE_DEVICE_TABLE(of, tcsr_dt_match);
82 +static struct platform_driver tcsr_driver = {
85 + .owner = THIS_MODULE,
86 + .of_match_table = tcsr_dt_match,
88 + .probe = tcsr_probe,
91 +module_platform_driver(tcsr_driver);
93 +MODULE_AUTHOR("Andy Gross <agross@codeaurora.org>");
94 +MODULE_DESCRIPTION("QCOM TCSR driver");
95 +MODULE_LICENSE("GPL v2");
97 +++ b/include/dt-bindings/soc/qcom,tcsr.h
99 +/* Copyright (c) 2014, The Linux Foundation. All rights reserved.
101 + * This program is free software; you can redistribute it and/or modify
102 + * it under the terms of the GNU General Public License version 2 and
103 + * only version 2 as published by the Free Software Foundation.
105 + * This program is distributed in the hope that it will be useful,
106 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
107 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
108 + * GNU General Public License for more details.
110 +#ifndef __DT_BINDINGS_QCOM_TCSR_H
111 +#define __DT_BINDINGS_QCOM_TCSR_H
113 +#define TCSR_USB_SELECT_USB3_P0 0x1
114 +#define TCSR_USB_SELECT_USB3_P1 0x2
115 +#define TCSR_USB_SELECT_USB3_DUAL 0x3
118 +#define IPQ806X_TCSR_REG_A_ADM_CRCI_MUX_SEL 0
119 +#define IPQ806X_TCSR_REG_B_ADM_CRCI_MUX_SEL 1