BigW Consortium Gitlab

Commit 0fc9ec1f by David Frey

Provide red_wp76xx and green_wp76xx make targets

Some kernel incompatibility had to be worked around in order to build sucessfully for both the wp85 and wp76.
parent b5c8784d
......@@ -15,7 +15,7 @@ MKSYS_ARGS_RED = -s $(MANGOH_ROOT)/apps/RedSensorToCloud
export TARGET := wp85
.PHONY: all
all: green_wp85 green_wp750x red_wp85 red_wp750x
all: green_wp85 green_wp750x green_wp76xx red_wp85 red_wp750x red_wp76xx
.PHONY: green_wp85
green_wp85:
......@@ -25,6 +25,10 @@ green_wp85:
green_wp750x:
mksys -t wp750x $(MKSYS_ARGS_COMMON) $(MKSYS_ARGS_GREEN) mangOH_Green.sdef
.PHONY: green_wp76xx
green_wp76xx:
mksys -t wp76xx $(MKSYS_ARGS_COMMON) $(MKSYS_ARGS_GREEN) mangOH_Green.sdef
.PHONY: red_wp85
red_wp85:
mksys -t wp85 $(MKSYS_ARGS_COMMON) $(MKSYS_ARGS_RED) mangOH_Red.sdef
......@@ -33,12 +37,19 @@ red_wp85:
red_wp750x:
mksys -t wp750x $(MKSYS_ARGS_COMMON) $(MKSYS_ARGS_RED) mangOH_Red.sdef
.PHONY: red_wp76xx
red_wp76xx:
mksys -t wp76xx $(MKSYS_ARGS_COMMON) $(MKSYS_ARGS_RED) mangOH_Red_9x07.sdef
.PHONY: clean
clean:
rm -rf \
_build_mangOH_Green \
mangOH_Green.wp85.update \
mangOH_Green.wp750x.update \
mangOH_Green.wp76xx.update \
_build_mangOH_Red \
_build_mangOH_Red_9x07 \
mangOH_Red.wp85.update \
mangOH_Red.wp750x.update
mangOH_Red.wp750x.update \
mangOH_Red_9x07.wp76xx.update
......@@ -422,6 +422,7 @@ static int bmp280_read_raw(struct iio_dev *indio_dev,
return ret;
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
static int bmp280_write_oversampling_ratio_humid(struct bmp280_data *data,
int val)
{
......@@ -472,6 +473,7 @@ static int bmp280_write_oversampling_ratio_press(struct bmp280_data *data,
}
return -EINVAL;
}
#endif
static int bmp280_write_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
......
......@@ -4,6 +4,7 @@
#include <linux/delay.h>
#include <linux/spi/spi.h>
#include <linux/i2c.h>
#include <linux/version.h>
#include "iot-slot-eeprom.h"
#include "iot-slot.h"
......@@ -232,6 +233,11 @@ static int iot_slot_add_gpio(struct iot_slot *slot,
char gpio_label[32];
for (i = 0; i < 4; i++) {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 44)
struct gpio_desc *gpio_pull;
#else
unsigned gpio_pull;
#endif
uint8_t cfg = eeprom_if_gpio_cfg(gpio_item, i);
ret = snprintf(gpio_label, ARRAY_SIZE(gpio_label),
"IoT slot %d gpio %d", slot_index, i);
......@@ -249,7 +255,16 @@ static int iot_slot_add_gpio(struct iot_slot *slot,
return -EACCES;
}
}
/*
* The gpio_pull_* functions are SWI specific. In the 9x15 kernel, the
* functions take an unsigned. In the 9x07 kernel, the functions take a
* struct gpio_desc.
*/
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 44)
gpio_pull = gpio_to_desc(pdata->gpio[i]);
#else
gpio_pull = pdata->gpio[i];
#endif
switch (cfg)
{
case EEPROM_GPIO_CFG_OUTPUT_LOW:
......@@ -260,11 +275,11 @@ static int iot_slot_add_gpio(struct iot_slot *slot,
break;
case EEPROM_GPIO_CFG_INPUT_PULL_UP:
gpio_direction_input(pdata->gpio[i]);
gpio_pull_up(pdata->gpio[i]);
gpio_pull_up(gpio_pull);
break;
case EEPROM_GPIO_CFG_INPUT_PULL_DOWN:
gpio_direction_input(pdata->gpio[i]);
gpio_pull_down(pdata->gpio[i]);
gpio_pull_down(gpio_pull);
break;
case EEPROM_GPIO_CFG_INPUT_FLOATING:
gpio_direction_input(pdata->gpio[i]);
......
......@@ -1103,7 +1103,7 @@ static ssize_t set_enable(struct device *dev, struct device_attribute *attr,
struct lsm6ds3_sensor_data *sdata = dev_get_drvdata(dev);
unsigned long enable;
if (strict_strtoul(buf, 10, &enable))
if (kstrtoul(buf, 10, &enable))
return -EINVAL;
if (enable)
......
......@@ -116,6 +116,7 @@ static void mangoh_green_release(struct device* dev)
static int mangoh_green_probe(struct platform_device* pdev)
{
struct i2c_adapter* adapter;
dev_info(&pdev->dev, "In the probe\n");
/*
......@@ -128,7 +129,7 @@ static int mangoh_green_probe(struct platform_device* pdev)
platform_set_drvdata(pdev, &mangoh_green_driver_data);
/* Get the main i2c adapter */
struct i2c_adapter* adapter = i2c_get_adapter(0);
adapter = i2c_get_adapter(0);
if (!adapter) {
dev_err(&pdev->dev, "Failed to get I2C adapter 0.\n");
return -ENODEV;
......
//--------------------------------------------------------------------------------------------------
// mangOH Red system definition that extends the wifi sdef from Legato.
//
// Copyright (C) Sierra Wireless Inc. Use of this work is subject to license.
//--------------------------------------------------------------------------------------------------
#include "$LEGATO_ROOT/modules/WiFi/wifi.sdef"
apps:
{
// gpioExpanderServiceRed conflicts with the iot_slot driver because the iot_slot driver makes
// use of the sx1509 gpio expander kernel driver whereas the gpio expander implements a driver
// in user space.
// $MANGOH_ROOT/apps/GpioExpander/gpioExpanderService/gpioExpanderServiceRed
$MANGOH_ROOT/apps/MqttClient/mqttClient
$MANGOH_ROOT/apps/DataRouter/dataRouter
$MANGOH_ROOT/apps/DataRouter/drTool/drTool
$MANGOH_ROOT/apps/SocialService/socialService
$MANGOH_ROOT/apps/RedSensorToCloud/redSensorToCloud
// Disabled until Release 15 is released due to bug in power supply kernel support
// $MANGOH_ROOT/apps/BatteryService/batteryService
// The heartbeat app is disabled on mangOH Red because the logging messages
// from the low power microcontroller make it very difficult to use the
// console port.
// $MANGOH_ROOT/apps/Heartbeat/heartbeatRed
$LEGATO_ROOT/apps/tools/devMode
}
commands:
{
dr = drTool:/bin/dr
twitter = socialService:/bin/twitter
}
interfaceSearch:
{
$MANGOH_ROOT/apps/MqttClient
$MANGOH_ROOT/apps/DataRouter
$MANGOH_ROOT/apps/MuxControl
$MANGOH_ROOT/apps/SocialService/interfaces
$MANGOH_ROOT/apps/BatteryService
}
kernelModules:
{
// $MANGOH_ROOT/linux_kernel_modules/mangoh/9-mangoh_red_dv2
// $MANGOH_ROOT/linux_kernel_modules/mangoh/9-mangoh_red_dv3
$MANGOH_ROOT/linux_kernel_modules/mangoh/9-mangoh_red_dv5
// cp2130 required for MT7697 WiFi/BT
$MANGOH_ROOT/linux_kernel_modules/cp2130/0-cp2130
$MANGOH_ROOT/linux_kernel_modules/bmp280/2-bmp280
$MANGOH_ROOT/linux_kernel_modules/bmp280/3-bmp280-i2c
// Used on mangOH Red DV2
// $MANGOH_ROOT/linux_kernel_modules/lsm6ds3/0-lsm6ds3
// $MANGOH_ROOT/linux_kernel_modules/lsm6ds3/1-lsm6ds3-i2c
// Used on mangOH Red DV3 and later
// Don't load bmi160 right now because there's a broken driver built into the wp76 kernel
// $MANGOH_ROOT/linux_kernel_modules/bmi160/3-bmi160
// $MANGOH_ROOT/linux_kernel_modules/bmi160/4-bmi160-i2c
$MANGOH_ROOT/linux_kernel_modules/iot_slot/0-iot_slot
// Disabled until compliation errors are fixed in wp76 kernel
// $MANGOH_ROOT/linux_kernel_modules/mt7697q/1-mt7697q
// $MANGOH_ROOT/linux_kernel_modules/mt7697serial/1-mt7697serial
// $MANGOH_ROOT/linux_kernel_modules/mt7697wifi/2-mt7697wifi_core
// Don't load spisvc right now on wp76 because it tries to create spidev0.0, but should create
// spidev1.0
// $LEGATO_ROOT/drivers/spisvc/spisvc
// Not on the mangOH Red DV3
$MANGOH_ROOT/linux_kernel_modules/ltc294x/0-ltc294x.mdef
// Required for BQ24296
$MANGOH_ROOT/linux_kernel_modules/bq24296/0-bq24296.mdef
}
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