From: "Ying-Chun Liu (PaulLiu)" <paul.liu(a)linaro.org>
Anatop is a mfd chip embedded in Freescale i.MX6Q SoC.
Anatop provides regulators and thermal.
This driver handles the address space and the operation of the mfd device.
Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu(a)linaro.org>
Acked-by: Shawn Guo <shawn.guo(a)linaro.org>
Cc: Samuel Ortiz <sameo(a)linux.intel.com>
Cc: Mark Brown <broonie(a)opensource.wolfsonmicro.com>
Cc: Venu Byravarasu <vbyravarasu(a)nvidia.com>
Cc: Peter Korsgaard <jacmet(a)sunsite.dk>
---
drivers/mfd/Kconfig | 8 +++
drivers/mfd/Makefile | 1 +
drivers/mfd/anatop-mfd.c | 142 ++++++++++++++++++++++++++++++++++++++++++++
include/linux/mfd/anatop.h | 40 ++++++++++++
4 files changed, 191 insertions(+), 0 deletions(-)
create mode 100644 drivers/mfd/anatop-mfd.c
create mode 100644 include/linux/mfd/anatop.h
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index f147395..f7e2f61 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -830,6 +830,14 @@ config MFD_INTEL_MSIC
Passage) chip. This chip embeds audio, battery, GPIO, etc.
devices used in Intel Medfield platforms.
+config MFD_ANATOP
+ bool "Support for Freescale i.MX on-chip ANATOP controller"
+ depends on SOC_IMX6Q
+ help
+ Select this option to enable Freescale i.MX on-chip ANATOP
+ MFD controller. This controller embeds regulator and
+ thermal devices for Freescale i.MX platforms.
+
endmenu
endif
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index b953bab..8e11060 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -112,3 +112,4 @@ obj-$(CONFIG_TPS65911_COMPARATOR) += tps65911-comparator.o
obj-$(CONFIG_MFD_AAT2870_CORE) += aat2870-core.o
obj-$(CONFIG_MFD_INTEL_MSIC) += intel_msic.o
obj-$(CONFIG_MFD_S5M_CORE) += s5m-core.o s5m-irq.o
+obj-$(CONFIG_MFD_ANATOP) += anatop-mfd.o
diff --git a/drivers/mfd/anatop-mfd.c b/drivers/mfd/anatop-mfd.c
new file mode 100644
index 0000000..d9bc63c
--- /dev/null
+++ b/drivers/mfd/anatop-mfd.c
@@ -0,0 +1,142 @@
+/*
+ * Anatop MFD driver
+ *
+ * Copyright (C) 2012 Ying-Chun Liu (PaulLiu) <paul.liu(a)linaro.org>
+ * Copyright (C) 2012 Linaro
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ */
+
+#include <linux/io.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/of.h>
+#include <linux/of_platform.h>
+#include <linux/of_address.h>
+#include <linux/mfd/anatop.h>
+
+u32 anatop_get_bits(struct anatop *adata, u32 addr, int bit_shift,
+ int bit_width)
+{
+ u32 val, mask;
+
+ if (bit_width == 32)
+ mask = ~0;
+ else
+ mask = (1 << bit_width) - 1;
+
+ val = readl(adata->ioreg + addr);
+ val = (val >> bit_shift) & mask;
+
+ return val;
+}
+EXPORT_SYMBOL(anatop_get_bits);
+
+void anatop_set_bits(struct anatop *adata, u32 addr, int bit_shift,
+ int bit_width, u32 data)
+{
+ u32 val, mask;
+
+ if (bit_width == 32)
+ mask = ~0;
+ else
+ mask = (1 << bit_width) - 1;
+
+ spin_lock(&adata->reglock);
+ val = readl(adata->ioreg + addr) & ~(mask << bit_shift);
+ writel((data << bit_shift) | val, adata->ioreg);
+ spin_unlock(&adata->reglock);
+}
+EXPORT_SYMBOL(anatop_set_bits);
+
+static const struct of_device_id of_anatop_subdevice_match[] = {
+ { .compatible = "fsl,anatop-regulator", },
+ { .compatible = "fsl,anatop-thermal", },
+ { },
+};
+
+static int __devinit of_anatop_probe(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+ struct device_node *np = dev->of_node;
+ void *ioreg;
+ struct anatop *drvdata;
+
+ ioreg = of_iomap(np, 0);
+ if (!ioreg)
+ return -EADDRNOTAVAIL;
+ drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL);
+ if (!drvdata)
+ return -ENOMEM;
+ drvdata->ioreg = ioreg;
+ spin_lock_init(&drvdata->reglock);
+ platform_set_drvdata(pdev, drvdata);
+ of_platform_bus_probe(np, of_anatop_subdevice_match, dev);
+
+ return 0;
+}
+
+static int __devexit of_anatop_remove(struct platform_device *pdev)
+{
+ struct anatop *drvdata;
+ drvdata = platform_get_drvdata(pdev);
+ iounmap(drvdata->ioreg);
+ return 0;
+}
+
+static const struct of_device_id of_anatop_match[] = {
+ { .compatible = "fsl,imx6q-anatop", },
+ { },
+};
+
+static struct platform_driver anatop_of_driver = {
+ .driver = {
+ .name = "anatop-mfd",
+ .owner = THIS_MODULE,
+ .of_match_table = of_anatop_match,
+ },
+ .probe = of_anatop_probe,
+ .remove = of_anatop_remove,
+};
+
+static int __init anatop_init(void)
+{
+ return platform_driver_register(&anatop_of_driver);
+}
+postcore_initcall(anatop_init);
+
+static void __exit anatop_exit(void)
+{
+ platform_driver_unregister(&anatop_of_driver);
+}
+module_exit(anatop_exit);
+
+MODULE_AUTHOR("Ying-Chun Liu (PaulLiu) <paul.liu(a)linaro.org>");
+MODULE_DESCRIPTION("ANATOP MFD driver");
+MODULE_LICENSE("GPL v2");
diff --git a/include/linux/mfd/anatop.h b/include/linux/mfd/anatop.h
new file mode 100644
index 0000000..22c1007
--- /dev/null
+++ b/include/linux/mfd/anatop.h
@@ -0,0 +1,40 @@
+/*
+ * anatop.h - Anatop MFD driver
+ *
+ * Copyright (C) 2012 Ying-Chun Liu (PaulLiu) <paul.liu(a)linaro.org>
+ * Copyright (C) 2012 Linaro
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __LINUX_MFD_ANATOP_H
+#define __LINUX_MFD_ANATOP_H
+
+#include <linux/spinlock.h>
+
+/**
+ * anatop - MFD data
+ * @ioreg: ioremap register
+ * @reglock: spinlock for register read/write
+ */
+struct anatop {
+ void *ioreg;
+ spinlock_t reglock;
+};
+
+extern u32 anatop_get_bits(struct anatop *, u32, int, int);
+extern void anatop_set_bits(struct anatop *, u32, int, int, u32);
+
+#endif /* __LINUX_MFD_ANATOP_H */
--
1.7.9.1
From: "Ying-Chun Liu (PaulLiu)" <paul.liu(a)linaro.org>
Hi all,
This is the Anatop regulator used by Freescale i.MX6 SoC.
Please take a look and give me some comments.
Many Thanks,
Paul
Ying-Chun Liu (PaulLiu) (1):
Regulator: Add Anatop regulator driver
drivers/regulator/Kconfig | 7 +
drivers/regulator/Makefile | 1 +
drivers/regulator/anatop-regulator.c | 236 ++++++++++++++++++++++++++++
include/linux/regulator/anatop-regulator.h | 82 ++++++++++
4 files changed, 326 insertions(+), 0 deletions(-)
create mode 100644 drivers/regulator/anatop-regulator.c
create mode 100644 include/linux/regulator/anatop-regulator.h
--
1.7.7.3
Hi Mark,
Here is a consolidated series which adds DT support for twl regulator
driver and adds support for VDD1/2/3 regulator and support for
fixed LDO V1V8 and V2V1. The patches are based on -next and tested
on omap3 beagle and omap4 panda boards.
I have dropped the patch updating the dts entries for twl4030 and
twl6030 because of other dependencies and will submit them via
the OMAP tree. The driver DT changes however do not have any dependency
on the dts file updates (except that regulator support will not work with DT,
but will not break DT build or boot) and no functionality would change
in the non-DT case.
regards,
Rajendra
Peter Ujfalusi (2):
regulator: twl-regulator: Add fixed LDO for V1V8, V2V1 supply
MFD: twl-core: regulator configuration for twl6030 V1V8, V2V1 SMPS
Rajendra Nayak (1):
regulator: twl: adapt twl-regulator driver to dt
Tero Kristo (1):
regulator: twl6030: add support for vdd1, vdd2 and vdd3 regulators
.../bindings/regulator/twl-regulator.txt | 68 +++++
drivers/mfd/twl-core.c | 25 ++
drivers/regulator/twl-regulator.c | 294 ++++++++++++++------
include/linux/i2c/twl.h | 7 +-
4 files changed, 309 insertions(+), 85 deletions(-)
create mode 100644 Documentation/devicetree/bindings/regulator/twl-regulator.txt
Hello,
Together with Fix Friday and Ubuntu Global Jam, Linaro will be also
having the the ARM Porting Jam today, to help addressing the current
issues on Ubuntu related with the ARM port.
If you're interested on helping fixing FTBFS issues and other porting
bugs related with ARM, please check the details at
http://rsalveti.wordpress.com/2012/03/02/arm-porting-jam-this-friday/
and join us at #linaro/#ubuntu-motu at freenode today!
Thanks!
--
Ricardo Salveti de Araujo
Forwarding Ubuntu Precise Beta 1 announcement:
[...]
This release introduces a new set of images for the ARMv7 "hard float"
ABI, denoted as armhf. There are still some armel images around, as
we finish the migration, but 12.04 for ARM will be based on armhf.
[...]
Ubuntu Core
-----------
Ubuntu Core is a minimal rootfs for use in the creation of custom images,
and now includes ARM hard float (armhf) images. Developers can use
Ubuntu Core as the basis for their application demonstrations, constrained
environment deployments, device support packages, and other goals.
[...]
Full announcement available on
https://lists.ubuntu.com/archives/ubuntu-release/2012-March/000899.html
Hi -
I have a problem with DT during fairly early boot on OMAP5 / 3.3-rc5 I'm
hoping someone has met before.
The problem is setup_machine_fdt() is working correctly and selecting
the compatible machine, and we start to boot, with a stub dtb, which is
all good.
However by the time we reach unflatten_device_tree(), the virtual
mapping that it saved on to the dt blob is no longer present and we die
if we try to touch the virtual region it used before.
Some actual numbers, it copies the DT blob from U-Boot to phys
0xfef14000, and during setup_machine_fdt() it can walk it using virt
0x3ef14000.
However when it tries to dereference virt 0x3ef14000 later, in
unflatten_device_tree(), it dies immediately.
Inbetweentimes, the main virtual memory stuff has initialized, I guess
whatever mapping it had is nuked.
What is the correct approach for keeping the earlier dtb mapping around
long enough so it can be unflattened? This used to work on Omap4 DT
without problems so I guess we're missing a trick.
-Andy
--
Andy Green | TI Landing Team Leader
Linaro.org │ Open source software for ARM SoCs | Follow Linaro
http://facebook.com/pages/Linaro/155974581091106 -
http://twitter.com/#!/linaroorg - http://linaro.org/linaro-blog
Hello,
(Pardon if this is out-of-scope for linaro-dev mailing list )
Is there anybody trying to get Linaro to run on "cheap" AuraSlate (http://www.auraslate.com/) tablet? If you are would be nice to collaborate...
This is the only affordable ARM tablet that I have found with bootrom so I am trying to figure out how one gets started running Linaro on brand new hardware... Any specific page I should look at on https://wiki.linaro.org?
Regards,
-Subodh Nijsure
(NOT affiliated with AuraSlate in any way)