diff options
| -rw-r--r-- | drivers/ipack/devices/ipoctal.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/ipack/devices/ipoctal.c b/drivers/ipack/devices/ipoctal.c index 850f10506a79..f2875f0f14d4 100644 --- a/drivers/ipack/devices/ipoctal.c +++ b/drivers/ipack/devices/ipoctal.c | |||
| @@ -177,10 +177,6 @@ static void ipoctal_irq_tx(struct ipoctal_channel *channel) | |||
| 177 | (*pointer_write)++; | 177 | (*pointer_write)++; |
| 178 | *pointer_write = *pointer_write % PAGE_SIZE; | 178 | *pointer_write = *pointer_write % PAGE_SIZE; |
| 179 | channel->nb_bytes--; | 179 | channel->nb_bytes--; |
| 180 | |||
| 181 | if (channel->nb_bytes == 0 && | ||
| 182 | channel->board_id != IPACK1_DEVICE_ID_SBS_OCTAL_485) | ||
| 183 | iowrite8(CR_DISABLE_TX, &channel->regs->w.cr); | ||
| 184 | } | 180 | } |
| 185 | 181 | ||
| 186 | static void ipoctal_irq_channel(struct ipoctal_channel *channel) | 182 | static void ipoctal_irq_channel(struct ipoctal_channel *channel) |
| @@ -196,14 +192,14 @@ static void ipoctal_irq_channel(struct ipoctal_channel *channel) | |||
| 196 | isr = ioread8(&channel->block_regs->r.isr); | 192 | isr = ioread8(&channel->block_regs->r.isr); |
| 197 | sr = ioread8(&channel->regs->r.sr); | 193 | sr = ioread8(&channel->regs->r.sr); |
| 198 | 194 | ||
| 199 | /* In case of RS-485, change from TX to RX when finishing TX. | 195 | if ((sr & SR_TX_EMPTY) && (channel->nb_bytes == 0)) { |
| 200 | * Half-duplex. */ | ||
| 201 | if ((channel->board_id == IPACK1_DEVICE_ID_SBS_OCTAL_485) && | ||
| 202 | (sr & SR_TX_EMPTY) && (channel->nb_bytes == 0)) { | ||
| 203 | iowrite8(CR_DISABLE_TX, &channel->regs->w.cr); | ||
| 204 | iowrite8(CR_CMD_NEGATE_RTSN, &channel->regs->w.cr); | ||
| 205 | iowrite8(CR_ENABLE_RX, &channel->regs->w.cr); | ||
| 206 | iowrite8(CR_DISABLE_TX, &channel->regs->w.cr); | 196 | iowrite8(CR_DISABLE_TX, &channel->regs->w.cr); |
| 197 | /* In case of RS-485, change from TX to RX when finishing TX. | ||
| 198 | * Half-duplex. */ | ||
| 199 | if (channel->board_id == IPACK1_DEVICE_ID_SBS_OCTAL_485) { | ||
| 200 | iowrite8(CR_CMD_NEGATE_RTSN, &channel->regs->w.cr); | ||
| 201 | iowrite8(CR_ENABLE_RX, &channel->regs->w.cr); | ||
| 202 | } | ||
| 207 | } | 203 | } |
| 208 | 204 | ||
| 209 | /* RX data */ | 205 | /* RX data */ |
