Commit af072172 authored by charles's avatar charles

ODROIDXU3:Driver module for IO Port.

Change-Id: I814937560ce7990db68a82e777a04ab0d55bcb21
parent 2077b7bd
menu "ODROID Specific Hardware"
config ODROID_EXYNOS5_FAN
bool "Enable the PWM Controlled FAN on ODROID-EXYNOS5"
tristate "Enable the PWM Controlled FAN on ODROID-EXYNOS5"
depends on MACH_ODROIDXU3
default y
---help---
Enables the PWM Controlled FAN on ODROID-EXYNOS5
config ODROID_EXYNOS5_SP
bool "Enable the INA231 Sensor on ODROID-EXYNOS5"
tristate "Enable the INA231 Sensor on ODROID-EXYNOS5"
depends on MACH_ODROIDXU3
default n
---help---
Enables the INA231 Sensor on ODROID-EXYNOS5
config ODROID_EXYNOS5_IOBOARD
bool "Enable the ODROID EXYNOS5 IOBOARD Drivers"
tristate "Enable the ODROID EXYNOS5 IOBOARD Drivers"
depends on MACH_ODROIDXU3
default n
---help---
......
obj-$(CONFIG_ODROID_EXYNOS5_FAN) += odroid_fan.o
obj-$(CONFIG_ODROID_EXYNOS5_SP) += ina231-i2c.o ina231-misc.o ina231-sysfs.o
obj-$(CONFIG_ODROID_EXYNOS5_IOBOARD) += ioboard-bh1780.o ioboard-bmp180.o
obj-$(CONFIG_ODROID_EXYNOS5_IOBOARD) += ioboard-keyled.o ioboard-spi.o ioboard-spi-misc.o
obj-$(CONFIG_ODROID_EXYNOS5_SP) += ina231-sensor.o
ina231-sensor-y := ina231-misc.o ina231-sysfs.o ina231-i2c.o
obj-$(CONFIG_ODROID_EXYNOS5_IOBOARD) += ioboard-bh1780.o ioboard-bmp180.o ioboard-keyled.o
obj-$(CONFIG_ODROID_EXYNOS5_IOBOARD) += ioboard-spi-flash.o
ioboard-spi-flash-y := ioboard-spi.o ioboard-spi-misc.o
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -221,15 +221,15 @@ static int bh1780_probe(struct i2c_client *client, const struct i2c_device_id *i
return -ENOMEM;
}
/* detect and init hardware */
if ((err = bh1780_detect(client, NULL)) != 0) goto error;
i2c_set_clientdata(client, bh1780);
dev_set_drvdata(&client->dev, bh1780);
bh1780->client = client;
/* detect and init hardware */
if ((err = bh1780_detect(client, NULL)) != 0) goto error;
if((err = i2c_smbus_write_byte(bh1780->client, (BH1780_COMMAND_REG + BH1780_PART_REV_REG))) < 0) {
dev_err(&client->dev, "I2C write byte error: data=0x%02x\n", (BH1780_COMMAND_REG + BH1780_PART_REV_REG));
goto error;
......@@ -260,7 +260,7 @@ static int bh1780_probe(struct i2c_client *client, const struct i2c_device_id *i
error:
printk("\n=================== ioboard_%s FAIL! ===================\n\n", __func__);
kfree(bh1780);
return err;
}
......
......@@ -332,14 +332,14 @@ static int bmp180_probe(struct i2c_client *client, const struct i2c_device_id *i
return -ENOMEM;
}
if(bmp180_detect(client) < 0) goto error;
i2c_set_clientdata(client, bmp180);
dev_set_drvdata(&client->dev, bmp180);
bmp180->client = client;
if(bmp180_detect(client) < 0) goto error;
err = bmp180_read_store_eeprom_val(bmp180);
if (err) {
......@@ -364,7 +364,7 @@ static int bmp180_probe(struct i2c_client *client, const struct i2c_device_id *i
error:
printk("\n=================== ioboard_%s FAIL! ===================\n\n", __func__);
kfree(bmp180);
return err;
}
......@@ -379,7 +379,6 @@ static int bmp180_remove(struct i2c_client *client)
sysfs_remove_group(&client->dev.kobj, &bmp180_attribute_group);
kfree(bmp180);
return 0;
}
......
......@@ -302,7 +302,9 @@ static int ioboard_keyled_remove (struct platform_device *pdev)
}
sysfs_remove_group(&pdev->dev.kobj, &ioboard_sysfs_attr_group);
hrtimer_cancel(&BoardTestTimer);
return 0;
}
......
......@@ -427,7 +427,6 @@ static int ioboard_spi_probe (struct spi_device *spi)
err:
printk("\n=================== %s FAIL! ===================\n\n", __func__);
kfree(ioboard_spi);
return ret;
......@@ -436,6 +435,12 @@ err:
//[*]--------------------------------------------------------------------------------------------------[*]
static int ioboard_spi_remove (struct spi_device *spi)
{
struct ioboard_spi *ioboard_spi = dev_get_drvdata(&spi->dev);
if(wp_gpio) gpio_free(wp_gpio);
kfree(ioboard_spi);
return 0;
}
......
File mode changed from 100644 to 100755
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