Commit b25c4607 authored by Olof Johansson's avatar Olof Johansson

Merge tag 'cleanup-fixes-for-v3.7' of...

Merge tag 'cleanup-fixes-for-v3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/cleanup

From Tony Lindgren:

These fixes are needed to fix non-omap build breakage for
twl-core driver and to fix omap1_defconfig compile when
led driver changes and omap sparse IRQ changes are merged
together. Also fix warnings for omaps not using pinctrl
framework yet.

* tag 'cleanup-fixes-for-v3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  ARM: OMAP1: Include gpio-omap.h for board-h2 and board-h3
  ARM: OMAP2+: Enable pinctrl dummy states
  mfd: Fix compile for twl-core.c by removing cpu_is_omap usage
parents 3a839ce4 de6ca33a
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <linux/i2c/tps65010.h> #include <linux/i2c/tps65010.h>
#include <linux/smc91x.h> #include <linux/smc91x.h>
#include <linux/omapfb.h> #include <linux/omapfb.h>
#include <linux/platform_data/gpio-omap.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <linux/i2c/tps65010.h> #include <linux/i2c/tps65010.h>
#include <linux/smc91x.h> #include <linux/smc91x.h>
#include <linux/omapfb.h> #include <linux/omapfb.h>
#include <linux/platform_data/gpio-omap.h>
#include <asm/setup.h> #include <asm/setup.h>
#include <asm/page.h> #include <asm/page.h>
......
...@@ -1856,6 +1856,7 @@ static struct omap_clk omap2430_clks[] = { ...@@ -1856,6 +1856,7 @@ static struct omap_clk omap2430_clks[] = {
CLK(NULL, "func_32k_ck", &func_32k_ck, CK_243X), CLK(NULL, "func_32k_ck", &func_32k_ck, CK_243X),
CLK(NULL, "secure_32k_ck", &secure_32k_ck, CK_243X), CLK(NULL, "secure_32k_ck", &secure_32k_ck, CK_243X),
CLK(NULL, "osc_ck", &osc_ck, CK_243X), CLK(NULL, "osc_ck", &osc_ck, CK_243X),
CLK("twl", "fck", &osc_ck, CK_243X),
CLK(NULL, "sys_ck", &sys_ck, CK_243X), CLK(NULL, "sys_ck", &sys_ck, CK_243X),
CLK(NULL, "alt_ck", &alt_ck, CK_243X), CLK(NULL, "alt_ck", &alt_ck, CK_243X),
CLK(NULL, "mcbsp_clks", &mcbsp_clks, CK_243X), CLK(NULL, "mcbsp_clks", &mcbsp_clks, CK_243X),
......
...@@ -3226,6 +3226,7 @@ static struct omap_clk omap3xxx_clks[] = { ...@@ -3226,6 +3226,7 @@ static struct omap_clk omap3xxx_clks[] = {
CLK(NULL, "virt_26000000_ck", &virt_26000000_ck, CK_3XXX), CLK(NULL, "virt_26000000_ck", &virt_26000000_ck, CK_3XXX),
CLK(NULL, "virt_38_4m_ck", &virt_38_4m_ck, CK_3XXX), CLK(NULL, "virt_38_4m_ck", &virt_38_4m_ck, CK_3XXX),
CLK(NULL, "osc_sys_ck", &osc_sys_ck, CK_3XXX), CLK(NULL, "osc_sys_ck", &osc_sys_ck, CK_3XXX),
CLK("twl", "fck", &osc_sys_ck, CK_3XXX),
CLK(NULL, "sys_ck", &sys_ck, CK_3XXX), CLK(NULL, "sys_ck", &sys_ck, CK_3XXX),
CLK(NULL, "sys_altclk", &sys_altclk, CK_3XXX), CLK(NULL, "sys_altclk", &sys_altclk, CK_3XXX),
CLK(NULL, "mcbsp_clks", &mcbsp_clks, CK_3XXX), CLK(NULL, "mcbsp_clks", &mcbsp_clks, CK_3XXX),
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <linux/err.h> #include <linux/err.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/pinctrl/machine.h>
#include <linux/platform_data/omap4-keypad.h> #include <linux/platform_data/omap4-keypad.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
...@@ -627,6 +628,10 @@ static inline void omap_init_vout(void) {} ...@@ -627,6 +628,10 @@ static inline void omap_init_vout(void) {}
static int __init omap2_init_devices(void) static int __init omap2_init_devices(void)
{ {
/* Enable dummy states for those platforms without pinctrl support */
if (!of_have_populated_dt())
pinctrl_provide_dummies();
/* /*
* please keep these calls, and their implementations above, * please keep these calls, and their implementations above,
* in alphabetical order so they're easier to sort through. * in alphabetical order so they're easier to sort through.
......
...@@ -46,8 +46,6 @@ ...@@ -46,8 +46,6 @@
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/i2c/twl.h> #include <linux/i2c/twl.h>
#include <plat/cpu.h>
#include "twl-core.h" #include "twl-core.h"
/* /*
...@@ -1134,12 +1132,7 @@ static void clocks_init(struct device *dev, ...@@ -1134,12 +1132,7 @@ static void clocks_init(struct device *dev,
u32 rate; u32 rate;
u8 ctrl = HFCLK_FREQ_26_MHZ; u8 ctrl = HFCLK_FREQ_26_MHZ;
#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) osc = clk_get(dev, "fck");
if (cpu_is_omap2430())
osc = clk_get(dev, "osc_ck");
else
osc = clk_get(dev, "osc_sys_ck");
if (IS_ERR(osc)) { if (IS_ERR(osc)) {
printk(KERN_WARNING "Skipping twl internal clock init and " printk(KERN_WARNING "Skipping twl internal clock init and "
"using bootloader value (unknown osc rate)\n"); "using bootloader value (unknown osc rate)\n");
...@@ -1149,18 +1142,6 @@ static void clocks_init(struct device *dev, ...@@ -1149,18 +1142,6 @@ static void clocks_init(struct device *dev,
rate = clk_get_rate(osc); rate = clk_get_rate(osc);
clk_put(osc); clk_put(osc);
#else
/* REVISIT for non-OMAP systems, pass the clock rate from
* board init code, using platform_data.
*/
osc = ERR_PTR(-EIO);
printk(KERN_WARNING "Skipping twl internal clock init and "
"using bootloader value (unknown osc rate)\n");
return;
#endif
switch (rate) { switch (rate) {
case 19200000: case 19200000:
ctrl = HFCLK_FREQ_19p2_MHZ; ctrl = HFCLK_FREQ_19p2_MHZ;
...@@ -1222,10 +1203,23 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id) ...@@ -1222,10 +1203,23 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id)
{ {
struct twl4030_platform_data *pdata = client->dev.platform_data; struct twl4030_platform_data *pdata = client->dev.platform_data;
struct device_node *node = client->dev.of_node; struct device_node *node = client->dev.of_node;
struct platform_device *pdev;
int irq_base = 0; int irq_base = 0;
int status; int status;
unsigned i, num_slaves; unsigned i, num_slaves;
pdev = platform_device_alloc(DRIVER_NAME, -1);
if (!pdev) {
dev_err(&client->dev, "can't alloc pdev\n");
return -ENOMEM;
}
status = platform_device_add(pdev);
if (status) {
platform_device_put(pdev);
return status;
}
if (node && !pdata) { if (node && !pdata) {
/* /*
* XXX: Temporary pdata until the information is correctly * XXX: Temporary pdata until the information is correctly
...@@ -1234,23 +1228,30 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id) ...@@ -1234,23 +1228,30 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id)
pdata = devm_kzalloc(&client->dev, pdata = devm_kzalloc(&client->dev,
sizeof(struct twl4030_platform_data), sizeof(struct twl4030_platform_data),
GFP_KERNEL); GFP_KERNEL);
if (!pdata) if (!pdata) {
return -ENOMEM; status = -ENOMEM;
goto free;
}
} }
if (!pdata) { if (!pdata) {
dev_dbg(&client->dev, "no platform data?\n"); dev_dbg(&client->dev, "no platform data?\n");
return -EINVAL; status = -EINVAL;
goto free;
} }
platform_set_drvdata(pdev, pdata);
if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C) == 0) { if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C) == 0) {
dev_dbg(&client->dev, "can't talk I2C?\n"); dev_dbg(&client->dev, "can't talk I2C?\n");
return -EIO; status = -EIO;
goto free;
} }
if (inuse) { if (inuse) {
dev_dbg(&client->dev, "driver is already in use\n"); dev_dbg(&client->dev, "driver is already in use\n");
return -EBUSY; status = -EBUSY;
goto free;
} }
if ((id->driver_data) & TWL6030_CLASS) { if ((id->driver_data) & TWL6030_CLASS) {
...@@ -1285,7 +1286,7 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id) ...@@ -1285,7 +1286,7 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id)
inuse = true; inuse = true;
/* setup clock framework */ /* setup clock framework */
clocks_init(&client->dev, pdata->clock); clocks_init(&pdev->dev, pdata->clock);
/* read TWL IDCODE Register */ /* read TWL IDCODE Register */
if (twl_id == TWL4030_CLASS_ID) { if (twl_id == TWL4030_CLASS_ID) {
...@@ -1335,6 +1336,9 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id) ...@@ -1335,6 +1336,9 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id)
fail: fail:
if (status < 0) if (status < 0)
twl_remove(client); twl_remove(client);
free:
if (status < 0)
platform_device_unregister(pdev);
return status; return status;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment