Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
3.7: import new capebus patches
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
  • Loading branch information
koenkooi committed Nov 20, 2012
1 parent 3af5ca5 commit 72643c0
Show file tree
Hide file tree
Showing 25 changed files with 1,084 additions and 355 deletions.
4 changes: 2 additions & 2 deletions patches/capebus/0001-i2c-EEPROM-Export-memory-accessor.patch
@@ -1,7 +1,7 @@
From d5fbd4d6acac21aabae1e1820565c72f767d06f7 Mon Sep 17 00:00:00 2001
From f815a8a203c045f7e40f04851a75ed7849f6e720 Mon Sep 17 00:00:00 2001
From: Pantelis Antoniou <panto@antoniou-consulting.com>
Date: Sat, 13 Oct 2012 16:06:48 +0300
Subject: [PATCH 01/21] i2c-EEPROM: Export memory accessor
Subject: [PATCH 01/25] i2c-EEPROM: Export memory accessor

Various platforms need access to the EEPROM in other
places besides their platform registration callbacks.
Expand Down
@@ -1,7 +1,7 @@
From 402e0aa80c64c2ddc0b39adf733fda3105a9ebb5 Mon Sep 17 00:00:00 2001
From 7c077538bb2fe95173d9f986cefe96bff9a37ae7 Mon Sep 17 00:00:00 2001
From: Pantelis Antoniou <panto@antoniou-consulting.com>
Date: Sat, 13 Oct 2012 16:34:44 +0300
Subject: [PATCH 02/21] omap: Export
Subject: [PATCH 02/25] omap: Export
omap_hwmod_lookup/omap_device_build/omap_device_build_ss

These functions can be used just fine by modules, there's no need not
Expand Down
4 changes: 2 additions & 2 deletions patches/capebus/0003-gpio-keys-Pinctrl-fy.patch
@@ -1,7 +1,7 @@
From b2be8368eacadababf0f8c7b3948289b0e0ea33a Mon Sep 17 00:00:00 2001
From 5ceb5ea1e8e57004cb1ddba79b4193e9f507e7b5 Mon Sep 17 00:00:00 2001
From: Pantelis Antoniou <panto@antoniou-consulting.com>
Date: Wed, 17 Oct 2012 20:17:36 +0300
Subject: [PATCH 03/21] gpio-keys: Pinctrl-fy
Subject: [PATCH 03/25] gpio-keys: Pinctrl-fy

---
drivers/input/keyboard/gpio_keys.c | 6 ++++++
Expand Down
@@ -1,7 +1,7 @@
From 840afa1b249d87f29034e84ff793e43dba3ba3a7 Mon Sep 17 00:00:00 2001
From 79a7e230aecc97f38dc3505eea4557c9bbfeb73c Mon Sep 17 00:00:00 2001
From: Pantelis Antoniou <panto@antoniou-consulting.com>
Date: Wed, 17 Oct 2012 20:17:57 +0300
Subject: [PATCH 04/21] tps65217: Allow placement elsewhere than parent mfd
Subject: [PATCH 04/25] tps65217: Allow placement elsewhere than parent mfd
device.

The current code expect the configuration of the backlight to stay
Expand Down
4 changes: 2 additions & 2 deletions patches/capebus/0005-pwm-export-of_pwm_request.patch
@@ -1,7 +1,7 @@
From f9b4e9164af73f01eb25cac910ef5c97b2e29096 Mon Sep 17 00:00:00 2001
From 5b049ca7257e0a626d8b0dba13d16b9b29e872ff Mon Sep 17 00:00:00 2001
From: Pantelis Antoniou <panto@antoniou-consulting.com>
Date: Fri, 19 Oct 2012 10:38:00 +0300
Subject: [PATCH 05/21] pwm: export of_pwm_request
Subject: [PATCH 05/25] pwm: export of_pwm_request

No need to hide this, it's useful.
---
Expand Down
@@ -1,7 +1,7 @@
From 71459bed48859ab510971b1224b57d3b24de14e1 Mon Sep 17 00:00:00 2001
From b4acef0dc7425b2019ff36261caf7ff45b200916 Mon Sep 17 00:00:00 2001
From: Pantelis Antoniou <panto@antoniou-consulting.com>
Date: Sat, 20 Oct 2012 14:08:17 +0300
Subject: [PATCH 06/21] i2c: Export capability to probe devices
Subject: [PATCH 06/25] i2c: Export capability to probe devices

Probe devices for a node other that the adapter node.
---
Expand Down
4 changes: 2 additions & 2 deletions patches/capebus/0007-pwm-backlight-Pinctrl-fy.patch
@@ -1,7 +1,7 @@
From 79cb89df4af29215f91a278696552e782eb86703 Mon Sep 17 00:00:00 2001
From 1d774ca27c1c4de7e010a47305eebd3fe7b2837e Mon Sep 17 00:00:00 2001
From: Pantelis Antoniou <panto@antoniou-consulting.com>
Date: Tue, 23 Oct 2012 11:48:58 +0300
Subject: [PATCH 07/21] pwm-backlight: Pinctrl-fy
Subject: [PATCH 07/25] pwm-backlight: Pinctrl-fy

---
drivers/video/backlight/pwm_bl.c | 7 +++++++
Expand Down
@@ -1,7 +1,7 @@
From 3cf9cd9b8ec4e09a6fed5cd733c28ec6caf4f7f4 Mon Sep 17 00:00:00 2001
From 4a58d974e3e45fd294466fa29b83aeed6f4c33f1 Mon Sep 17 00:00:00 2001
From: Pantelis Antoniou <panto@antoniou-consulting.com>
Date: Tue, 23 Oct 2012 13:23:14 +0300
Subject: [PATCH 08/21] spi: Export OF interfaces for capebus use.
Subject: [PATCH 08/25] spi: Export OF interfaces for capebus use.

---
drivers/spi/spi.c | 31 +++++++++++++++++++++++--------
Expand Down
4 changes: 2 additions & 2 deletions patches/capebus/0009-w1-gpio-Pinctrl-fy.patch
@@ -1,7 +1,7 @@
From 56425bf7ffe0f2629b7b3b7469eb9251d1483243 Mon Sep 17 00:00:00 2001
From bfb3f0c421f2de41d7391a2502f8ecd36f67094a Mon Sep 17 00:00:00 2001
From: Pantelis Antoniou <panto@antoniou-consulting.com>
Date: Wed, 24 Oct 2012 09:54:37 +0300
Subject: [PATCH 09/21] w1-gpio: Pinctrl-fy
Subject: [PATCH 09/25] w1-gpio: Pinctrl-fy

---
drivers/w1/masters/w1-gpio.c | 7 +++++++
Expand Down
@@ -1,7 +1,7 @@
From a8acbf2b5eb81764f54612aed8cd078cb3789e2b Mon Sep 17 00:00:00 2001
From f6627c0e9b946c7d40a516a90e3cd66cb5bece08 Mon Sep 17 00:00:00 2001
From: Pantelis Antoniou <panto@antoniou-consulting.com>
Date: Wed, 24 Oct 2012 16:49:53 +0300
Subject: [PATCH 10/21] w1-gpio: Simplify & get rid of defines
Subject: [PATCH 10/25] w1-gpio: Simplify & get rid of defines

---
drivers/w1/masters/w1-gpio.c | 58 ++++++++++++++++++-----------------------
Expand Down
4 changes: 2 additions & 2 deletions patches/capebus/0011-arm-dt-Enable-DT-proc-updates.patch
@@ -1,7 +1,7 @@
From 9c08abcbd0986d219a1e22257b74fdf0037d4936 Mon Sep 17 00:00:00 2001
From 7c1a7bbbd55bd1b07abfa1749b55617d29e0b418 Mon Sep 17 00:00:00 2001
From: Pantelis Antoniou <panto@antoniou-consulting.com>
Date: Fri, 26 Oct 2012 16:11:46 +0300
Subject: [PATCH 11/21] arm-dt: Enable DT proc updates.
Subject: [PATCH 11/25] arm-dt: Enable DT proc updates.

---
arch/arm/include/asm/prom.h | 2 ++
Expand Down
@@ -1,7 +1,7 @@
From 91b32a07485b593eee468d9c4f9dd5e28024c0dd Mon Sep 17 00:00:00 2001
From 5bf29791172a5681001bd8ccae5c5607a48b4ef9 Mon Sep 17 00:00:00 2001
From: Grant Likely <grant.likely@secretlab.ca>
Date: Tue, 2 Aug 2011 15:30:09 +0100
Subject: [PATCH 12/21] ARM: CUSTOM: Build a uImage with dtb already appended
Subject: [PATCH 12/25] ARM: CUSTOM: Build a uImage with dtb already appended

Do not commit to mainline; this is a useful hack only for now.

Expand Down
@@ -1,7 +1,7 @@
From 48f84a261e4997ca2ce4139caaca15fbf127b4c1 Mon Sep 17 00:00:00 2001
From 57b277e165e198e8ce078167dff3eb5806067371 Mon Sep 17 00:00:00 2001
From: Koen Kooi <koen@dominion.thruhere.net>
Date: Tue, 30 Oct 2012 12:30:18 +0100
Subject: [PATCH 13/21] beaglebone: create a shared dtsi for beaglebone based
Subject: [PATCH 13/25] beaglebone: create a shared dtsi for beaglebone based
boards and add a new dts for bonelt

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Expand Down
4 changes: 2 additions & 2 deletions patches/capebus/0014-beaglebone-enable-emmc-for-bonelt.patch
@@ -1,7 +1,7 @@
From c812d3d90e68c81fd4c84f97746df6ebeb959b4a Mon Sep 17 00:00:00 2001
From 17b3317ec784bf30450642cd324ecf584c9dff0e Mon Sep 17 00:00:00 2001
From: Koen Kooi <koen@dominion.thruhere.net>
Date: Wed, 24 Oct 2012 11:47:13 +0200
Subject: [PATCH 14/21] beaglebone: enable emmc for bonelt
Subject: [PATCH 14/25] beaglebone: enable emmc for bonelt

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
---
Expand Down
236 changes: 236 additions & 0 deletions patches/capebus/0015-da8xx-dt-Create-da8xx-DT-adapter-device.patch
@@ -0,0 +1,236 @@
From 9134d736dc803f90c4f571f78bfa09f9ce2b8fb0 Mon Sep 17 00:00:00 2001
From: Pantelis Antoniou <panto@antoniou-consulting.com>
Date: Thu, 1 Nov 2012 15:19:35 +0200
Subject: [PATCH 15/25] da8xx-dt: Create da8xx DT adapter device

omap_device is going private.

Move the da8xx-dt adapter device to arch/arm/mach-omap2.

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
---
arch/arm/mach-omap2/Makefile | 3 +
arch/arm/mach-omap2/da8xx-dt.c | 197 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 200 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/mach-omap2/da8xx-dt.c

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index fe40d9e..3a9a0ff 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -200,6 +200,9 @@ ifneq ($(CONFIG_DRM_OMAP),)
obj-y += drm.o
endif

+# AM3XX Device Tree adapters for legacy drivers
+obj-$(CONFIG_SOC_AM33XX) += da8xx-dt.o
+
# Specific board support
obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o
obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o
diff --git a/arch/arm/mach-omap2/da8xx-dt.c b/arch/arm/mach-omap2/da8xx-dt.c
new file mode 100644
index 0000000..d3c6f48
--- /dev/null
+++ b/arch/arm/mach-omap2/da8xx-dt.c
@@ -0,0 +1,197 @@
+/*
+ * DA8XX-DT: Device tree adapter using the legacy driver
+ *
+ * Copyright (C) 2012 Pantelis Antoniou <panto@antoniou-consulting.com>
+ * Copyright (C) 2012 Texas Instruments Inc.
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/init.h>
+#include <linux/err.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
+#include <linux/of_gpio.h>
+#include <video/da8xx-fb.h>
+#include <linux/pinctrl/pinctrl.h>
+#include <linux/pinctrl/pinmux.h>
+#include <linux/pinctrl/consumer.h>
+#include <linux/clk.h>
+#include <plat/clock.h>
+#include <plat/omap_device.h>
+
+struct da8xx_priv {
+ struct da8xx_lcdc_platform_data lcd_pdata;
+ struct lcd_ctrl_config lcd_cfg;
+ struct display_panel lcd_panel;
+ struct platform_device *lcdc_pdev;
+ struct omap_hwmod *lcdc_oh;
+ struct resource lcdc_res[1];
+ int power_dn_gpio;
+};
+
+static const struct of_device_id of_da8xx_dt_match[] = {
+ { .compatible = "da8xx-dt", },
+ {},
+};
+
+static int __devinit da8xx_dt_probe(struct platform_device *pdev)
+{
+ struct da8xx_priv *priv;
+ struct clk *disp_pll;
+ struct pinctrl *pinctrl;
+ u32 disp_pll_val;
+ const char *panel_type;
+ int ret = -EINVAL;
+
+ priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
+ if (priv == NULL) {
+ dev_err(&pdev->dev, "Failed to allocate priv\n");
+ return -ENOMEM;
+ }
+ priv->power_dn_gpio = -1;
+
+ pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
+ if (IS_ERR(pinctrl))
+ dev_warn(&pdev->dev,
+ "pins are not configured from the driver\n");
+
+ ret = of_property_read_u32(pdev->dev.of_node, "disp-pll",
+ &disp_pll_val);
+ if (ret != 0) {
+ dev_err(&pdev->dev, "Failed to read disp-pll property\n");
+ return ret;
+ }
+
+ ret = of_property_read_string(pdev->dev.of_node, "panel-type",
+ &panel_type);
+ if (ret != 0) {
+ dev_err(&pdev->dev, "Failed to read panel-type property\n");
+ return ret;
+ }
+
+ /* conf_disp_pll(disp_pll); */
+ disp_pll = clk_get(NULL, "dpll_disp_ck");
+ if (IS_ERR(disp_pll)) {
+ dev_err(&pdev->dev, "Cannot clk_get disp_pll\n");
+ return PTR_ERR(disp_pll);
+ }
+ ret = clk_set_rate(disp_pll, disp_pll_val);
+ clk_put(disp_pll);
+ if (ret != 0) {
+ dev_err(&pdev->dev, "Failed to set disp_pll\n");
+ return ret;
+ }
+
+ ret = of_get_named_gpio_flags(pdev->dev.of_node, "powerdn-gpio",
+ 0, NULL);
+ if (IS_ERR_VALUE(ret)) {
+ dev_info(&pdev->dev, "No power down GPIO\n");
+ } else {
+ priv->power_dn_gpio = ret;
+
+ ret = devm_gpio_request(&pdev->dev, priv->power_dn_gpio,
+ "da8xx-dt:PDN");
+ if (ret != 0) {
+ dev_err(&pdev->dev, "Failed to gpio_request\n");
+ return ret;
+ }
+
+ ret = gpio_direction_output(priv->power_dn_gpio, 1);
+ if (ret != 0) {
+ dev_err(&pdev->dev, "Failed to set powerdn to 1\n");
+ return ret;
+ }
+ }
+
+ /* display_panel */
+ priv->lcd_panel.panel_type = QVGA;
+ priv->lcd_panel.max_bpp = 16;
+ priv->lcd_panel.min_bpp = 16;
+ priv->lcd_panel.panel_shade = COLOR_ACTIVE;
+
+ /* lcd_ctrl_config */
+ priv->lcd_cfg.p_disp_panel = &priv->lcd_panel;
+ priv->lcd_cfg.ac_bias = 255;
+ priv->lcd_cfg.ac_bias_intrpt = 0;
+ priv->lcd_cfg.dma_burst_sz = 16;
+ priv->lcd_cfg.bpp = 16;
+ priv->lcd_cfg.fdd = 0x80;
+ priv->lcd_cfg.tft_alt_mode = 0;
+ priv->lcd_cfg.stn_565_mode = 0;
+ priv->lcd_cfg.mono_8bit_mode = 0;
+ priv->lcd_cfg.invert_line_clock = 1;
+ priv->lcd_cfg.invert_frm_clock = 1;
+ priv->lcd_cfg.sync_edge = 0;
+ priv->lcd_cfg.sync_ctrl = 1;
+ priv->lcd_cfg.raster_order = 0;
+
+ /* da8xx_lcdc_platform_data */
+ strcpy(priv->lcd_pdata.manu_name, "BBToys");
+ priv->lcd_pdata.controller_data = &priv->lcd_cfg;
+ strcpy(priv->lcd_pdata.type, panel_type);
+
+ priv->lcdc_oh = omap_hwmod_lookup("lcdc");
+ if (priv->lcdc_oh == NULL) {
+ dev_err(&pdev->dev, "Failed to lookup omap_hwmod lcdc\n");
+ return -ENODEV;
+ }
+
+ priv->lcdc_pdev = omap_device_build("da8xx_lcdc", 0, priv->lcdc_oh,
+ &priv->lcd_pdata,
+ sizeof(struct da8xx_lcdc_platform_data),
+ NULL, 0, 0);
+ if (priv->lcdc_pdev == NULL) {
+ dev_err(&pdev->dev, "Failed to build LCDC device\n");
+ return -ENODEV;
+ }
+
+ dev_info(&pdev->dev, "Registered bone LCDC OK.\n");
+
+ platform_set_drvdata(pdev, priv);
+
+ return 0;
+}
+
+static int __devexit da8xx_dt_remove(struct platform_device *pdev)
+{
+ return -EINVAL; /* not supporting removal yet */
+}
+
+static struct platform_driver da8xx_dt_driver = {
+ .probe = da8xx_dt_probe,
+ .remove = __devexit_p(da8xx_dt_remove),
+ .driver = {
+ .name = "da8xx-dt",
+ .owner = THIS_MODULE,
+ .of_match_table = of_da8xx_dt_match,
+ },
+};
+
+static __init int da8xx_dt_init(void)
+{
+ return platform_driver_register(&da8xx_dt_driver);
+}
+
+static __exit void da8xx_dt_exit(void)
+{
+ platform_driver_unregister(&da8xx_dt_driver);
+}
+
+postcore_initcall(da8xx_dt_init);
+module_exit(da8xx_dt_exit);
--
1.7.7.6

0 comments on commit 72643c0

Please sign in to comment.