mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
change fpga_gpio interrupt trigger type name
This commit is contained in:
@@ -71,11 +71,12 @@ static void spi_fpga_trans_work_handler(struct work_struct *work)
|
||||
{
|
||||
struct spi_fpga_port *port =
|
||||
container_of(work, struct spi_fpga_port, fpga_trans_work);
|
||||
|
||||
unsigned long flags;
|
||||
spin_lock_irqsave(&port->work_lock, flags);
|
||||
while (!list_empty(&port->trans_queue))
|
||||
{
|
||||
struct spi_fpga_transfer *t = NULL;
|
||||
list_for_each_entry(t, &port->trans_queue, queue)
|
||||
struct spi_fpga_transfer *t = NULL, *tmp;
|
||||
list_for_each_entry_safe(t, tmp, &port->trans_queue, queue)
|
||||
{
|
||||
|
||||
if (t->id == 0)
|
||||
@@ -90,11 +91,12 @@ static void spi_fpga_trans_work_handler(struct work_struct *work)
|
||||
break;
|
||||
|
||||
}
|
||||
kfree(t);
|
||||
kfree(t->txbuf);
|
||||
kfree(t);
|
||||
}
|
||||
list_del_init(&port->trans_queue);
|
||||
}
|
||||
spin_unlock_irqrestore(&port->work_lock, flags);
|
||||
|
||||
}
|
||||
|
||||
@@ -468,7 +470,7 @@ static irqreturn_t spi_fpga_irq(int irq, void *dev_id)
|
||||
}
|
||||
|
||||
|
||||
static int spi_open_sysclk(int set)
|
||||
static int spi_set_sysclk(int set)
|
||||
{
|
||||
int ret;
|
||||
ret = gpio_request(SPI_FPGA_STANDBY_PIN, NULL);
|
||||
@@ -526,7 +528,7 @@ static int __devinit spi_fpga_probe(struct spi_device * spi)
|
||||
mutex_init(&port->spi_lock);
|
||||
spin_lock_init(&port->work_lock);
|
||||
|
||||
spi_open_sysclk(GPIO_HIGH);
|
||||
spi_set_sysclk(GPIO_HIGH);
|
||||
|
||||
#if SPI_FPGA_TRANS_WORK
|
||||
init_waitqueue_head(&port->wait_wq);
|
||||
@@ -534,7 +536,7 @@ static int __devinit spi_fpga_probe(struct spi_device * spi)
|
||||
port->write_en = TRUE;
|
||||
port->read_en = TRUE;
|
||||
sprintf(b, "fpga_trans_workqueue");
|
||||
port->fpga_trans_workqueue = create_freezeable_workqueue(b);
|
||||
port->fpga_trans_workqueue = create_rt_workqueue(b);
|
||||
if (!port->fpga_trans_workqueue) {
|
||||
printk("cannot create workqueue\n");
|
||||
return -EBUSY;
|
||||
@@ -545,7 +547,7 @@ static int __devinit spi_fpga_probe(struct spi_device * spi)
|
||||
|
||||
//spi_fpga_rst();
|
||||
sprintf(b, "fpga_irq_workqueue");
|
||||
port->fpga_irq_workqueue = create_freezeable_workqueue(b);
|
||||
port->fpga_irq_workqueue = create_rt_workqueue(b);
|
||||
if (!port->fpga_irq_workqueue) {
|
||||
printk("cannot create workqueue\n");
|
||||
return -EBUSY;
|
||||
|
||||
@@ -877,10 +877,10 @@ static int _spi_gpio_irq_set_type(unsigned int irq, unsigned int type)
|
||||
}
|
||||
switch(type)
|
||||
{
|
||||
case GPIOEdgelFalling:
|
||||
case IRQF_TRIGGER_FALLING:
|
||||
int_type = SPI_GPIO_EDGE_FALLING;
|
||||
break;
|
||||
case GPIOEdgelRising:
|
||||
case IRQF_TRIGGER_RISING:
|
||||
int_type = SPI_GPIO_EDGE_RISING;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -153,7 +153,12 @@ int spi_i2c_readbuf(struct spi_fpga_port *port ,struct i2c_msg *pmsg,int ch)
|
||||
spi_out(port,reg,len,SEL_I2C);
|
||||
|
||||
#if SPI_FPGA_I2C_EVENT
|
||||
wait_event_timeout(port->i2c.wait_r, port->i2c.interrupt == INT_I2C_READ_ACK, msecs_to_jiffies(30));
|
||||
ret = wait_event_timeout(port->i2c.wait_r, port->i2c.interrupt == INT_I2C_READ_ACK, msecs_to_jiffies(60));
|
||||
if(ret == 0)
|
||||
{
|
||||
printk("%s:60ms time out!\n",__FUNCTION__);
|
||||
return -1;
|
||||
}
|
||||
for(i = 0;i<len;i++)
|
||||
{
|
||||
result = spi_in(port,channel,SEL_I2C);
|
||||
@@ -238,7 +243,12 @@ int spi_i2c_writebuf(struct spi_fpga_port *port ,struct i2c_msg *pmsg,int ch)
|
||||
reg = channel|ICE_SEL_I2C_STOP;
|
||||
spi_out(port,reg,pmsg->buf[i],SEL_I2C);
|
||||
#if SPI_FPGA_I2C_EVENT
|
||||
wait_event_timeout(port->i2c.wait_w, port->i2c.interrupt == INT_I2C_WRITE_ACK, msecs_to_jiffies(30));
|
||||
ret = wait_event_timeout(port->i2c.wait_w, port->i2c.interrupt == INT_I2C_WRITE_ACK, msecs_to_jiffies(60));
|
||||
if(ret == 0)
|
||||
{
|
||||
printk("%s:60ms time out!\n",__FUNCTION__);
|
||||
return -1;
|
||||
}
|
||||
spin_lock(&port->i2c.i2c_lock);
|
||||
port->i2c.interrupt &= INT_I2C_WRITE_MASK;
|
||||
spin_unlock(&port->i2c.i2c_lock);
|
||||
|
||||
Reference in New Issue
Block a user