Re: [PATCH] ARM: dts: N900: GPIO key definitions
On Tue 2013-10-22 14:49:38, Sebastian Reichel wrote: > Add device tree node for the GPIO keys provided by the > N900 board. This is a simple conversion of the existing > board code. > > Signed-off-by: Sebastian Reichel Reviewed-by: Pavel Machek -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCHv2 1/3] Input: twl4030-keypad - add device tree support
Hi! > Add device tree support for twl4030 keypad driver and update the > Documentation with twl4030 keypad device tree binding information. > > Tested on Nokia N900. It looks pretty good. > +++ b/Documentation/devicetree/bindings/input/twl4030-keypad.txt > @@ -0,0 +1,31 @@ > +* TWL4030's Keypad Controller device tree bindings > + > +TWL4030's Keypad controller is used to interface a SoC with a matrix-type > +keypad device. The keypad controller supports multiple row and column lines. > +A key can be placed at each intersection of a unique row and a unique column. > +The keypad controller can sense a key-press and key-release and report the > +event using a interrupt to the cpu. > + > +This binding is based on the matrix-keymap binding with the following > +changes: > + > + * keypad,num-rows and keypad,num-columns are required. Is "keypad," prefix neccessary here? > +Optional Properties specific to linux: > +- linux,keypad-no-autorepeat: do no enable autorepeat feature. "do not autorepeat". Plus I do not see what is Linux specifc about not autorepeating... Other systems will likely know about autorepeat, too. > @@ -324,6 +326,31 @@ static int twl4030_kp_program(struct twl4030_keypad *kp) > return 0; > } > > +#if IS_ENABLED(CONFIG_OF) I'm probably missing something here, but why not #ifdef CONFIG_OF? > @@ -381,7 +426,7 @@ static int twl4030_kp_probe(struct platform_device *pdev) > > input_set_capability(input, EV_MSC, MSC_SCAN); > /* Enable auto repeat feature of Linux input subsystem */ > - if (pdata->rep) > + if (!kp->no_autorepeat) > __set_bit(EV_REP, input->evbit); > Double negation is nasty to read. I believe code would be more readable if you switched logic to kp->autorepeat. Thanks, Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] ARM: dts: N900: GPIO key definitions
On Sun, Oct 27, 2013 at 12:17:28PM +0100, Pavel Machek wrote: > On Tue 2013-10-22 14:49:38, Sebastian Reichel wrote: > > Add device tree node for the GPIO keys provided by the > > N900 board. This is a simple conversion of the existing > > board code. > > > > Signed-off-by: Sebastian Reichel > > Reviewed-by: Pavel Machek This patch has already been merged by Benoit. -- Sebastian signature.asc Description: Digital signature
Re: [PATCHv2 1/3] Input: twl4030-keypad - add device tree support
Hi Pavel, On Sun, Oct 27, 2013 at 12:17:15PM +0100, Pavel Machek wrote: > > Add device tree support for twl4030 keypad driver and update the > > Documentation with twl4030 keypad device tree binding information. > > > > Tested on Nokia N900. > > It looks pretty good. Thanks. > > + * keypad,num-rows and keypad,num-columns are required. > Is "keypad," prefix neccessary here? See Documentation/devicetree/bindings/input/matrix-keymap.txt > > +Optional Properties specific to linux: > > +- linux,keypad-no-autorepeat: do no enable autorepeat feature. > > "do not autorepeat". Plus I do not see what is Linux specifc about not > autorepeating... Other systems will likely know about autorepeat, too. This property has already been used like this for samsung-keypad, stmpe-keypad, omap-keypad and gpio-matrix-keypad. > > +#if IS_ENABLED(CONFIG_OF) > I'm probably missing something here, but why not #ifdef CONFIG_OF? I have been told for other drivers, that IS_ENABLED() is the prefered way to check for configuration these days. > > @@ -381,7 +426,7 @@ static int twl4030_kp_probe(struct platform_device > > *pdev) > > > > input_set_capability(input, EV_MSC, MSC_SCAN); > > /* Enable auto repeat feature of Linux input subsystem */ > > - if (pdata->rep) > > + if (!kp->no_autorepeat) > > __set_bit(EV_REP, input->evbit); > > > > Double negation is nasty to read. I believe code would be more > readable if you switched logic to kp->autorepeat. I was thinking about the same when writing it, but decided against it, since it will just move the double negation to the variable initialization. -- Sebastian signature.asc Description: Digital signature
Re: [PATCHv2 1/3] Input: twl4030-keypad - add device tree support
Hi! > > > + * keypad,num-rows and keypad,num-columns are required. > > Is "keypad," prefix neccessary here? > > See Documentation/devicetree/bindings/input/matrix-keymap.txt > > > > +Optional Properties specific to linux: > > > +- linux,keypad-no-autorepeat: do no enable autorepeat feature. > > > > "do not autorepeat". Plus I do not see what is Linux specifc about not > > autorepeating... Other systems will likely know about autorepeat, too. > > This property has already been used like this for > samsung-keypad, stmpe-keypad, omap-keypad and > gpio-matrix-keypad. Ok. But you still have a typo. "do no enable" => "do not enable". > > > +#if IS_ENABLED(CONFIG_OF) > > I'm probably missing something here, but why not #ifdef CONFIG_OF? > > I have been told for other drivers, that IS_ENABLED() is > the prefered way to check for configuration these days. CONFIG_OF can not be module, using IS_ENABLED() on it is just wrong. > > > @@ -381,7 +426,7 @@ static int twl4030_kp_probe(struct platform_device > > > *pdev) > > > > > > input_set_capability(input, EV_MSC, MSC_SCAN); > > > /* Enable auto repeat feature of Linux input subsystem */ > > > - if (pdata->rep) > > > + if (!kp->no_autorepeat) > > > __set_bit(EV_REP, input->evbit); > > > > > > > Double negation is nasty to read. I believe code would be more > > readable if you switched logic to kp->autorepeat. > > I was thinking about the same when writing it, but decided > against it, since it will just move the double negation to > the variable initialization. Well, the property should be linux,keypad-autorepeat in the first place, but it is too late to change that. Thanks, Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCHv2 1/3] Input: twl4030-keypad - add device tree support
* Pavel Machek [131027 04:48]: > > > > > +#if IS_ENABLED(CONFIG_OF) > > > I'm probably missing something here, but why not #ifdef CONFIG_OF? > > > > I have been told for other drivers, that IS_ENABLED() is > > the prefered way to check for configuration these days. > > CONFIG_OF can not be module, using IS_ENABLED() on it is just wrong. Good point. Looks like there's IS_BUILTIN that's for boolean options. Regards, Tony -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/6] ARM: OMAP2+: Remove board-4430sdp.c
Hi Tomi, On Mon, Jul 22, 2013 at 11:40 AM, Tomi Valkeinen wrote: > On 08/07/13 17:21, Russell King - ARM Linux wrote: > >> Also looks like the nonfunctional video stuff is even more nonfunctional >> than usual: >> >> omapdss DSI error: can't get VDDS_DSI regulator >> omapdss HDMI error: can't get VDDA_HDMI_DAC regulator I have the same issue when trying to get VDI output working on a IGEPv2 board. > > Those should be followed by "...requests probe deferral", and the driver > is probed again later. > When booting with DT the omapfb's probe is deferred several times but it always fails on dpi_connect() due not being able to get the VDDS_DSI regulator: [3.186035] OMAPFB: omapfb_probe [3.190704] omapdss DPI error: can't get VDDS_DSI regulator [3.196594] omapfb omapfb: failed to connect default display [3.202667] omapfb omapfb: failed to init overlay connections [3.208892] OMAPFB: free_resources [3.212493] OMAPFB: free all fbmem [3.216735] omapfb omapfb: failed to setup omapfb [3.221832] platform omapfb: Driver omapfb requests probe deferral [3.231689] OMAPFB: omapfb_probe [3.236175] omapdss DPI error: can't get VDDS_DSI regulator [3.242248] omapfb omapfb: failed to connect default display [3.248291] omapfb omapfb: failed to init overlay connections [3.254394] OMAPFB: free_resources [3.258026] OMAPFB: free all fbmem [3.262268] omapfb omapfb: failed to setup omapfb [3.267303] platform omapfb: Driver omapfb requests probe deferral My complete boot log is [1] I tracked down to dpi_init_regulator in drivers/video/omap2/dss/dpi.c static int dpi_init_regulator(void) { vdds_dsi = devm_regulator_get(&dpi.pdev->dev, "vdds_dsi"); if (IS_ERR(vdds_dsi)) { DSSERR("can't get VDDS_DSI regulator\n"); return PTR_ERR(vdds_dsi); } } So I tried adding this to my DT with no luck. diff --git a/arch/arm/boot/dts/omap3-igep0020.dts b/arch/arm/boot/dts/omap3-igep0020.dts index 17a6fc1..eaae935 100644 --- a/arch/arm/boot/dts/omap3-igep0020.dts +++ b/arch/arm/boot/dts/omap3-igep0020.dts @@ -256,3 +256,8 @@ &usbhsehci { phys = <&hsusb1_phy>; }; + +&vpll2 { +supply-dev = "omapdss_dpi.0"; +supply = "vdds_dsi"; +}; Now what you said does indeed happen when booting with the legacy board file. omapfb fails the first time with "can't get VDDS_DSI regulator" but the driver is probed again and it succeeds. I tried to spot a difference but didn't find it... > The log > http://www.arm.linux.org.uk/developer/build/result.php?type=boot&idx=946 > shows "taal display2: panel revision e3.83.7d" which hints that the > panel (and DSS) was initialized properly. > > Those error prints should probably be tuned down a bit now that the > driver uses probe deferral. > > Tomi > > fwiw, my wip branch is [2]: Javier Martinez Canillas (3): ARM: dts: omap3-igep0020: Add pinmux setup for i2c devices ARM: dts: omap3-igep0020: Add pinmuxig for DVI output ARM: OMAP: dss-common: change IGEP's DVI DDC i2c bus Any hints will be highly appreciated. Thanks a lot and best regards, Javier [1]: http://fpaste.org/49736/79384138/raw/ [2]: https://github.com/martinezjavier/linux/commits/igep-video-wip -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/4] wl1251: split wl251 platform data to a separate structure
From: Luciano Coelho Move the wl1251 part of the wl12xx platform data structure into a new structure specifically for wl1251. Change the platform data built-in block and board files accordingly. Cc: Tony Lindgren Signed-off-by: Luciano Coelho Acked-by: Tony Lindgren Reviewed-by: Felipe Balbi --- arch/arm/mach-omap2/board-omap3pandora.c | 4 +-- arch/arm/mach-omap2/board-rx51-peripherals.c | 2 +- drivers/net/wireless/ti/wilink_platform_data.c | 37 +- drivers/net/wireless/ti/wl1251/sdio.c | 12 - drivers/net/wireless/ti/wl1251/spi.c | 2 +- include/linux/wl12xx.h | 22 ++- 6 files changed, 62 insertions(+), 17 deletions(-) diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c index de1bc6b..24f3c1b 100644 --- a/arch/arm/mach-omap2/board-omap3pandora.c +++ b/arch/arm/mach-omap2/board-omap3pandora.c @@ -536,7 +536,7 @@ static struct spi_board_info omap3pandora_spi_board_info[] __initdata = { static void __init pandora_wl1251_init(void) { - struct wl12xx_platform_data pandora_wl1251_pdata; + struct wl1251_platform_data pandora_wl1251_pdata; int ret; memset(&pandora_wl1251_pdata, 0, sizeof(pandora_wl1251_pdata)); @@ -550,7 +550,7 @@ static void __init pandora_wl1251_init(void) goto fail_irq; pandora_wl1251_pdata.use_eeprom = true; - ret = wl12xx_set_platform_data(&pandora_wl1251_pdata); + ret = wl1251_set_platform_data(&pandora_wl1251_pdata); if (ret < 0) goto fail_irq; diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c index 65e3627..0d8e7d2 100644 --- a/arch/arm/mach-omap2/board-rx51-peripherals.c +++ b/arch/arm/mach-omap2/board-rx51-peripherals.c @@ -82,7 +82,7 @@ enum { RX51_SPI_MIPID, /* LCD panel */ }; -static struct wl12xx_platform_data wl1251_pdata; +static struct wl1251_platform_data wl1251_pdata; static struct tsc2005_platform_data tsc2005_pdata; #if defined(CONFIG_SENSORS_LIS3_I2C) || defined(CONFIG_SENSORS_LIS3_I2C_MODULE) diff --git a/drivers/net/wireless/ti/wilink_platform_data.c b/drivers/net/wireless/ti/wilink_platform_data.c index 998e958..a92bd3e 100644 --- a/drivers/net/wireless/ti/wilink_platform_data.c +++ b/drivers/net/wireless/ti/wilink_platform_data.c @@ -23,17 +23,17 @@ #include #include -static struct wl12xx_platform_data *platform_data; +static struct wl12xx_platform_data *wl12xx_platform_data; int __init wl12xx_set_platform_data(const struct wl12xx_platform_data *data) { - if (platform_data) + if (wl12xx_platform_data) return -EBUSY; if (!data) return -EINVAL; - platform_data = kmemdup(data, sizeof(*data), GFP_KERNEL); - if (!platform_data) + wl12xx_platform_data = kmemdup(data, sizeof(*data), GFP_KERNEL); + if (!wl12xx_platform_data) return -ENOMEM; return 0; @@ -41,9 +41,34 @@ int __init wl12xx_set_platform_data(const struct wl12xx_platform_data *data) struct wl12xx_platform_data *wl12xx_get_platform_data(void) { - if (!platform_data) + if (!wl12xx_platform_data) return ERR_PTR(-ENODEV); - return platform_data; + return wl12xx_platform_data; } EXPORT_SYMBOL(wl12xx_get_platform_data); + +static struct wl1251_platform_data *wl1251_platform_data; + +int __init wl1251_set_platform_data(const struct wl1251_platform_data *data) +{ + if (wl1251_platform_data) + return -EBUSY; + if (!data) + return -EINVAL; + + wl1251_platform_data = kmemdup(data, sizeof(*data), GFP_KERNEL); + if (!wl1251_platform_data) + return -ENOMEM; + + return 0; +} + +struct wl1251_platform_data *wl1251_get_platform_data(void) +{ + if (!wl1251_platform_data) + return ERR_PTR(-ENODEV); + + return wl1251_platform_data; +} +EXPORT_SYMBOL(wl1251_get_platform_data); diff --git a/drivers/net/wireless/ti/wl1251/sdio.c b/drivers/net/wireless/ti/wl1251/sdio.c index e2b3d9c..b75a37a 100644 --- a/drivers/net/wireless/ti/wl1251/sdio.c +++ b/drivers/net/wireless/ti/wl1251/sdio.c @@ -227,7 +227,7 @@ static int wl1251_sdio_probe(struct sdio_func *func, struct wl1251 *wl; struct ieee80211_hw *hw; struct wl1251_sdio *wl_sdio; - const struct wl12xx_platform_data *wl12xx_board_data; + const struct wl1251_platform_data *wl1251_board_data; hw = wl1251_alloc_hw(); if (IS_ERR(hw)) @@ -254,11 +254,11 @@ static int wl1251_sdio_probe(struct sdio_func *func, wl->if_priv = wl_sdio; wl->if_ops = &wl1251_sdio_ops; - wl12xx_board_data = wl12xx_get_platform_data(); - if (!IS_ERR(wl12xx_board_data)) { - wl->set_power = wl12xx_board_data->set_power; - wl->irq
[PATCH 2/4] wl1251: move power GPIO handling into the driver
Move the power GPIO handling from the board code into the driver. This is a dependency for device tree support. Signed-off-by: Sebastian Reichel --- arch/arm/mach-omap2/board-omap3pandora.c | 2 ++ arch/arm/mach-omap2/board-rx51-peripherals.c | 11 ++ drivers/net/wireless/ti/wl1251/sdio.c| 21 +- drivers/net/wireless/ti/wl1251/spi.c | 33 ++-- drivers/net/wireless/ti/wl1251/wl1251.h | 2 +- include/linux/wl12xx.h | 2 +- 6 files changed, 43 insertions(+), 28 deletions(-) diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c index 24f3c1b..cf18340 100644 --- a/arch/arm/mach-omap2/board-omap3pandora.c +++ b/arch/arm/mach-omap2/board-omap3pandora.c @@ -541,6 +541,8 @@ static void __init pandora_wl1251_init(void) memset(&pandora_wl1251_pdata, 0, sizeof(pandora_wl1251_pdata)); + pandora_wl1251_pdata.power_gpio = -1; + ret = gpio_request_one(PANDORA_WIFI_IRQ_GPIO, GPIOF_IN, "wl1251 irq"); if (ret < 0) goto fail; diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c index 0d8e7d2..b9d95dd 100644 --- a/arch/arm/mach-omap2/board-rx51-peripherals.c +++ b/arch/arm/mach-omap2/board-rx51-peripherals.c @@ -1164,13 +1164,7 @@ static inline void board_smc91x_init(void) #endif -static void rx51_wl1251_set_power(bool enable) -{ - gpio_set_value(RX51_WL1251_POWER_GPIO, enable); -} - static struct gpio rx51_wl1251_gpios[] __initdata = { - { RX51_WL1251_POWER_GPIO, GPIOF_OUT_INIT_LOW, "wl1251 power" }, { RX51_WL1251_IRQ_GPIO, GPIOF_IN, "wl1251 irq"}, }; @@ -1187,17 +1181,16 @@ static void __init rx51_init_wl1251(void) if (irq < 0) goto err_irq; - wl1251_pdata.set_power = rx51_wl1251_set_power; + wl1251_pdata.power_gpio = RX51_WL1251_POWER_GPIO; rx51_peripherals_spi_board_info[RX51_SPI_WL1251].irq = irq; return; err_irq: gpio_free(RX51_WL1251_IRQ_GPIO); - gpio_free(RX51_WL1251_POWER_GPIO); error: printk(KERN_ERR "wl1251 board initialisation failed\n"); - wl1251_pdata.set_power = NULL; + wl1251_pdata.power_gpio = -1; /* * Now rx51_peripherals_spi_board_info[1].irq is zero and diff --git a/drivers/net/wireless/ti/wl1251/sdio.c b/drivers/net/wireless/ti/wl1251/sdio.c index b75a37a..b661f89 100644 --- a/drivers/net/wireless/ti/wl1251/sdio.c +++ b/drivers/net/wireless/ti/wl1251/sdio.c @@ -28,6 +28,7 @@ #include #include #include +#include #include "wl1251.h" @@ -182,8 +183,9 @@ static int wl1251_sdio_set_power(struct wl1251 *wl, bool enable) * callback in case it wants to do any additional setup, * for example enabling clock buffer for the module. */ - if (wl->set_power) - wl->set_power(true); + if (gpio_is_valid(wl->power_gpio)) + gpio_set_value(wl->power_gpio, true); + ret = pm_runtime_get_sync(&func->dev); if (ret < 0) { @@ -203,8 +205,8 @@ static int wl1251_sdio_set_power(struct wl1251 *wl, bool enable) if (ret < 0) goto out; - if (wl->set_power) - wl->set_power(false); + if (gpio_is_valid(wl->power_gpio)) + gpio_set_value(wl->power_gpio, false); } out: @@ -256,11 +258,20 @@ static int wl1251_sdio_probe(struct sdio_func *func, wl1251_board_data = wl1251_get_platform_data(); if (!IS_ERR(wl1251_board_data)) { - wl->set_power = wl1251_board_data->set_power; + wl->power_gpio = wl1251_board_data->power_gpio; wl->irq = wl1251_board_data->irq; wl->use_eeprom = wl1251_board_data->use_eeprom; } + if (gpio_is_valid(wl->power_gpio)) { + ret = devm_gpio_request(&func->dev, wl->power_gpio, + "wl1251 power"); + if (ret) { + wl1251_error("Failed to request gpio: %d\n", ret); + goto disable; + } + } + if (wl->irq) { irq_set_status_flags(wl->irq, IRQ_NOAUTOEN); ret = request_irq(wl->irq, wl1251_line_irq, 0, "wl1251", wl); diff --git a/drivers/net/wireless/ti/wl1251/spi.c b/drivers/net/wireless/ti/wl1251/spi.c index 6bbbfe6..9a2df9d 100644 --- a/drivers/net/wireless/ti/wl1251/spi.c +++ b/drivers/net/wireless/ti/wl1251/spi.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "wl1251.h" #include "reg.h" @@ -221,8 +222,8 @@ static void wl1251_spi_disable_irq(struct wl1251 *wl) static int wl1251_spi_set_power(struct wl1251 *wl, bool enable) { -
[PATCH 0/4] wl1251 device tree support
Hi, The following patchset adds device tree support to the spi variant of the wl1251 driver. Some notes: The first patch is from Luciano's wilink DT support patchset [0]. The third patch (vio regulator support) is optional. N900's wifi also worked without this patch, but its probably cleaner to have it. The patchset has been tested using DT boot with the Nokia N900 and connecting to my wlan access point. [0] https://lkml.org/lkml/2013/7/3/333 -- Sebastian Luciano Coelho (1): wl1251: split wl251 platform data to a separate structure Sebastian Reichel (3): wl1251: move power GPIO handling into the driver wl1251: spi: add vio regulator support wl1251: spi: add device tree support .../devicetree/bindings/net/wireless/ti,wl1251.txt | 36 +++ arch/arm/mach-omap2/board-omap3pandora.c | 6 +- arch/arm/mach-omap2/board-rx51-peripherals.c | 15 ++--- drivers/net/wireless/ti/wilink_platform_data.c | 37 +-- drivers/net/wireless/ti/wl1251/sdio.c | 31 +++--- drivers/net/wireless/ti/wl1251/spi.c | 71 -- drivers/net/wireless/ti/wl1251/wl1251.h| 4 +- include/linux/wl12xx.h | 24 +++- 8 files changed, 175 insertions(+), 49 deletions(-) create mode 100644 Documentation/devicetree/bindings/net/wireless/ti,wl1251.txt -- 1.8.4.rc3 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 3/4] wl1251: spi: add vio regulator support
This patch adds support for requesting the regulator powering the vio pin. The patch also adds the regulator for the all boards using the wl1251 in spi mode (only the Nokia N900). Signed-off-by: Sebastian Reichel --- arch/arm/mach-omap2/board-rx51-peripherals.c | 2 ++ drivers/net/wireless/ti/wl1251/spi.c | 19 +-- drivers/net/wireless/ti/wl1251/wl1251.h | 2 ++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c index b9d95dd..a791fef 100644 --- a/arch/arm/mach-omap2/board-rx51-peripherals.c +++ b/arch/arm/mach-omap2/board-rx51-peripherals.c @@ -552,6 +552,8 @@ static struct regulator_consumer_supply rx51_vio_supplies[] = { REGULATOR_SUPPLY("vio", "2-0063"), /* lis3lv02d */ REGULATOR_SUPPLY("Vdd_IO", "3-001d"), + /* wl1251 */ + REGULATOR_SUPPLY("vio", "spi4.0"), }; static struct regulator_consumer_supply rx51_vaux1_consumers[] = { diff --git a/drivers/net/wireless/ti/wl1251/spi.c b/drivers/net/wireless/ti/wl1251/spi.c index 9a2df9d..efea57a 100644 --- a/drivers/net/wireless/ti/wl1251/spi.c +++ b/drivers/net/wireless/ti/wl1251/spi.c @@ -27,6 +27,7 @@ #include #include #include +#include #include "wl1251.h" #include "reg.h" @@ -306,13 +307,26 @@ static int wl1251_spi_probe(struct spi_device *spi) irq_set_irq_type(wl->irq, IRQ_TYPE_EDGE_RISING); - ret = wl1251_init_ieee80211(wl); + wl->vio = devm_regulator_get(&spi->dev, "vio"); + if (IS_ERR(wl->vio)) { + ret = PTR_ERR(wl->vio); + wl1251_error("vio regulator missing: %d", ret); + goto out_free; + } + + ret = regulator_enable(wl->vio); if (ret) goto out_free; + ret = wl1251_init_ieee80211(wl); + if (ret) + goto disable_regulator; + return 0; - out_free: +disable_regulator: + regulator_disable(wl->vio); +out_free: ieee80211_free_hw(hw); return ret; @@ -324,6 +338,7 @@ static int wl1251_spi_remove(struct spi_device *spi) free_irq(wl->irq, wl); wl1251_free_hw(wl); + regulator_disable(wl->vio); return 0; } diff --git a/drivers/net/wireless/ti/wl1251/wl1251.h b/drivers/net/wireless/ti/wl1251/wl1251.h index 5e9808c..010718b 100644 --- a/drivers/net/wireless/ti/wl1251/wl1251.h +++ b/drivers/net/wireless/ti/wl1251/wl1251.h @@ -279,6 +279,8 @@ struct wl1251 { int irq; bool use_eeprom; + struct regulator *vio; + spinlock_t wl_lock; enum wl1251_state state; -- 1.8.4.rc3 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 4/4] wl1251: spi: add device tree support
Add device tree support for the spi variant of wl1251 and document the binding. Signed-off-by: Sebastian Reichel --- .../devicetree/bindings/net/wireless/ti,wl1251.txt | 36 ++ drivers/net/wireless/ti/wl1251/spi.c | 23 ++ 2 files changed, 53 insertions(+), 6 deletions(-) create mode 100644 Documentation/devicetree/bindings/net/wireless/ti,wl1251.txt diff --git a/Documentation/devicetree/bindings/net/wireless/ti,wl1251.txt b/Documentation/devicetree/bindings/net/wireless/ti,wl1251.txt new file mode 100644 index 000..5f8a154 --- /dev/null +++ b/Documentation/devicetree/bindings/net/wireless/ti,wl1251.txt @@ -0,0 +1,36 @@ +* Texas Instruments wl1251 controller + +The wl1251 chip can be connected via SPI or via SDIO. The linux +kernel currently only supports device tree for the SPI variant. + +Required properties: +- compatible : Should be "ti,wl1251" +- interrupts : Should contain interrupt line +- interrupt-parent : Should be the phandle for the interrupt + controller that services interrupts for this device +- vio-supply : phandle to regulator providing VIO +- power-gpio : GPIO connected to chip's PMEN pin +- For additional required properties on SPI, please consult + Documentation/devicetree/bindings/spi/spi-bus.txt + +Optional properties: +- ti,use-eeprom : If found, configuration will be loaded from eeprom. + +Examples: + +&spi1 { + wl1251_spi@0 { + compatible = "ti,wl1251"; + + reg = <0>; + spi-max-frequency = <4800>; + spi-cpol; + spi-cpha; + + interrupt-parent = <&gpio2>; + interrupts = <10 IRQ_TYPE_NONE>; /* gpio line 42 */ + + vio-supply = <&vio>; + power-gpio = <&gpio3 23 GPIO_ACTIVE_HIGH>; /* 87 */ + }; +}; diff --git a/drivers/net/wireless/ti/wl1251/spi.c b/drivers/net/wireless/ti/wl1251/spi.c index efea57a..ee6ce4c 100644 --- a/drivers/net/wireless/ti/wl1251/spi.c +++ b/drivers/net/wireless/ti/wl1251/spi.c @@ -27,6 +27,8 @@ #include #include #include +#include +#include #include #include "wl1251.h" @@ -240,13 +242,13 @@ static const struct wl1251_if_operations wl1251_spi_ops = { static int wl1251_spi_probe(struct spi_device *spi) { - struct wl1251_platform_data *pdata; + struct wl1251_platform_data *pdata = spi->dev.platform_data; + struct device_node *np = spi->dev.of_node; struct ieee80211_hw *hw; struct wl1251 *wl; int ret; - pdata = spi->dev.platform_data; - if (!pdata) { + if (!np && !pdata) { wl1251_error("no platform data"); return -ENODEV; } @@ -273,7 +275,18 @@ static int wl1251_spi_probe(struct spi_device *spi) goto out_free; } - wl->power_gpio = pdata->power_gpio; + if (np) { + wl->use_eeprom = of_property_read_bool(np, "ti,use-eeprom"); + wl->power_gpio = of_get_named_gpio(np, "power-gpio", 0); + } else if (pdata) { + wl->power_gpio = pdata->power_gpio; + wl->use_eeprom = pdata->use_eeprom; + } + + if (wl->power_gpio == -EPROBE_DEFER) { + ret = -EPROBE_DEFER; + goto out_free; + } if (gpio_is_valid(wl->power_gpio)) { ret = devm_gpio_request_one(&spi->dev, wl->power_gpio, @@ -295,8 +308,6 @@ static int wl1251_spi_probe(struct spi_device *spi) goto out_free; } - wl->use_eeprom = pdata->use_eeprom; - irq_set_status_flags(wl->irq, IRQ_NOAUTOEN); ret = devm_request_irq(&spi->dev, wl->irq, wl1251_irq, 0, DRIVER_NAME, wl); -- 1.8.4.rc3 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCHv2 1/3] Input: twl4030-keypad - add device tree support
On Sun, Oct 27, 2013 at 05:23:48AM -0700, Tony Lindgren wrote: > * Pavel Machek [131027 04:48]: > > > > > +#if IS_ENABLED(CONFIG_OF) > > > > I'm probably missing something here, but why not #ifdef CONFIG_OF? > > > > > > I have been told for other drivers, that IS_ENABLED() is > > > the prefered way to check for configuration these days. > > > > CONFIG_OF can not be module, using IS_ENABLED() on it is just wrong. > > Good point. Looks like there's IS_BUILTIN that's for boolean options. Using IS_ENABLED for boolean options is supposed to be supported according to the comment above IS_BUILTIN: /* * IS_BUILTIN(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y', 0 * otherwise. For boolean options, this is equivalent to * IS_ENABLED(CONFIG_FOO). */ #define IS_BUILTIN(option) config_enabled(option) -- Sebastian signature.asc Description: Digital signature
Re: [PATCH 2/4] wl1251: move power GPIO handling into the driver
On Sun, Oct 27, 2013 at 08:24:16PM +0400, Alexander Shiyan wrote: > > Move the power GPIO handling from the board code into > > the driver. This is a dependency for device tree support. > > > > Signed-off-by: Sebastian Reichel > > --- > > arch/arm/mach-omap2/board-omap3pandora.c | 2 ++ > > arch/arm/mach-omap2/board-rx51-peripherals.c | 11 ++ > > drivers/net/wireless/ti/wl1251/sdio.c| 21 +- > > drivers/net/wireless/ti/wl1251/spi.c | 33 > > ++-- > > drivers/net/wireless/ti/wl1251/wl1251.h | 2 +- > > include/linux/wl12xx.h | 2 +- > > 6 files changed, 43 insertions(+), 28 deletions(-) > ... > > diff --git a/include/linux/wl12xx.h b/include/linux/wl12xx.h > > index b516b4f..a9c723b 100644 > > --- a/include/linux/wl12xx.h > > +++ b/include/linux/wl12xx.h > > @@ -49,7 +49,7 @@ enum { > > }; > > > > struct wl1251_platform_data { > > - void (*set_power)(bool enable); > > + int power_gpio; > > /* SDIO only: IRQ number if WLAN_IRQ line is used, 0 for SDIO IRQs */ > > int irq; > > bool use_eeprom; > > -- > > What a reason for not using regulator API here with GPIO-based > regulator? I think this pin is not used as power supply, but like an enable pin for low power states. Of course the regulator API could still be (mis?)used for this, but I think it would be the first linux device driver doing this. Note: I don't have wl1251 documentation. -- Sebastian signature.asc Description: Digital signature
[RFC 3/4] ASoC: Allow Aux Codecs to be specified using DT
This patch adds support for specifying auxiliary codecs and codec configuration via device tree phandles. This change adds new fields to snd_soc_aux_dev and snd_soc_codec_conf and adds support for the changes to SoC core methods. Signed-off-by: Sebastian Reichel --- include/sound/soc.h | 13 +- sound/soc/soc-core.c | 68 2 files changed, 59 insertions(+), 22 deletions(-) diff --git a/include/sound/soc.h b/include/sound/soc.h index d22cb0a..00b25a8 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -937,7 +937,12 @@ struct snd_soc_dai_link { }; struct snd_soc_codec_conf { + /* +* specify device either by device name, or by +* DT/OF node, but not both. +*/ const char *dev_name; + const struct device_node *of_node; /* * optional map of kcontrol, widget and path name prefixes that are @@ -954,7 +959,13 @@ struct snd_soc_codec_conf { struct snd_soc_aux_dev { const char *name; /* Codec name */ - const char *codec_name; /* for multi-codec */ + + /* +* specify multi-codec either by device name, or by +* DT/OF node, but not both. +*/ + const char *codec_name; + const struct device_node *codec_of_node; /* codec/machine specific init - e.g. add machine controls */ int (*init)(struct snd_soc_dapm_context *dapm); diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 1a38be0..392f479 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1085,10 +1085,12 @@ static void soc_set_name_prefix(struct snd_soc_card *card, for (i = 0; i < card->num_configs; i++) { struct snd_soc_codec_conf *map = &card->codec_conf[i]; - if (map->dev_name && !strcmp(codec->name, map->dev_name)) { - codec->name_prefix = map->name_prefix; - break; - } + if (map->of_node && codec->dev->of_node != map->of_node) + continue; + if (map->dev_name && strcmp(codec->name, map->dev_name)) + continue; + codec->name_prefix = map->name_prefix; + break; } } @@ -1527,15 +1529,23 @@ static void soc_unregister_ac97_dai_link(struct snd_soc_codec *codec) static int soc_check_aux_dev(struct snd_soc_card *card, int num) { struct snd_soc_aux_dev *aux_dev = &card->aux_dev[num]; + const char *codecname = aux_dev->codec_name; struct snd_soc_codec *codec; /* find CODEC from registered CODECs*/ list_for_each_entry(codec, &codec_list, list) { - if (!strcmp(codec->name, aux_dev->codec_name)) + if (aux_dev->codec_of_node && + codec->dev->of_node == aux_dev->codec_of_node) + return 0; + if (aux_dev->codec_name && + !strcmp(codec->name, aux_dev->codec_name)) return 0; } - dev_err(card->dev, "ASoC: %s not registered\n", aux_dev->codec_name); + if (aux_dev->codec_of_node) + codecname = of_node_full_name(aux_dev->codec_of_node); + + dev_err(card->dev, "ASoC: %s not registered\n", codecname); return -EPROBE_DEFER; } @@ -1544,22 +1554,31 @@ static int soc_probe_aux_dev(struct snd_soc_card *card, int num) { struct snd_soc_aux_dev *aux_dev = &card->aux_dev[num]; struct snd_soc_codec *codec; + const char *codecname = aux_dev->codec_name; int ret = -ENODEV; /* find CODEC from registered CODECs*/ list_for_each_entry(codec, &codec_list, list) { - if (!strcmp(codec->name, aux_dev->codec_name)) { - if (codec->probed) { - dev_err(codec->dev, - "ASoC: codec already probed"); - ret = -EBUSY; - goto out; - } - goto found; + if (aux_dev->codec_of_node && + codec->dev->of_node != aux_dev->codec_of_node) + continue; + if (aux_dev->codec_name && + strcmp(codec->name, aux_dev->codec_name)) + continue; + + if (codec->probed) { + dev_err(codec->dev, "ASoC: codec already probed"); + ret = -EBUSY; + goto out; } + goto found; } + + if (aux_dev->codec_of_node) + codecname = of_node_full_name(aux_dev->codec_of_node); + /* codec not found */ - dev_err(card->dev, "ASoC: codec %s not found", aux_dev->codec_name); + dev_err(card->dev, "ASoC: codec %s not found", codecnam
[RFC 1/4] ASoC: omap: rx51: Use snd_soc_register_card
From: Pali Rohár This patch converts the rx51 ASoC module to use snd_soc_register_card. It also adds module alias to support driver autoloading. Signed-off-by: Pali Rohár Signed-off-by: Sebastian Reichel --- sound/soc/omap/rx51.c | 49 + 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/sound/soc/omap/rx51.c b/sound/soc/omap/rx51.c index 611179c..41f26ae 100644 --- a/sound/soc/omap/rx51.c +++ b/sound/soc/omap/rx51.c @@ -390,10 +390,9 @@ static struct snd_soc_card rx51_sound_card = { .num_configs = ARRAY_SIZE(rx51_codec_conf), }; -static struct platform_device *rx51_snd_device; - -static int __init rx51_soc_init(void) +static int rx51_soc_probe(struct platform_device *pdev) { + struct snd_soc_card *card = &rx51_sound_card; int err; if (!machine_is_nokia_rx51() && !of_machine_is_compatible("nokia,omap3-n900")) @@ -408,22 +407,17 @@ static int __init rx51_soc_init(void) if (err) goto err_gpio_eci_sw; - rx51_snd_device = platform_device_alloc("soc-audio", -1); - if (!rx51_snd_device) { - err = -ENOMEM; - goto err1; - } - - platform_set_drvdata(rx51_snd_device, &rx51_sound_card); + card->dev = &pdev->dev; - err = platform_device_add(rx51_snd_device); - if (err) - goto err2; + err = snd_soc_register_card(card); + if (err) { + dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", err); + goto err_snd; + } return 0; -err2: - platform_device_put(rx51_snd_device); -err1: +err_snd: + card->dev = NULL; gpio_free(RX51_ECI_SW_GPIO); err_gpio_eci_sw: gpio_free(RX51_TVOUT_SEL_GPIO); @@ -432,19 +426,34 @@ err_gpio_tvout_sel: return err; } -static void __exit rx51_soc_exit(void) +static int rx51_soc_remove(struct platform_device *pdev) { + struct snd_soc_card *card = platform_get_drvdata(pdev); + snd_soc_jack_free_gpios(&rx51_av_jack, ARRAY_SIZE(rx51_av_jack_gpios), rx51_av_jack_gpios); - platform_device_unregister(rx51_snd_device); + snd_soc_unregister_card(card); + card->dev = NULL; + gpio_free(RX51_ECI_SW_GPIO); gpio_free(RX51_TVOUT_SEL_GPIO); + + return 0; } -module_init(rx51_soc_init); -module_exit(rx51_soc_exit); +static struct platform_driver rx51_soc_driver = { + .driver = { + .name = "rx51-audio", + .owner = THIS_MODULE, + }, + .probe = rx51_soc_probe, + .remove = rx51_soc_remove, +}; + +module_platform_driver(rx51_soc_driver); MODULE_AUTHOR("Nokia Corporation"); MODULE_DESCRIPTION("ALSA SoC Nokia RX-51"); MODULE_LICENSE("GPL"); +MODULE_ALIAS("platform:rx51-audio"); -- 1.8.4.rc3 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC 4/4] ASoC: RX-51: Add DT support to sound driver
This patch adds device tree support to the Nokia N900 audio driver. It also removes GPIO defines and gets them from platform data / device tree, since some GPIO numbers may be different with DT boot. The binding also changes a helper function in omap-mcbsp, which is currently only used by the Nokia N900. This change is needed, because DT instanced omap-mcbsp driver has no valid id assigned. Last but not least the DT binding is documented. Signed-off-by: Sebastian Reichel --- .../devicetree/bindings/sound/nokia,rx51.txt | 28 .../devicetree/bindings/vendor-prefixes.txt| 1 + include/sound/rx51.h | 18 +++ sound/soc/omap/omap-mcbsp.c| 5 +- sound/soc/omap/omap-mcbsp.h| 2 +- sound/soc/omap/rx51.c | 175 - 6 files changed, 184 insertions(+), 45 deletions(-) create mode 100644 Documentation/devicetree/bindings/sound/nokia,rx51.txt create mode 100644 include/sound/rx51.h diff --git a/Documentation/devicetree/bindings/sound/nokia,rx51.txt b/Documentation/devicetree/bindings/sound/nokia,rx51.txt new file mode 100644 index 000..4f985ca --- /dev/null +++ b/Documentation/devicetree/bindings/sound/nokia,rx51.txt @@ -0,0 +1,28 @@ +* Nokia N900 audio setup + +Required properties: +- compatible: "nokia,rx51-audio" +- ti,mcbsp: phandle for the McBSP node +- ti,codec: phandle for the main TLV320AIC3X node +- ti,codec_aux: phandle for the main TLV320AIC3X auxiliary node +- ti,headset_amp: phandle for the TPA6130A2 node +- tvout-selection-gpio: GPIO for tvout selection +- jack-detection-gpio: GPIO for jack detection +- eci-sw-gpio: GPIO for ECI SW +- speaker-amp-gpio: GPIO for Speaker Amp + +Example: + +sound { + compatible = "nokia,rx51-audio"; + + ti,mcbsp = <&mcbsp2>; + ti,codec = <&tlv320aic3x>; + ti,codec_aux = <&tlv320aic3x_aux>; + ti,headset_amp = <&tpa6130a2>; + + tvout-selection-gpio = <&gpio2 8 GPIO_ACTIVE_HIGH>; /* 40 */ + jack-detection-gpio = <&gpio6 17 GPIO_ACTIVE_HIGH>; /* 177 */ + eci-sw-gpio = <&gpio6 22 GPIO_ACTIVE_HIGH>; /* 182 */ + speaker-amp-gpio = <&twl_gpio 7 GPIO_ACTIVE_HIGH>; +}; diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index 2956800..2cc3dad 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt @@ -42,6 +42,7 @@ microchip Microchip Technology Inc. mosaixtech Mosaix Technologies, Inc. national National Semiconductor nintendo Nintendo +nokia Nokia Corporation nvidia NVIDIA nxpNXP Semiconductors onnn ON Semiconductor Corp. diff --git a/include/sound/rx51.h b/include/sound/rx51.h new file mode 100644 index 000..190d745 --- /dev/null +++ b/include/sound/rx51.h @@ -0,0 +1,18 @@ +/* + * Platform data for Nokia RX-51 SoC audio + * + * 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. + */ +#ifndef __RX51_AUDIO_H__ +#define __RX51_AUDIO_H__ + +struct rx51_audio_pdata { + int tvout_selection_gpio; + int jack_detection_gpio; + int eci_sw_gpio; + int speaker_amp_gpio; +}; + +#endif diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c index 6c19bba..f88e31e 100644 --- a/sound/soc/omap/omap-mcbsp.c +++ b/sound/soc/omap/omap-mcbsp.c @@ -691,7 +691,7 @@ OMAP_MCBSP_SOC_SINGLE_S16_EXT("McBSP" #port " Sidetone Channel 1 Volume", \ OMAP_MCBSP_ST_CONTROLS(2); OMAP_MCBSP_ST_CONTROLS(3); -int omap_mcbsp_st_add_controls(struct snd_soc_pcm_runtime *rtd) +int omap_mcbsp_st_add_controls(struct snd_soc_pcm_runtime *rtd, int port_id) { struct snd_soc_dai *cpu_dai = rtd->cpu_dai; struct omap_mcbsp *mcbsp = snd_soc_dai_get_drvdata(cpu_dai); @@ -701,7 +701,7 @@ int omap_mcbsp_st_add_controls(struct snd_soc_pcm_runtime *rtd) return 0; } - switch (mcbsp->id) { + switch (port_id) { case 2: /* McBSP 2 */ return snd_soc_add_dai_controls(cpu_dai, omap_mcbsp2_st_controls, @@ -711,6 +711,7 @@ int omap_mcbsp_st_add_controls(struct snd_soc_pcm_runtime *rtd) omap_mcbsp3_st_controls, ARRAY_SIZE(omap_mcbsp3_st_controls)); default: + dev_err(mcbsp->dev, "Port %d not supported\n", port_id); break; } diff --git a/sound/soc/omap/omap-mcbsp.h b/sound/soc/omap/omap-mcbsp.h index ba8386a..2e3369c 100644 --- a/sound/soc/omap/omap-mcbsp.h +++ b/sound/soc/omap/omap-mcbsp.h @@ -39,6 +39,6 @@ enum omap_mcbsp_div { OMAP_MCBSP_CLKGDV, /* Sample rate generator divider */ }; -int omap_mcbsp_st_add_contro
[RFC 2/4] ARM: OMAP: rx51: Register audio device
From: Pali Rohár This patch adds support for the audio chip to the legacy boardcode of the Nokia N900. Signed-off-by: Pali Rohár Signed-off-by: Sebastian Reichel --- arch/arm/mach-omap2/board-rx51-peripherals.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c index 68dc998..65e3627 100644 --- a/arch/arm/mach-omap2/board-rx51-peripherals.c +++ b/arch/arm/mach-omap2/board-rx51-peripherals.c @@ -1205,6 +1205,16 @@ error: */ } +static struct platform_device rx51_audio_device = { + .name = "rx51-audio", + .id = -1, +}; + +static void __init rx51_init_audio(void) +{ + platform_device_register(&rx51_audio_device); +} + static struct tsc2005_platform_data tsc2005_pdata = { .ts_pressure_max= 2048, .ts_pressure_fudge = 2, @@ -1287,6 +1297,7 @@ void __init rx51_peripherals_init(void) gpmc_onenand_init(board_onenand_data); board_smc91x_init(); rx51_add_gpio_keys(); + rx51_init_audio(); rx51_init_wl1251(); rx51_init_tsc2005(); rx51_init_si4713(); -- 1.8.4.rc3 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC 0/4] DT support for rx51-audio
Hi, This patchset adds DT support in rx51-audio. I tested it on the Nokia N900 and was able to play sound with aplay using earphones and earspeaker. The Loudspeakers did not work. I don't know the reason. The patchset consists of 4 patches: 1. convert rx51-audio to snd_soc_register_card() 2. init audio in rx51 platform file 3. add some DT helpers to ASoC core 4. add DT support to rx51-audio Please note, that the patch is RFC level for now. For example non DT boot does not work, because I did not yet add pdata in boardcode. Proposed DTS node would look like this: sound: rx51-audio { compatible = "nokia,rx51-audio"; ti,mcbsp = <&mcbsp2>; ti,codec = <&tlv320aic3x>; ti,codec_aux = <&tlv320aic3x_aux>; ti,headset_amp = <&tpa6130a2>; tvout-selection-gpio = <&gpio2 8 GPIO_ACTIVE_HIGH>; /* 40 */ jack-detection-gpio = <&gpio6 17 GPIO_ACTIVE_HIGH>; /* 177 */ eci-sw-gpio = <&gpio6 22 GPIO_ACTIVE_HIGH>; /* 182 */ speaker-amp-gpio = <&twl_gpio 7 GPIO_ACTIVE_HIGH>; }; -- Sebastian Pali Rohár (2): ASoC: omap: rx51: Use snd_soc_register_card ARM: OMAP: rx51: Register audio device Sebastian Reichel (2): ASoC: Allow Aux Codecs to be specified using DT ASoC: RX-51: Add DT support to sound driver .../devicetree/bindings/sound/nokia,rx51.txt | 28 +++ .../devicetree/bindings/vendor-prefixes.txt| 1 + arch/arm/mach-omap2/board-rx51-peripherals.c | 11 ++ include/sound/rx51.h | 18 ++ include/sound/soc.h| 13 +- sound/soc/omap/omap-mcbsp.c| 5 +- sound/soc/omap/omap-mcbsp.h| 2 +- sound/soc/omap/rx51.c | 212 +++-- sound/soc/soc-core.c | 68 +-- 9 files changed, 277 insertions(+), 81 deletions(-) create mode 100644 Documentation/devicetree/bindings/sound/nokia,rx51.txt create mode 100644 include/sound/rx51.h -- 1.8.4.rc3 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 3/3] omap2: gpmc: Move legacy GPMC width setting
After the introduction of gpmc_set_legacy(), move the GPMC width setting to be done inside it. Currently, in the DT probed case, this is (wrongly) done twice: first at gpmc_read_settings_dt(), and then based in the NAND width setting. Fix this and use only the value obtained from the DT. Signed-off-by: Ezequiel Garcia --- arch/arm/mach-omap2/gpmc-nand.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-omap2/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c index 9dd40e7..174caec 100644 --- a/arch/arm/mach-omap2/gpmc-nand.c +++ b/arch/arm/mach-omap2/gpmc-nand.c @@ -74,6 +74,11 @@ static void gpmc_set_legacy(struct omap_nand_platform_data *gpmc_nand_data, s->wait_on_read = true; s->wait_on_write = true; } + + if (gpmc_nand_data->devsize == NAND_BUSWIDTH_16) + s->device_width = GPMC_DEVWIDTH_16BIT; + else + s->device_width = GPMC_DEVWIDTH_8BIT; } int gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data, @@ -118,11 +123,6 @@ int gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data, s.device_nand = true; - if (gpmc_nand_data->devsize == NAND_BUSWIDTH_16) - s.device_width = GPMC_DEVWIDTH_16BIT; - else - s.device_width = GPMC_DEVWIDTH_8BIT; - err = gpmc_cs_program_settings(gpmc_nand_data->cs, &s); if (err < 0) goto out_free_cs; -- 1.8.1.5 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/3] omap2: gpmc: Move initialization outside the gpmc_t condition
This commit moves a bunch of initialization previously enclosed under a 'if (gpmc_t)' check, to be outside such condition. These initializations are not related to gpmc_t (timings) in any way so it's nonsense to enclose them under such check. Signed-off-by: Ezequiel Garcia --- arch/arm/mach-omap2/gpmc-nand.c | 40 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/arch/arm/mach-omap2/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c index 662c7fd..d66b856 100644 --- a/arch/arm/mach-omap2/gpmc-nand.c +++ b/arch/arm/mach-omap2/gpmc-nand.c @@ -98,32 +98,32 @@ int gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data, dev_err(dev, "Unable to set gpmc timings: %d\n", err); return err; } + } - if (gpmc_nand_data->of_node) { - gpmc_read_settings_dt(gpmc_nand_data->of_node, &s); - } else { - /* Enable RD PIN Monitoring Reg */ - if (gpmc_nand_data->dev_ready) { - s.wait_on_read = true; - s.wait_on_write = true; - } + if (gpmc_nand_data->of_node) { + gpmc_read_settings_dt(gpmc_nand_data->of_node, &s); + } else { + /* Enable RD PIN Monitoring Reg */ + if (gpmc_nand_data->dev_ready) { + s.wait_on_read = true; + s.wait_on_write = true; } + } - s.device_nand = true; + s.device_nand = true; - if (gpmc_nand_data->devsize == NAND_BUSWIDTH_16) - s.device_width = GPMC_DEVWIDTH_16BIT; - else - s.device_width = GPMC_DEVWIDTH_8BIT; + if (gpmc_nand_data->devsize == NAND_BUSWIDTH_16) + s.device_width = GPMC_DEVWIDTH_16BIT; + else + s.device_width = GPMC_DEVWIDTH_8BIT; - err = gpmc_cs_program_settings(gpmc_nand_data->cs, &s); - if (err < 0) - goto out_free_cs; + err = gpmc_cs_program_settings(gpmc_nand_data->cs, &s); + if (err < 0) + goto out_free_cs; - err = gpmc_configure(GPMC_CONFIG_WP, 0); - if (err < 0) - goto out_free_cs; - } + err = gpmc_configure(GPMC_CONFIG_WP, 0); + if (err < 0) + goto out_free_cs; gpmc_update_nand_reg(&gpmc_nand_data->reg, gpmc_nand_data->cs); -- 1.8.1.5 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/3] omap2: gpmc: Introduce gpmc_set_legacy()
Introduce a helper function to complete the setting of some GPMC parameters, only used when the gpmc is probed from a board file. As such, it will go away once the DT conversion is completed. Signed-off-by: Ezequiel Garcia --- arch/arm/mach-omap2/gpmc-nand.c | 22 ++ 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-omap2/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c index d66b856..9dd40e7 100644 --- a/arch/arm/mach-omap2/gpmc-nand.c +++ b/arch/arm/mach-omap2/gpmc-nand.c @@ -65,6 +65,17 @@ static bool gpmc_hwecc_bch_capable(enum omap_ecc ecc_opt) return 1; } +/* This function will go away once the device-tree convertion is complete */ +static void gpmc_set_legacy(struct omap_nand_platform_data *gpmc_nand_data, + struct gpmc_settings *s) +{ + /* Enable RD PIN Monitoring Reg */ + if (gpmc_nand_data->dev_ready) { + s->wait_on_read = true; + s->wait_on_write = true; + } +} + int gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data, struct gpmc_timings *gpmc_t) { @@ -100,15 +111,10 @@ int gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data, } } - if (gpmc_nand_data->of_node) { + if (gpmc_nand_data->of_node) gpmc_read_settings_dt(gpmc_nand_data->of_node, &s); - } else { - /* Enable RD PIN Monitoring Reg */ - if (gpmc_nand_data->dev_ready) { - s.wait_on_read = true; - s.wait_on_write = true; - } - } + else + gpmc_set_legacy(gpmc_nand_data, &s); s.device_nand = true; -- 1.8.1.5 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 0/3] omap2: Assorted GPMC cleanups
(I'm CCing the MTD list, because GPMC is the memory controller used for NOR, NAND and OneNAND devices). Hi all, Just a small patchset containing two small cleanups and a minor fix for the GPMC memory controller. The first two are cleanups and can be considered as preparation work for the fix. The fix is patch 3/3: "Move legacy GPMC width setting". It makes explicit use of the DT property "gpmc,device-width" and removes the subsequent (and redundant) setting of the GPMC width, based in the NAND bus widht. Tested in AM335x (using DT) so I'd appreciate if someone can test using a board-file, on a device with NAND flash. Jon: If you happen to read this, I'd like if you could take a look at patch 1/3, since you were the last to touch that part of the code. Thanks! Ezequiel Garcia (3): omap2: gpmc: Move initialization outside the gpmc_t condition omap2: gpmc: Introduce gpmc_set_legacy() omap2: gpmc: Move legacy GPMC width setting arch/arm/mach-omap2/gpmc-nand.c | 50 +++-- 1 file changed, 28 insertions(+), 22 deletions(-) -- 1.8.1.5 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [pandaboard] omapfb not accepting 720p mode
Hi, On Saturday 26 October 2013 09:01 PM, Tobias Jakobi wrote: Hello, the kernel bugtracker doesn't let me put this address into CC, so here manually: https://bugzilla.kernel.org/show_bug.cgi?id=63781 The issue seems like we can't allocate buffers for 720p. Can you make sure if CONFIG_DMA_CMA is set in your config? And you could set CMA_SIZE_MBYTES to a larger valuem say 50M. Archit -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 4/4] wl1251: spi: add device tree support
On Oct 27, 2013, at 11:14 AM, Sebastian Reichel wrote: > Add device tree support for the spi variant of wl1251 > and document the binding. > > Signed-off-by: Sebastian Reichel > --- > .../devicetree/bindings/net/wireless/ti,wl1251.txt | 36 ++ > drivers/net/wireless/ti/wl1251/spi.c | 23 ++ > 2 files changed, 53 insertions(+), 6 deletions(-) > create mode 100644 > Documentation/devicetree/bindings/net/wireless/ti,wl1251.txt > > diff --git a/Documentation/devicetree/bindings/net/wireless/ti,wl1251.txt > b/Documentation/devicetree/bindings/net/wireless/ti,wl1251.txt > new file mode 100644 > index 000..5f8a154 > --- /dev/null > +++ b/Documentation/devicetree/bindings/net/wireless/ti,wl1251.txt > @@ -0,0 +1,36 @@ > +* Texas Instruments wl1251 controller > + > +The wl1251 chip can be connected via SPI or via SDIO. The linux > +kernel currently only supports device tree for the SPI variant. > + >From the binding I have no idea what this chip actually does, also we don't >normally reference linux kernel support in bindings specs (so please remove >it). However, what would expect the SDIO binding to look like? Or more specifically, how would you distinguish the SPI vs SDIO binding/connection? I'm wondering if the compatible should be something like "ti,wl1251-spi" and than the sdio can be "ti,wl1251-sdio" > +Required properties: > +- compatible : Should be "ti,wl1251" reg is not listed as a required prop. > +- interrupts : Should contain interrupt line > +- interrupt-parent : Should be the phandle for the interrupt > + controller that services interrupts for this device > +- vio-supply : phandle to regulator providing VIO > +- power-gpio : GPIO connected to chip's PMEN pin should be vendor prefixed: ti,power-gpio > +- For additional required properties on SPI, please consult > + Documentation/devicetree/bindings/spi/spi-bus.txt > + > +Optional properties: > +- ti,use-eeprom : If found, configuration will be loaded from eeprom. can you be a bit more specific on what cfg will be loaded. Also, is this property a boolean, if so how do I know which eeprom the cfg is loaded from (is it one that is directly connected to the wl1251? > + > +Examples: > + > +&spi1 { > + wl1251_spi@0 { > + compatible = "ti,wl1251"; > + > + reg = <0>; > + spi-max-frequency = <4800>; > + spi-cpol; > + spi-cpha; > + > + interrupt-parent = <&gpio2>; > + interrupts = <10 IRQ_TYPE_NONE>; /* gpio line 42 */ > + > + vio-supply = <&vio>; > + power-gpio = <&gpio3 23 GPIO_ACTIVE_HIGH>; /* 87 */ > + }; > +}; -- Employee of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCHv2 1/3] Input: twl4030-keypad - add device tree support
On Oct 22, 2013, at 7:47 AM, Sebastian Reichel wrote: > Add device tree support for twl4030 keypad driver and update the > Documentation with twl4030 keypad device tree binding information. > > Tested on Nokia N900. > > Signed-off-by: Sebastian Reichel > --- > .../devicetree/bindings/input/twl4030-keypad.txt | 31 > drivers/input/keyboard/twl4030_keypad.c| 91 ++ > 2 files changed, 105 insertions(+), 17 deletions(-) > create mode 100644 Documentation/devicetree/bindings/input/twl4030-keypad.txt > > diff --git a/Documentation/devicetree/bindings/input/twl4030-keypad.txt > b/Documentation/devicetree/bindings/input/twl4030-keypad.txt > new file mode 100644 > index 000..2b4bd7a > --- /dev/null > +++ b/Documentation/devicetree/bindings/input/twl4030-keypad.txt > @@ -0,0 +1,31 @@ > +* TWL4030's Keypad Controller device tree bindings > + > +TWL4030's Keypad controller is used to interface a SoC with a matrix-type > +keypad device. The keypad controller supports multiple row and column lines. > +A key can be placed at each intersection of a unique row and a unique column. > +The keypad controller can sense a key-press and key-release and report the > +event using a interrupt to the cpu. > + > +This binding is based on the matrix-keymap binding with the following > +changes: Maybe be a bit more specific and say 'based on the input/matrix-keymap.txt binding'.. > + > + * keypad,num-rows and keypad,num-columns are required. > + Is linux,keymap required from matrix-keymap.txt? > +Required SoC Specific Properties: > +- compatible: should be one of the following > + - "ti,twl4030-keypad": For controllers compatible with twl4030 keypad > + controller. > +- interrupt: should be one of the following > + - <1>: For controllers compatible with twl4030 keypad controller. > + > +Optional Properties specific to linux: > +- linux,keypad-no-autorepeat: do no enable autorepeat feature. Does it make sense to update the matrix-keymap.txt binding to add 'linux,keypad-no-autorepeat' there? > + > +Example: > + twl_keypad: keypad { > + compatible = "ti,twl4030-keypad"; > + interrupts = <1>; > + keypad,num-rows = <8>; > + keypad,num-columns = <8>; > + linux,keypad-no-autorepeat; > + }; -- Employee of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC 4/4] ASoC: RX-51: Add DT support to sound driver
On Oct 27, 2013, at 4:24 PM, Sebastian Reichel wrote: > This patch adds device tree support to the Nokia N900 audio driver. > It also removes GPIO defines and gets them from platform data / > device tree, since some GPIO numbers may be different with DT boot. > > The binding also changes a helper function in omap-mcbsp, which > is currently only used by the Nokia N900. This change is needed, > because DT instanced omap-mcbsp driver has no valid id assigned. > > Last but not least the DT binding is documented. > > Signed-off-by: Sebastian Reichel > --- > .../devicetree/bindings/sound/nokia,rx51.txt | 28 > .../devicetree/bindings/vendor-prefixes.txt| 1 + > include/sound/rx51.h | 18 +++ > sound/soc/omap/omap-mcbsp.c| 5 +- > sound/soc/omap/omap-mcbsp.h| 2 +- > sound/soc/omap/rx51.c | 175 - > 6 files changed, 184 insertions(+), 45 deletions(-) > create mode 100644 Documentation/devicetree/bindings/sound/nokia,rx51.txt > create mode 100644 include/sound/rx51.h > > diff --git a/Documentation/devicetree/bindings/sound/nokia,rx51.txt > b/Documentation/devicetree/bindings/sound/nokia,rx51.txt > new file mode 100644 > index 000..4f985ca > --- /dev/null > +++ b/Documentation/devicetree/bindings/sound/nokia,rx51.txt > @@ -0,0 +1,28 @@ > +* Nokia N900 audio setup This needs more description > + > +Required properties: > +- compatible: "nokia,rx51-audio" > +- ti,mcbsp: phandle for the McBSP node > +- ti,codec: phandle for the main TLV320AIC3X node > +- ti,codec_aux: phandle for the main TLV320AIC3X auxiliary node > +- ti,headset_amp: phandle for the TPA6130A2 node Hmm, I don't think these should be ti prefixed but nokia. > +- tvout-selection-gpio: GPIO for tvout selection > +- jack-detection-gpio: GPIO for jack detection > +- eci-sw-gpio: GPIO for ECI SW > +- speaker-amp-gpio: GPIO for Speaker Amp why aren't the gpio properties vendor prefixed? > + > +Example: > + > +sound { > + compatible = "nokia,rx51-audio"; > + > + ti,mcbsp = <&mcbsp2>; > + ti,codec = <&tlv320aic3x>; > + ti,codec_aux = <&tlv320aic3x_aux>; > + ti,headset_amp = <&tpa6130a2>; > + > + tvout-selection-gpio = <&gpio2 8 GPIO_ACTIVE_HIGH>; /* 40 */ > + jack-detection-gpio = <&gpio6 17 GPIO_ACTIVE_HIGH>; /* 177 */ > + eci-sw-gpio = <&gpio6 22 GPIO_ACTIVE_HIGH>; /* 182 */ > + speaker-amp-gpio = <&twl_gpio 7 GPIO_ACTIVE_HIGH>; > +}; -- Employee of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html