aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/lantiq/patches-3.10/0002-MIPS-lantiq-adds-minimal-dcdc-driver.patch
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2013-09-17 21:46:10 +0000
committerJohn Crispin <john@openwrt.org>2013-09-17 21:46:10 +0000
commit1878a3d6ab7e4296671eaa827623cc874d1f12c5 (patch)
tree895fea96a0462bc19622aed65e9e179d22d61069 /target/linux/lantiq/patches-3.10/0002-MIPS-lantiq-adds-minimal-dcdc-driver.patch
parentcd668944ef699762d4269ad71263ffe99c93ea8c (diff)
downloadupstream-1878a3d6ab7e4296671eaa827623cc874d1f12c5.tar.gz
upstream-1878a3d6ab7e4296671eaa827623cc874d1f12c5.tar.bz2
upstream-1878a3d6ab7e4296671eaa827623cc874d1f12c5.zip
lantiq: add v3.10 patches
Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 38031
Diffstat (limited to 'target/linux/lantiq/patches-3.10/0002-MIPS-lantiq-adds-minimal-dcdc-driver.patch')
-rw-r--r--target/linux/lantiq/patches-3.10/0002-MIPS-lantiq-adds-minimal-dcdc-driver.patch98
1 files changed, 98 insertions, 0 deletions
diff --git a/target/linux/lantiq/patches-3.10/0002-MIPS-lantiq-adds-minimal-dcdc-driver.patch b/target/linux/lantiq/patches-3.10/0002-MIPS-lantiq-adds-minimal-dcdc-driver.patch
new file mode 100644
index 0000000000..560cc1d49b
--- /dev/null
+++ b/target/linux/lantiq/patches-3.10/0002-MIPS-lantiq-adds-minimal-dcdc-driver.patch
@@ -0,0 +1,98 @@
+From 82a678435e9937dc8a7cb801f476e340fcfbc23e Mon Sep 17 00:00:00 2001
+From: John Crispin <blogic@openwrt.org>
+Date: Thu, 8 Aug 2013 14:02:23 +0200
+Subject: [PATCH 02/34] MIPS: lantiq: adds minimal dcdc driver
+
+This driver so far only reads the core voltage.
+
+Signed-off-by: John Crispin <blogic@openwrt.org>
+
+Acked-by: John Crispin <blogic@openwrt.org>
+Patchwork: http://patchwork.linux-mips.org/patch/5677/
+---
+ arch/mips/lantiq/xway/Makefile | 2 +-
+ arch/mips/lantiq/xway/dcdc.c | 63 ++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 64 insertions(+), 1 deletion(-)
+ create mode 100644 arch/mips/lantiq/xway/dcdc.c
+
+diff --git a/arch/mips/lantiq/xway/Makefile b/arch/mips/lantiq/xway/Makefile
+index 7a13660..087497d 100644
+--- a/arch/mips/lantiq/xway/Makefile
++++ b/arch/mips/lantiq/xway/Makefile
+@@ -1,3 +1,3 @@
+-obj-y := prom.o sysctrl.o clk.o reset.o dma.o gptu.o
++obj-y := prom.o sysctrl.o clk.o reset.o dma.o gptu.o dcdc.o
+
+ obj-$(CONFIG_XRX200_PHY_FW) += xrx200_phy_fw.o
+diff --git a/arch/mips/lantiq/xway/dcdc.c b/arch/mips/lantiq/xway/dcdc.c
+new file mode 100644
+index 0000000..7688ac0
+--- /dev/null
++++ b/arch/mips/lantiq/xway/dcdc.c
+@@ -0,0 +1,63 @@
++/*
++ * 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.
++ *
++ * Copyright (C) 2012 John Crispin <blogic@openwrt.org>
++ * Copyright (C) 2010 Sameer Ahmad, Lantiq GmbH
++ */
++
++#include <linux/ioport.h>
++#include <linux/of_platform.h>
++
++#include <lantiq_soc.h>
++
++/* Bias and regulator Setup Register */
++#define DCDC_BIAS_VREG0 0xa
++/* Bias and regulator Setup Register */
++#define DCDC_BIAS_VREG1 0xb
++
++#define dcdc_w8(x, y) ltq_w8((x), dcdc_membase + (y))
++#define dcdc_r8(x) ltq_r8(dcdc_membase + (x))
++
++static void __iomem *dcdc_membase;
++
++static int dcdc_probe(struct platform_device *pdev)
++{
++ struct resource *res;
++
++ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++ dcdc_membase = devm_ioremap_resource(&pdev->dev, res);
++ if (IS_ERR(dcdc_membase))
++ return PTR_ERR(dcdc_membase);
++
++ dev_info(&pdev->dev, "Core Voltage : %d mV\n",
++ dcdc_r8(DCDC_BIAS_VREG1) * 8);
++
++ return 0;
++}
++
++static const struct of_device_id dcdc_match[] = {
++ { .compatible = "lantiq,dcdc-xrx200" },
++ {},
++};
++
++static struct platform_driver dcdc_driver = {
++ .probe = dcdc_probe,
++ .driver = {
++ .name = "dcdc-xrx200",
++ .owner = THIS_MODULE,
++ .of_match_table = dcdc_match,
++ },
++};
++
++int __init dcdc_init(void)
++{
++ int ret = platform_driver_register(&dcdc_driver);
++
++ if (ret)
++ pr_info("dcdc: Error registering platform driver\n");
++ return ret;
++}
++
++arch_initcall(dcdc_init);
+--
+1.7.10.4
+