Commit 8e128442 authored by charles.park's avatar charles.park

ODROIDXU3 : modified ioboard driver for remove parameter in dts file.

Change-Id: I97366c66865e66e0659dece5a35366083913f6f2
parent c3fe2fed
......@@ -506,21 +506,6 @@
spi_1: spi@12d30000 {
status = "okay";
samsung,spi-src-clk = <0>;
num-cs = <1>;
ioboard_spi {
compatible = "ioboard-spi";
reg = <0>;
spi-max-frequency = <20000000>;
pinctrl-names = "default";
pinctrl-0 = <&ioboard_flash_cs &ioboard_wp>;
wp-gpio = <&gpx1 5 0>;
controller-data {
cs-gpio = <&gpa2 5 0>;
samsung,spi-feedback-delay = <0>;
};
};
};
spi_2: spi@12d40000 {
......@@ -569,106 +554,6 @@
status = "okay";
};
pinctrl@13400000 {
gpio_i2c_sda: gpio-i2c-sda {
samsung,pins = "gpx3-1";
/* 0 = input, 1 = output */
samsung,pin-function = <0>;
/* 0 = disable, 1 = pull dn, 2 = reserved, 3 = pull up */
samsung,pin-pud = <0x00>;
};
gpio_i2c_scl: gpio-i2c-scl {
samsung,pins = "gpx1-7";
/* 0 = input, 1 = output */
samsung,pin-function = <0>;
/* 0 = disable, 1 = pull dn, 2 = reserved, 3 = pull up */
samsung,pin-pud = <0x00>;
};
ioboard_key: ioboard-key {
samsung,pins = "gpx2-5", "gpx2-6", "gpx1-6", "gpx1-2";
/* 0 = input, 1 = output */
samsung,pin-function = <0>;
/* 0 = disable, 1 = pull dn, 2 = reserved, 3 = pull up */
samsung,pin-pud = <0x00>;
};
ioboard_led: ioboard-led {
samsung,pins = "gpx2-7", "gpx2-4", "gpx1-3", "gpx2-0";
/* 0 = input, 1 = output */
samsung,pin-function = <1>;
/* 0 = disable, 1 = pull dn, 2 = reserved, 3 = pull up */
samsung,pin-pud = <0x03>;
};
ioboard_wp: ioboard-wp {
samsung,pins = "gpx1-5";
/* 0 = input, 1 = output */
samsung,pin-function = <0>;
/* 0 = disable, 1 = pull dn, 2 = reserved, 3 = pull up */
samsung,pin-pud = <0x00>;
};
};
pinctrl@14010000 {
ioboard_led_1: ioboard-led-1 {
samsung,pins = "gpb3-2";
/* 0 = input, 1 = output */
samsung,pin-function = <1>;
/* 0 = disable, 1 = pull dn, 2 = reserved, 3 = pull up */
samsung,pin-pud = <0x03>;
};
ioboard_flash_cs: ioboard-flash-cs {
samsung,pins = "gpa2-5";
/* 0 = input, 1 = output, 2 = SPI_nSS */
samsung,pin-function = <2>;
/* 0 = disable, 1 = pull dn, 2 = reserved, 3 = pull up */
samsung,pin-pud = <0>;
};
};
ioboard_key_led {
compatible = "ioboard-keyled";
pinctrl-names = "default";
pinctrl-0 = <&ioboard_key &ioboard_led &ioboard_led_1>;
gpios = <
&gpx2 5 0 /* IOBOARD_SW1 */
&gpx2 6 0 /* IOBOARD_SW2 */
&gpx1 6 0 /* IOBOARD_SW3 */
&gpx1 2 0 /* IOBOARD_SW4 */
&gpx2 7 0 /* IOBOARD_LED1 */
&gpx2 4 0 /* IOBOARD_LED2 */
&gpx1 3 0 /* IOBOARD_LED3 */
&gpb3 2 0 /* IOBOARD_LED4 */
&gpx2 0 0 /* IOBOARD_LED5 */
>;
status = "okay";
};
i2c_gpio {
compatible = "i2c-gpio";
gpios = <
&gpx3 1 0 /* sda */
&gpx1 7 0 /* scl */
>;
i2c-gpio,sda-open-drain;
i2c-gpio,scl-open-drain;
i2c-gpio,delay-us = <10>; /* ~50 kHz */
#address-cells = <1>;
#size-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&gpio_i2c_sda &gpio_i2c_scl>;
status = "okay";
/* light sensor : bh1780 dirver */
bh1780@29 {
compatible = "ioboard-bh1780";
reg = <0x29>;
};
/* pressure sensor : bmp180 dirver */
bmp180@77 {
compatible = "ioboard-bmp180";
reg = <0x77>;
};
};
pinctrl@14010000 {
pwm0_out: pwm0-out {
samsung,pins = "gpb2-0";
......
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm 3.10.72 Kernel Configuration
# Linux/arm 3.10.81 Kernel Configuration
#
CONFIG_ARM=y
CONFIG_ARM_HAS_SG_CHAIN=y
......@@ -1775,6 +1775,7 @@ CONFIG_I2C_ALGOBIT=y
# CONFIG_I2C_DESIGNWARE_PLATFORM is not set
CONFIG_I2C_EXYNOS5=y
CONFIG_I2C_GPIO=y
CONFIG_I2C_GPIO_CUSTOM=m
# CONFIG_I2C_NOMADIK is not set
# CONFIG_I2C_OCORES is not set
# CONFIG_I2C_PCA_PLATFORM is not set
......
......@@ -27,13 +27,11 @@
#include <mach/regs-pmu.h>
#include <plat/gpio-cfg.h>
#if defined(CONFIG_OF)
#include <linux/of_gpio.h>
#endif
//[*]--------------------------------------------------------------------------------------------------[*]
unsigned char BoardTestFlag = 1;
struct hrtimer BoardTestTimer; // Board Test Timer
static unsigned char BoardTestFlag = 1;
static struct hrtimer BoardTestTimer; // Board Test Timer
static struct platform_device *pd;
//[*]--------------------------------------------------------------------------------------------------[*]
// IOBOARD KEY & LED GPIO Define
//[*]--------------------------------------------------------------------------------------------------[*]
......@@ -51,6 +49,17 @@ enum {
};
//[*]--------------------------------------------------------------------------------------------------[*]
// GPIO Export Number define
#define GPX2_5_EXPORT_NUM 29
#define GPX2_6_EXPORT_NUM 30
#define GPX1_6_EXPORT_NUM 22
#define GPX1_2_EXPORT_NUM 18
#define GPX2_7_EXPORT_NUM 31
#define GPX2_4_EXPORT_NUM 28
#define GPX1_3_EXPORT_NUM 19
#define GPB3_2_EXPORT_NUM 209
#define GPX2_0_EXPORT_NUM 24
static struct {
int gpio_index; // Control Index
int gpio; // GPIO Number
......@@ -59,27 +68,15 @@ static struct {
int value; // Default Value(only for output)
int pud; // Pull up/down register setting : S3C_GPIO_PULL_DOWN, UP, NONE
} sControlGpios[] = {
#if defined(CONFIG_OF)
{ IOBOARD_SW1, 0xFFFF, "sw1", 0, 0, S3C_GPIO_PULL_NONE },
{ IOBOARD_SW2, 0xFFFF, "sw2", 0, 0, S3C_GPIO_PULL_NONE },
{ IOBOARD_SW3, 0xFFFF, "sw3", 0, 0, S3C_GPIO_PULL_NONE },
{ IOBOARD_SW4, 0xFFFF, "sw4", 0, 0, S3C_GPIO_PULL_NONE },
{ IOBOARD_LED1, 0xFFFF, "led1", 1, 0, S3C_GPIO_PULL_NONE },
{ IOBOARD_LED2, 0xFFFF, "led2", 1, 0, S3C_GPIO_PULL_NONE },
{ IOBOARD_LED3, 0xFFFF, "led3", 1, 0, S3C_GPIO_PULL_NONE },
{ IOBOARD_LED4, 0xFFFF, "led4", 1, 0, S3C_GPIO_PULL_NONE },
{ IOBOARD_LED5, 0xFFFF, "led5", 1, 1, S3C_GPIO_PULL_NONE },
#else
{ IOBOARD_SW1, EXYNOS5410_GPX2(5), "sw1", 0, 0, S3C_GPIO_PULL_NONE },
{ IOBOARD_SW2, EXYNOS5410_GPX2(6), "sw2", 0, 0, S3C_GPIO_PULL_NONE },
{ IOBOARD_SW3, EXYNOS5410_GPX1(6), "sw3", 0, 0, S3C_GPIO_PULL_NONE },
{ IOBOARD_SW4, EXYNOS5410_GPX1(2), "sw4", 0, 0, S3C_GPIO_PULL_NONE },
{ IOBOARD_LED1, EXYNOS5410_GPX2(7), "led1", 1, 0, S3C_GPIO_PULL_NONE },
{ IOBOARD_LED2, EXYNOS5410_GPX2(4), "led2", 1, 0, S3C_GPIO_PULL_NONE },
{ IOBOARD_LED3, EXYNOS5410_GPX1(3), "led3", 1, 0, S3C_GPIO_PULL_NONE },
{ IOBOARD_LED4, EXYNOS5410_GPX1(0), "led4", 1, 0, S3C_GPIO_PULL_NONE },
{ IOBOARD_LED5, EXYNOS5410_GPX2(0), "led5", 1, 1, S3C_GPIO_PULL_NONE },
#endif
{ IOBOARD_SW1, GPX2_5_EXPORT_NUM, "sw1", 0, 0, S3C_GPIO_PULL_NONE },
{ IOBOARD_SW2, GPX2_6_EXPORT_NUM, "sw2", 0, 0, S3C_GPIO_PULL_NONE },
{ IOBOARD_SW3, GPX1_6_EXPORT_NUM, "sw3", 0, 0, S3C_GPIO_PULL_NONE },
{ IOBOARD_SW4, GPX1_2_EXPORT_NUM, "sw4", 0, 0, S3C_GPIO_PULL_NONE },
{ IOBOARD_LED1, GPX2_7_EXPORT_NUM, "led1", 1, 0, S3C_GPIO_PULL_NONE },
{ IOBOARD_LED2, GPX2_4_EXPORT_NUM, "led2", 1, 0, S3C_GPIO_PULL_NONE },
{ IOBOARD_LED3, GPX1_3_EXPORT_NUM, "led3", 1, 0, S3C_GPIO_PULL_NONE },
{ IOBOARD_LED4, GPB3_2_EXPORT_NUM, "led4", 1, 0, S3C_GPIO_PULL_NONE },
{ IOBOARD_LED5, GPX2_0_EXPORT_NUM, "led5", 1, 1, S3C_GPIO_PULL_NONE },
};
//[*]--------------------------------------------------------------------------------------------------[*]
......@@ -209,6 +206,7 @@ static enum hrtimer_restart ioboard_test_timer(struct hrtimer *timer)
return HRTIMER_NORESTART;
}
//[*]--------------------------------------------------------------------------------------------------[*]
static int ioboard_keyled_resume(struct platform_device *dev)
{
......@@ -229,45 +227,14 @@ static int ioboard_keyled_suspend(struct platform_device *dev, pm_message_t stat
return 0;
}
//[*]--------------------------------------------------------------------------------------------------[*]
#if defined(CONFIG_OF)
static int of_ioboard_keyled_get_pins (struct device_node *np)
{
int cnt, gpio_cnt;
if ((gpio_cnt = of_gpio_count(np)) < IOBOARD_MAX) {
pr_err("Invalid GPIO pins. count = %d\n", gpio_cnt);
return -ENODEV;
}
for(cnt = 0; cnt < gpio_cnt; cnt++) {
sControlGpios[cnt].gpio = of_get_gpio(np, cnt);
if(!gpio_is_valid(sControlGpios[cnt].gpio)) {
pr_err("%s: invalid GPIO pins, gpio.name=%s/gpio_no=%d\n",
np->full_name, sControlGpios[cnt].name, sControlGpios[cnt].gpio);
return -ENODEV;
}
}
return 0;
}
#endif
//[*]--------------------------------------------------------------------------------------------------[*]
static int ioboard_keyled_probe (struct platform_device *pdev)
{
int i;
#if defined(CONFIG_OF)
if (pdev->dev.of_node) {
if(of_ioboard_keyled_get_pins(pdev->dev.of_node)) return -ENODEV;
}
else {
return -ENODEV;
}
#endif
// Control GPIO Init
for (i = 0; i < ARRAY_SIZE(sControlGpios); i++) {
if(sControlGpios[i].gpio) {
if(gpio_request(sControlGpios[i].gpio, sControlGpios[i].name)) {
printk("%s : %s gpio reqest err!\n", __FUNCTION__, sControlGpios[i].name);
......@@ -309,21 +276,10 @@ static int ioboard_keyled_remove (struct platform_device *pdev)
}
//[*]--------------------------------------------------------------------------------------------------[*]
#if defined(CONFIG_OF)
static const struct of_device_id ioboard_keyled_dt[] = {
{ .compatible = "ioboard-keyled" },
{ },
};
MODULE_DEVICE_TABLE(of, ioboard_keyled_dt);
#endif
static struct platform_driver ioboard_keyled_driver = {
.driver = {
.name = "ioboard-keyled",
.owner = THIS_MODULE,
#if defined(CONFIG_OF)
.of_match_table = of_match_ptr(ioboard_keyled_dt),
#endif
},
.probe = ioboard_keyled_probe,
.remove = ioboard_keyled_remove,
......@@ -334,12 +290,30 @@ static struct platform_driver ioboard_keyled_driver = {
//[*]--------------------------------------------------------------------------------------------------[*]
static int __init ioboard_keyled_init(void)
{
return platform_driver_register(&ioboard_keyled_driver);
int err;
if((err = platform_driver_register(&ioboard_keyled_driver)))
return err;
if((pd = platform_device_alloc("ioboard-keyled", -1)) == NULL) {
err = -ENOMEM;
goto exit_unregister;
}
if((err = platform_device_add(pd)))
goto exit_unregister;
return 0;
exit_unregister:
platform_driver_unregister(&ioboard_keyled_driver);
return err;
}
//[*]--------------------------------------------------------------------------------------------------[*]
static void __exit ioboard_keyled_exit(void)
{
platform_device_unregister(pd);
platform_driver_unregister(&ioboard_keyled_driver);
}
......
......@@ -87,7 +87,7 @@ int ioboard_spi_misc_probe(struct spi_device *spi)
struct ioboard_spi *ioboard_spi = dev_get_drvdata(&spi->dev);
if(!(ioboard_spi->misc = kzalloc(sizeof(struct miscdevice), GFP_KERNEL))) {
if(!(ioboard_spi->misc = devm_kzalloc(&spi->dev, sizeof(struct miscdevice), GFP_KERNEL))) {
printk("ioboard-spi misc struct malloc error!\n");
return -ENOMEM;
}
......@@ -111,9 +111,8 @@ void ioboard_spi_misc_remove(struct device *dev)
{
struct ioboard_spi *ioboard_spi = dev_get_drvdata(dev);
if(ioboard_spi->misc)
misc_deregister(ioboard_spi->misc);
kfree(ioboard_spi->misc);
}
//[*]--------------------------------------------------------------------------------------------------[*]
......
......@@ -30,11 +30,20 @@
#include <linux/of_gpio.h>
#endif
#include <linux/platform_data/spi-s3c64xx.h>
#include "ioboard-spi.h"
//[*]--------------------------------------------------------------------------------------------------[*]
#define SST25WF020_NAME "ioboard-spi"
#define SPI_BUS_NUM 1
#define SPI_CS_NUM 0
#define SPI_CS_GPIO 190 /* GPA2.5(#190) */
#define SPI_WP_GPIO 21 /* GPX1.5(#21) */
#define SPI_BUS_SPEED 10000000
static struct ioboard_spi *ioboard_spi;
//[*]--------------------------------------------------------------------------------------------------[*]
#define SPI_MAX_BUFFER_SIZE 32
......@@ -81,7 +90,6 @@
// 0 : BP1 and BP0 are read/writable (Power-up default value)
#define STATUS_REG_BPL 0x80 // (R/W)
// struct ioboard_spi *ioboard_spi = dev_get_drvdata(&spi->dev);
//[*]--------------------------------------------------------------------------------------------------[*]
int wait_until_ready (struct spi_device *spi, unsigned int check_usec)
{
......@@ -94,7 +102,7 @@ int wait_until_ready (struct spi_device *spi, unsigned int check_usec)
udelay(check_usec);
if(retry_cnt++ >= SPI_MAX_RETRY_CNT) {
printk("%s : timeout error!!\n", __func__); return -1;
pr_err("%s : timeout error!!\n", __func__); return -1;
}
} while(status & STATUS_REG_BUSY);
......@@ -124,7 +132,7 @@ static int ioboard_spi_write_enable (struct spi_device *spi, unsigned char e
spi_write_then_read(spi, &tx, sizeof(tx), NULL, 0);
if(wait_until_ready(spi, 100)) {
printk("%s : error!!\n", __func__); return -1;
pr_err("%s : error!!\n", __func__); return -1;
}
return 0;
}
......@@ -145,7 +153,7 @@ int ioboard_spi_erase (struct spi_device *spi, unsigned int addr, unsigne
tx[0] = mode; tx_size = 1;
break;
default :
printk("%s : Unknown command 0x%02X\n", __func__, mode);
pr_err("%s : Unknown command 0x%02X\n", __func__, mode);
return -1;
}
// write enable
......@@ -181,7 +189,7 @@ static int ioboard_spi_byte_write (struct spi_device *spi, unsigned int addr,
spi_write_then_read(spi, &tx[0], 5, NULL, 0);
if(wait_until_ready(spi, 100)) {
printk("%s : error!!\n", __func__); return -1;
pr_err("%s : error!!\n", __func__); return -1;
}
if(ioboard_spi_write_enable(spi, 0) != 0) return -1; // write disable
......@@ -201,11 +209,11 @@ static int ioboard_spi_read_memory_highspeed (struct spi_device *spi, unsigne
spi_write_then_read(spi, &tx[0], sizeof(tx), &rdata[0], size);
if(wait_until_ready(spi, 100)) {
printk("%s : error!!\n", __func__); return -1;
pr_err("%s : error!!\n", __func__); return -1;
}
if(size == 0) {
printk("%s : read size is 0. error!!\n", __func__); return -1;
pr_err("%s : read size is 0. error!!\n", __func__); return -1;
}
return 0;
......@@ -222,11 +230,11 @@ static int ioboard_spi_read_memory (struct spi_device *spi, unsigne
spi_write_then_read(spi, &tx[0], sizeof(tx), &rdata[0], size);
if(wait_until_ready(spi, 100)) {
printk("%s : error!!\n", __func__); return -1;
pr_err("%s : error!!\n", __func__); return -1;
}
if(size == 0) {
printk("%s : read size is 0. error!!\n", __func__); return -1;
pr_err("%s : read size is 0. error!!\n", __func__); return -1;
}
return 0;
......@@ -258,7 +266,7 @@ int ioboard_spi_write (struct spi_device *spi, unsigned int addr, unsigned cha
unsigned int i;
if(size == 0) {
printk("%s : write size is 0. error!!\n", __func__); return -1;
pr_err("%s : write size is 0. error!!\n", __func__); return -1;
}
for(i = 0; i < size; i++) ioboard_spi_byte_write(spi, addr + i, wdata[i]);
......@@ -275,10 +283,10 @@ static int ioboard_spi_id_read (struct spi_device *spi)
spi_write_then_read(spi, &tx, sizeof(tx), &rx, sizeof(rx));
if(wait_until_ready(spi, 100) != 0) {
printk("%s : ready error!\n", __func__); return -1;
pr_err("%s : ready error!\n", __func__); return -1;
}
printk("%s : id read ! [0x%02X][0x%02X]\n", __func__, rx[0], rx[1]);
pr_info("%s : id read ! [0x%02X][0x%02X]\n", __func__, rx[0], rx[1]);
return 0;
}
......@@ -300,31 +308,20 @@ static int ioboard_spi_write_status_reg (struct spi_device *spi, unsigned char s
return 0;
}
//[*]--------------------------------------------------------------------------------------------------[*]
#if defined(CONFIG_OF)
int wp_gpio = -1;
#else
int wp_gpio = EXYNOS5410_GPX1(5); // GPIO Number
#endif
//[*]--------------------------------------------------------------------------------------
static void ioboard_spi_wp_disable (unsigned char disable)
{
#if defined(CONFIG_OF)
if(wp_gpio < 0) {
printk("%s : write protect gpio not defined!!\n", __func__);
return;
}
#endif
// write protection port init
if(gpio_request(wp_gpio, "ioboard-spi-wp")) {
printk("%s : %s gpio request error!\n", __func__, "ioboard-spi-wp");
if(gpio_request(ioboard_spi->wp_gpio, "ioboard-spi-wp")) {
pr_err("%s : %s gpio request error!(GPIO[%d])\n", __func__, "ioboard-spi-wp", ioboard_spi->wp_gpio);
ioboard_spi->wp_gpio = -1;
}
else {
s3c_gpio_setpull(wp_gpio, S3C_GPIO_PULL_NONE);
s3c_gpio_setpull(ioboard_spi->wp_gpio, S3C_GPIO_PULL_NONE);
// write-protection disable
if(disable) gpio_direction_output(wp_gpio, 1); // write enable
else gpio_direction_output(wp_gpio, 0); // write disable
if(disable) gpio_direction_output(ioboard_spi->wp_gpio, 1); // write enable
else gpio_direction_output(ioboard_spi->wp_gpio, 0); // write disable
}
}
......@@ -340,10 +337,10 @@ static void ioboard_spi_test (struct spi_device *spi)
memset(rdata, 0x00, sizeof(rdata));
ioboard_spi_read (spi, addr, &rdata[0], sizeof(rdata));
printk("\nread before erase : addr = 0x%04X", addr);
pr_info("\nread before erase : addr = 0x%04X", addr);
for(i = 0; i < sizeof(rdata); i++) {
if(!(i % 16)) printk("\n");
printk("[0x%02X] ", rdata[i]);
if(!(i % 16)) pr_info("\n");
pr_info("[0x%02X] ", rdata[i]);
}
ioboard_spi_erase(spi, addr, CMD_ERASE_ALL);
......@@ -352,10 +349,10 @@ static void ioboard_spi_test (struct spi_device *spi)
memset(rdata, 0x00, sizeof(rdata));
ioboard_spi_read (spi, addr, &rdata[0], sizeof(rdata));
printk("\nread after erase : addr = 0x%04X", addr);
pr_info("\nread after erase : addr = 0x%04X", addr);
for(i = 0; i < sizeof(rdata); i++) {
if(!(i % 16)) printk("\n");
printk("[0x%02X] ", rdata[i]);
if(!(i % 16)) pr_info("\n");
pr_info("[0x%02X] ", rdata[i]);
}
ioboard_spi_write(spi, addr, &wdata[0], sizeof(wdata));
......@@ -364,45 +361,27 @@ static void ioboard_spi_test (struct spi_device *spi)
memset(rdata, 0x00, sizeof(rdata));
ioboard_spi_read (spi, 0, &rdata[0], sizeof(rdata));
printk("\nread after write : addr = 0x%04X", addr);
pr_info("\nread after write : addr = 0x%04X", addr);
for(i = 0; i < sizeof(rdata); i++) {
if(!(i % 16)) printk("\n");
printk("[0x%02X] ", rdata[i]);
if(!(i % 16)) pr_info("\n");
pr_info("[0x%02X] ", rdata[i]);
}
}
//[*]--------------------------------------------------------------------------------------------------[*]
static int ioboard_spi_probe (struct spi_device *spi)
{
int ret;
struct ioboard_spi *ioboard_spi;
#if defined(CONFIG_OF)
struct device_node *np = spi->dev.of_node;
wp_gpio = of_get_named_gpio(np, "wp-gpio", 0);
if (!gpio_is_valid(wp_gpio)) wp_gpio = -1;
#endif
if(!(ioboard_spi = kzalloc(sizeof(struct ioboard_spi), GFP_KERNEL))) {
printk("ioboard-spi struct malloc error!\n");
return -ENOMEM;
}
int ret = 0;
ioboard_spi->spi = spi;
ioboard_spi->spi->mode = SPI_MODE_0;
ioboard_spi->spi->bits_per_word = 8;
dev_set_drvdata(&spi->dev, ioboard_spi);
// spi write protection disable
ioboard_spi_wp_disable(1);
if((ret = spi_setup(spi)) < 0) {
printk("%s(%s) fail!\n", __func__, SST25WF020_NAME);
if(ioboard_spi->wp_gpio == -1) {
ret = -1;
goto err;
}
// spi write protection disable
ioboard_spi_wp_disable(1);
dev_set_drvdata(&spi->dev, ioboard_spi);
// read chip id
if((ret = ioboard_spi_id_read(spi)) < 0)
......@@ -413,7 +392,7 @@ static int ioboard_spi_probe (struct spi_device *spi)
goto err;
if((ret = ioboard_spi_misc_probe(spi)) < 0) {
printk("%s : misc driver added fail!\n", __func__);
pr_err("%s : misc driver added fail!\n", __func__);
goto err;
}
......@@ -421,46 +400,35 @@ static int ioboard_spi_probe (struct spi_device *spi)
ioboard_spi_test(spi);
#endif
printk("\n=================== %s ===================\n\n", __func__);
pr_info("\n=================== %s ===================\n\n", __func__);
return 0;
err:
printk("\n=================== %s FAIL! ===================\n\n", __func__);
pr_err("\n=================== %s FAIL! ===================\n\n", __func__);
return ret;
}
//[*]--------------------------------------------------------------------------------------------------[*]
static int ioboard_spi_remove (struct spi_device *spi)
{
struct ioboard_spi *ioboard_spi = dev_get_drvdata(&spi->dev);
if(ioboard_spi->wp_gpio != -1)