mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 04:01:48 -04:00
ARM: soc: late platform updates
This branch contains updates to OMAP and Marvell platforms (kirkwood,
dove, mvebu) that came in after we had done the big multiplatform merges,
so they were kept separate from the rest, and not separated into the
traditional topics of cleanup/driver/platform features.
For OMAP, the updates are:
- Runtime PM conversions for the GPMC and RNG IP blocks
- Preparation patches for the OMAP common clock framework conversion
- clkdev alias additions required by other drivers
- Performance Monitoring Unit (PMU) support for OMAP2, 3, and non-4430 OMAP4
- OMAP hwmod code and data improvements
- Preparation patches for the IOMMU runtime PM conversion
- Preparation patches for OMAP4 full-chip retention support
For Kirkwood/Dove/mvebu:
- New driver for "address decoder controller" for mvebu, which
is a piece of hardware that configures addressable devices and
peripherals. First user is the boot rom aperture on armada XP since
it is needed for SMP support.
- New device tree bindings for peripherals such as gpio-fan, iconnect
nand, mv_cesa and the above address decoder controller.
- Some defconfig updates, mostly to enable new DT boards and a few drivers.
- New drivers using the pincontrol subsystem for dove, kirkwood and mvebu
- New clean gpio driver for mvebu
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iQIcBAABAgAGBQJQblIiAAoJEIwa5zzehBx3J1EP/1pxMqjVKQDXxak+A6g8a7r0
hUTjqfiA9nZ4st+nk3PKJL9DNkoTEoZZqXghYRA+N6ej4hAaFJX1izgQDtjtjfRE
s2izZuxGka8Oiic6FpCUoQnMORg10tSLgyvlHNW4hXy3qpe2C4u1D2GJwA/GPeLQ
lHREekcJ3RKWutpG2hMtCT+9Bm4AwnnMY5uO39gxoXeMn6RoaACNIyYxz0NeL5bV
GDuawi7Pc4KJTXX+D/VU0o7VtksiUO8YBczFEra/9khSL/RI2PFalIX3DKiioqvA
yUA11d9proqojIdfdjVRPBHnIMl49H8ohBwbQfKnkNz9msl1BKN5PbakKls97mQ+
vaJpoACnc/3x4P/izEpwry5XqeIl5S5mwz4R4+fojpWpp4JPcly/cAKMAsXf5WRi
NF50E4D/8ysHE8WuBU5YHFgEEbn3nXkRbNMgdYtUwzixdmNJNaU8+33BJo34c4j0
DNktiEdKUBoiiEdsC1MgH86olD/sFNUxvXBub30hhOywoapgQE61fGQGxG38DV/K
kspTHz9SKUrmgbYEyMNOhz4paRrheYxx9cAgKP7Hp7m4Gu8d6ZqRqLqN9hbAbLuW
TbH2FpqcjSw4KnYYCepTixJ3dhGiICiILWHfsW3qCj5Le3YVwedCpBCL1/I+RqEP
kYTToVhur/T1yamHAmBi
=xVaJ
-----END PGP SIGNATURE-----
Merge tag 'soc-late' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull late ARM soc platform updates from Olof Johansson:
"This branch contains updates to OMAP and Marvell platforms (kirkwood,
dove, mvebu) that came in after we had done the big multiplatform
merges, so they were kept separate from the rest, and not separated
into the traditional topics of cleanup/driver/platform features.
For OMAP, the updates are:
- Runtime PM conversions for the GPMC and RNG IP blocks
- Preparation patches for the OMAP common clock framework conversion
- clkdev alias additions required by other drivers
- Performance Monitoring Unit (PMU) support for OMAP2, 3, and
non-4430 OMAP4
- OMAP hwmod code and data improvements
- Preparation patches for the IOMMU runtime PM conversion
- Preparation patches for OMAP4 full-chip retention support
For Kirkwood/Dove/mvebu:
- New driver for "address decoder controller" for mvebu, which is a
piece of hardware that configures addressable devices and
peripherals. First user is the boot rom aperture on armada XP
since it is needed for SMP support.
- New device tree bindings for peripherals such as gpio-fan, iconnect
nand, mv_cesa and the above address decoder controller.
- Some defconfig updates, mostly to enable new DT boards and a few
drivers.
- New drivers using the pincontrol subsystem for dove, kirkwood and
mvebu
- New clean gpio driver for mvebu"
* tag 'soc-late' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (98 commits)
ARM: mvebu: fix build breaks from multi-platform conversion
ARM: OMAP4460/4470: PMU: Enable PMU for OMAP4460/70
ARM: OMAP2+: PMU: Add runtime PM support
ARM: OMAP4430: PMU: prepare to create PMU device via HWMOD
ARM: OMAP2+: PMU: Convert OMAP2/3 devices to use HWMOD
ARM: OMAP3: hwmod data: Add debugss HWMOD data
ARM: OMAP2+: clockdomain/hwmod: add workaround for EMU clockdomain idle problems
ARM: OMAP: Add a timer attribute for timers that can interrupt the DSP
hwrng: OMAP: remove SoC restrictions from driver registration
ARM: OMAP: split OMAP1, OMAP2+ RNG device registration
hwrng: OMAP: convert to use runtime PM
hwrng: OMAP: store per-device data in per-device variables, not file statics
ARM: OMAP2xxx: hwmod/CM: add RNG integration data
ARM: OMAP2+: gpmc: minimal driver support
ARM: OMAP2+: gpmc: Adapt to HWMOD
ARM: OMAP2/3: hwmod data: add gpmc
ARM: OMAP4: hwmod data: add mmu hwmod for ipu and dsp
ARM: OMAP3: hwmod data: add mmu data for iva and isp
ARM: OMAP: iommu: fix including iommu.h without IOMMU_API selected
ARM: OMAP4: hwmod data: add missing HWMOD_NO_IDLEST flags to some PRCM IP blocks
...
This commit is contained in:
commit
5e090ed7af
150 changed files with 8269 additions and 885 deletions
|
|
@ -31,6 +31,8 @@
|
|||
#include <linux/hwmon.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/gpio-fan.h>
|
||||
#include <linux/of_platform.h>
|
||||
#include <linux/of_gpio.h>
|
||||
|
||||
struct gpio_fan_data {
|
||||
struct platform_device *pdev;
|
||||
|
|
@ -400,14 +402,131 @@ static ssize_t show_name(struct device *dev,
|
|||
|
||||
static DEVICE_ATTR(name, S_IRUGO, show_name, NULL);
|
||||
|
||||
|
||||
#ifdef CONFIG_OF_GPIO
|
||||
/*
|
||||
* Translate OpenFirmware node properties into platform_data
|
||||
*/
|
||||
static int gpio_fan_get_of_pdata(struct device *dev,
|
||||
struct gpio_fan_platform_data *pdata)
|
||||
{
|
||||
struct device_node *node;
|
||||
struct gpio_fan_speed *speed;
|
||||
unsigned *ctrl;
|
||||
unsigned i;
|
||||
u32 u;
|
||||
struct property *prop;
|
||||
const __be32 *p;
|
||||
|
||||
node = dev->of_node;
|
||||
|
||||
/* Fill GPIO pin array */
|
||||
pdata->num_ctrl = of_gpio_count(node);
|
||||
if (!pdata->num_ctrl) {
|
||||
dev_err(dev, "gpios DT property empty / missing");
|
||||
return -ENODEV;
|
||||
}
|
||||
ctrl = devm_kzalloc(dev, pdata->num_ctrl * sizeof(unsigned),
|
||||
GFP_KERNEL);
|
||||
if (!ctrl)
|
||||
return -ENOMEM;
|
||||
for (i = 0; i < pdata->num_ctrl; i++) {
|
||||
int val;
|
||||
|
||||
val = of_get_gpio(node, i);
|
||||
if (val < 0)
|
||||
return val;
|
||||
ctrl[i] = val;
|
||||
}
|
||||
pdata->ctrl = ctrl;
|
||||
|
||||
/* Get number of RPM/ctrl_val pairs in speed map */
|
||||
prop = of_find_property(node, "gpio-fan,speed-map", &i);
|
||||
if (!prop) {
|
||||
dev_err(dev, "gpio-fan,speed-map DT property missing");
|
||||
return -ENODEV;
|
||||
}
|
||||
i = i / sizeof(u32);
|
||||
if (i == 0 || i & 1) {
|
||||
dev_err(dev, "gpio-fan,speed-map contains zero/odd number of entries");
|
||||
return -ENODEV;
|
||||
}
|
||||
pdata->num_speed = i / 2;
|
||||
|
||||
/*
|
||||
* Populate speed map
|
||||
* Speed map is in the form <RPM ctrl_val RPM ctrl_val ...>
|
||||
* this needs splitting into pairs to create gpio_fan_speed structs
|
||||
*/
|
||||
speed = devm_kzalloc(dev,
|
||||
pdata->num_speed * sizeof(struct gpio_fan_speed),
|
||||
GFP_KERNEL);
|
||||
if (!speed)
|
||||
return -ENOMEM;
|
||||
p = NULL;
|
||||
for (i = 0; i < pdata->num_speed; i++) {
|
||||
p = of_prop_next_u32(prop, p, &u);
|
||||
if (!p)
|
||||
return -ENODEV;
|
||||
speed[i].rpm = u;
|
||||
p = of_prop_next_u32(prop, p, &u);
|
||||
if (!p)
|
||||
return -ENODEV;
|
||||
speed[i].ctrl_val = u;
|
||||
}
|
||||
pdata->speed = speed;
|
||||
|
||||
/* Alarm GPIO if one exists */
|
||||
if (of_gpio_named_count(node, "alarm-gpios")) {
|
||||
struct gpio_fan_alarm *alarm;
|
||||
int val;
|
||||
enum of_gpio_flags flags;
|
||||
|
||||
alarm = devm_kzalloc(dev, sizeof(struct gpio_fan_alarm),
|
||||
GFP_KERNEL);
|
||||
if (!alarm)
|
||||
return -ENOMEM;
|
||||
|
||||
val = of_get_named_gpio_flags(node, "alarm-gpios", 0, &flags);
|
||||
if (val < 0)
|
||||
return val;
|
||||
alarm->gpio = val;
|
||||
alarm->active_low = flags & OF_GPIO_ACTIVE_LOW;
|
||||
|
||||
pdata->alarm = alarm;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct of_device_id of_gpio_fan_match[] __devinitdata = {
|
||||
{ .compatible = "gpio-fan", },
|
||||
{},
|
||||
};
|
||||
#endif /* CONFIG_OF_GPIO */
|
||||
|
||||
static int __devinit gpio_fan_probe(struct platform_device *pdev)
|
||||
{
|
||||
int err;
|
||||
struct gpio_fan_data *fan_data;
|
||||
struct gpio_fan_platform_data *pdata = pdev->dev.platform_data;
|
||||
|
||||
#ifdef CONFIG_OF_GPIO
|
||||
if (!pdata) {
|
||||
pdata = devm_kzalloc(&pdev->dev,
|
||||
sizeof(struct gpio_fan_platform_data),
|
||||
GFP_KERNEL);
|
||||
if (!pdata)
|
||||
return -ENOMEM;
|
||||
|
||||
err = gpio_fan_get_of_pdata(&pdev->dev, pdata);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
#else /* CONFIG_OF_GPIO */
|
||||
if (!pdata)
|
||||
return -EINVAL;
|
||||
#endif /* CONFIG_OF_GPIO */
|
||||
|
||||
fan_data = devm_kzalloc(&pdev->dev, sizeof(struct gpio_fan_data),
|
||||
GFP_KERNEL);
|
||||
|
|
@ -511,6 +630,7 @@ static struct platform_driver gpio_fan_driver = {
|
|||
.driver = {
|
||||
.name = "gpio-fan",
|
||||
.pm = GPIO_FAN_PM,
|
||||
.of_match_table = of_match_ptr(of_gpio_fan_match),
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue