Revert "kernel/prism: initial support for GFLT300"
We figured out a way to get real hardware board version detection
working so this commit is no longer necessary.
This reverts commit 5c42569eddd35d5d9c7f6e37e13a73355875dd88
Change-Id: I4b4eaf1d2de2f3bbd4151ddf2e6cb5142b5b5d81
diff --git a/arch/arm/configs/gflt110_defconfig b/arch/arm/configs/gflt110_defconfig
index 25bc9ca..cef0917 100644
--- a/arch/arm/configs/gflt110_defconfig
+++ b/arch/arm/configs/gflt110_defconfig
@@ -1136,7 +1136,7 @@
CONFIG_ARCH_REQUIRE_GPIOLIB=y
CONFIG_GPIOLIB=y
# CONFIG_DEBUG_GPIO is not set
-CONFIG_GPIO_SYSFS=y
+# CONFIG_GPIO_SYSFS is not set
#
# Memory mapped GPIO expanders:
diff --git a/arch/arm/mach-feroceon-kw2/Makefile b/arch/arm/mach-feroceon-kw2/Makefile
index 3fecf47..bf5e8a9 100755
--- a/arch/arm/mach-feroceon-kw2/Makefile
+++ b/arch/arm/mach-feroceon-kw2/Makefile
@@ -243,6 +243,6 @@
feroceon-$(CONFIG_THERMAL_SENSOR_KW2) += hwmon.o
# Board
-obj-y += fiberjack.o
obj-$(CONFIG_MACH_GFLT200) += board-gflt200.o
obj-$(CONFIG_MACH_GFLT110) += board-gflt110.o
+
diff --git a/arch/arm/mach-feroceon-kw2/board-gflt110.c b/arch/arm/mach-feroceon-kw2/board-gflt110.c
index 6d701dc..5341efb 100644
--- a/arch/arm/mach-feroceon-kw2/board-gflt110.c
+++ b/arch/arm/mach-feroceon-kw2/board-gflt110.c
@@ -1,5 +1,4 @@
#include <boardEnv/mvBoardEnvLib.h>
-#include <fiberjack.h>
#include <gpp/mvGpp.h>
#include <linux/device.h>
#include <linux/err.h>
@@ -11,7 +10,7 @@
#include <linux/platform_device.h>
#include <linux/sysfs.h>
-#define GPIO_PON_PWR_EN 37
+#define BOARD_NAME "gflt110"
struct gflt_led_data {
unsigned gpio;
@@ -19,56 +18,6 @@
struct led_classdev cdev;
};
-struct board_gpio {
- unsigned gpio;
- const char *label;
-};
-
-static struct board_gpio board_gpios[] = {
- {
- .gpio = GPIO_PON_PWR_EN,
- .label = "power-enable",
- },
-};
-
-static int board_gpio_export(struct board_gpio *gpio, struct device *dev)
-{
- int rc;
-
- rc = gpio_request(gpio->gpio, gpio->label);
- if (rc) {
- pr_err("%s: error %d requesting gpio %u (%s)\n",
- get_model_name(), rc, gpio->gpio, gpio->label);
- goto exit;
- }
-
- /* this is needed to set gpiolib's out flag for the gpio */
- rc = gpio_direction_output(gpio->gpio, gpio_get_value(gpio->gpio));
- if (rc) {
- pr_err("%s: error %d setting gpio %u (%s) direction\n",
- get_model_name(), rc, gpio->gpio, gpio->label);
- goto exit;
- }
-
- rc = gpio_export(gpio->gpio, false);
- if (rc) {
- pr_err("%s: error %d exporting gpio %u (%s)\n",
- get_model_name(), rc, gpio->gpio, gpio->label);
- goto exit;
- }
-
- rc = gpio_export_link(dev, gpio->label, gpio->gpio);
- if (rc) {
- pr_err("%s: error %d linking gpio %u (%s)\n",
- get_model_name(), rc, gpio->gpio, gpio->label);
- goto exit;
- }
-
- rc = 0;
-exit:
- return rc;
-}
-
static ssize_t board_hw_ver_show(struct device *dev,
struct device_attribute *attr,
char *buf)
@@ -161,47 +110,33 @@
int __init board_init(void)
{
- int i;
int rc;
struct platform_device *pdev;
- printk("Detected board type: %s\n", get_model_name());
-
/* /sys/devices/platform/<board_name> */
- pdev = platform_device_register_simple(get_model_name(), -1, NULL, 0);
+ pdev = platform_device_register_simple(BOARD_NAME, -1, NULL, 0);
if (IS_ERR(pdev)) {
rc = PTR_ERR(pdev);
- pr_err("%s: error %d registering device\n",
- get_model_name(), rc);
+ pr_err(BOARD_NAME ": error %d registering device\n", rc);
return rc;
}
/* /sys/devices/platform/board -> /sys/devices/platform/<board_name> */
rc = sysfs_create_link(&pdev->dev.parent->kobj, &pdev->dev.kobj,
- "board");
- if (rc) {
- pr_err("%s: error %d creating link 'board'\n",
- get_model_name(), rc);
- }
+ "board");
+ if (rc)
+ pr_err(BOARD_NAME ": error %d creating link 'board'\n", rc);
/* /sys/devices/platform/board/hw_ver */
rc = device_create_file(&pdev->dev, &dev_attr_hw_ver);
- if (rc) {
- pr_err("%s: error %d creating attribute 'hw_ver'\n",
- get_model_name(), rc);
- }
-
- if (is_gflt300() == 1) {
- /* /sys/devices/platform/board/<gpio_name> */
- for (i = 0; i < ARRAY_SIZE(board_gpios); i++)
- board_gpio_export(&board_gpios[i], &pdev->dev);
- }
+ if (rc)
+ pr_err(BOARD_NAME ": error %d creating attribute 'hw_ver'\n",
+ rc);
rc = register_gfltleds(pdev, board_gpio_leds, ARRAY_SIZE(board_gpio_leds));
- if (rc) {
- pr_err("%s: error %d registering GFLT LED device\n",
- get_model_name(), rc);
- }
+ if (rc)
+ pr_err(BOARD_NAME ": error %d registering GFLT LED device\n",
+ rc);
return 0;
}
diff --git a/arch/arm/mach-feroceon-kw2/fiberjack.c b/arch/arm/mach-feroceon-kw2/fiberjack.c
deleted file mode 100644
index 21d4823..0000000
--- a/arch/arm/mach-feroceon-kw2/fiberjack.c
+++ /dev/null
@@ -1,23 +0,0 @@
-#include <linux/init.h>
-#include <linux/string.h>
-#include "fiberjack.h"
-
-const char* get_model_name(void) {
- if (strstr(boot_command_line, "model=gflt300") != NULL)
- return "gflt300";
- else if (strstr(boot_command_line, "model=gflt110") != NULL)
- return "gflt110";
- else
- /* If we can't find a match, assume the default which is GFLT110 */
- return "gflt110";
-}
-
-int parse_model_from_cmdline(const char* model) {
- if (strstr(boot_command_line, model) != NULL)
- return 1;
- return 0;
-}
-
-int is_gflt300(void) {
- return parse_model_from_cmdline("gflt300");
-}
diff --git a/arch/arm/mach-feroceon-kw2/fiberjack.h b/arch/arm/mach-feroceon-kw2/fiberjack.h
deleted file mode 100644
index ccf89f3..0000000
--- a/arch/arm/mach-feroceon-kw2/fiberjack.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _FEROCEON_FIBERJACK_H_
-#define _FEROCEON_FIBERJACK_H_
-int is_gflt300(void);
-int parse_model_from_cmdline(char const* model);
-const char* get_model_name(void);
-#endif /* _FEROCEON_FIBERJACK_H_ */
diff --git a/arch/arm/mach-feroceon-kw2/kw2_family/boardEnv/mvBoardEnvSpec.c b/arch/arm/mach-feroceon-kw2/kw2_family/boardEnv/mvBoardEnvSpec.c
index 209268c..75804fc 100755
--- a/arch/arm/mach-feroceon-kw2/kw2_family/boardEnv/mvBoardEnvSpec.c
+++ b/arch/arm/mach-feroceon-kw2/kw2_family/boardEnv/mvBoardEnvSpec.c
@@ -61,7 +61,6 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*******************************************************************************/
-#include "fiberjack.h"
#include "mvCommon.h"
#include "mvBoardEnvLib.h"
#include "mvBoardEnvSpec.h"
diff --git a/arch/arm/mach-feroceon-kw2/kw2_family/boardEnv/mvBoardEnvSpec.h b/arch/arm/mach-feroceon-kw2/kw2_family/boardEnv/mvBoardEnvSpec.h
index 8dd507d..66aaeaf 100755
--- a/arch/arm/mach-feroceon-kw2/kw2_family/boardEnv/mvBoardEnvSpec.h
+++ b/arch/arm/mach-feroceon-kw2/kw2_family/boardEnv/mvBoardEnvSpec.h
@@ -541,13 +541,12 @@
/***************************************************************************
** GFLT110
****************************************************************************/
-#define GFLT110_MPP0_7 0x22222220
-#define GFLT110_MPP8_15 0x00000002
+#define GFLT110_MPP0_7 0x22222220
+#define GFLT110_MPP8_15 0x00000002
#define GFLT110_MPP16_23 0x00400000
#define GFLT110_MPP24_31 0x00200550
#define GFLT110_MPP32_37 0x00000000
-
/* GPPs
1 SPI0_MOSI (out)
2 SPI0_SCK (out)
@@ -568,14 +567,13 @@
37 TX_PD
*/
-#define GFLT110_GPP_OUT_ENA_LOW (BIT0 | BIT14 | BIT16 | BIT17 | BIT18 | BIT19 | BIT22 | BIT23 | BIT24 | BIT27| BIT30 | BIT31)
-
-#define GFLT110_GPP_OUT_ENA_MID (BIT0 | BIT3 | BIT4)
+#define GFLT110_GPP_OUT_ENA_LOW (BIT0 | BIT14 | BIT16 | BIT17 | BIT18 | BIT19 | BIT22 | BIT23 | BIT24 | BIT27| BIT30 | BIT31)
+#define GFLT110_GPP_OUT_ENA_MID (BIT0 | BIT3 | BIT4)
// BIT12 turns the LED blue.
// BIT13 turns the LED red.
-#define GFLT110_GPP_OUT_VAL_LOW BIT13
-#define GFLT110_GPP_OUT_VAL_MID 0x0
+#define GFLT110_GPP_OUT_VAL_LOW BIT13
+#define GFLT110_GPP_OUT_VAL_MID 0x0
#define GFLT110_GPP_POL_LOW (BIT23)
#define GFLT110_GPP_POL_MID 0x0