mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
newton: update irda bu92747 drivers
1.同步newton服务器上的irda代码
This commit is contained in:
@@ -352,7 +352,6 @@ void BU92725GUW_set_trans_way(u32 way)
|
||||
|
||||
/* set bu92725guw registers */
|
||||
/* [Modify] AIC 2011/09/27
|
||||
* MS_EN(TRCR5)¤Ë¤è¤ëͨÐÅ¥â©`¥ÉÇÐÌæ„Ó×÷¤òÐФï¤Ê¤¤¤è¤¦¤ËÐÞÕý¤·¤Þ¤·¤¿¡£
|
||||
*
|
||||
* internal_set(1);
|
||||
*/
|
||||
@@ -714,17 +713,17 @@ static void internal_set(u8 modeChg)
|
||||
break;
|
||||
|
||||
case BU92725GUW_FIR_REV: /* FIR use */
|
||||
val = REG_INT_STFRX | REG_INT_TO | REG_INT_CRC | REG_INT_OE | REG_INT_EOF
|
||||
val = REG_INT_STFRX | REG_INT_TO | REG_INT_CRC | REG_INT_OE | REG_INT_EOF \
|
||||
| REG_INT_AC | REG_INT_DECE; //IER1,2, 4, 5, 6, 7
|
||||
break;
|
||||
|
||||
case BU92725GUW_MULTI_REV: /* not used */
|
||||
val = REG_INT_STFRX | REG_INT_TO | REG_INT_CRC | REG_INT_OE | REG_INT_EOF | REG_INT_AC | REG_INT_DECE
|
||||
val = REG_INT_STFRX | REG_INT_TO | REG_INT_CRC | REG_INT_OE | REG_INT_EOF | REG_INT_AC | REG_INT_DECE \
|
||||
| REG_INT_RDOE | REG_INT_DEX | REG_INT_RDUE; //IER1,2, 4, 5, 6, 7, 8, 9, 10
|
||||
break;
|
||||
|
||||
case BU92725GUW_AUTO_MULTI_REV: /* M/FIR use */
|
||||
val = REG_INT_TO | REG_INT_CRC | REG_INT_OE | REG_INT_EOF | REG_INT_AC | REG_INT_DECE
|
||||
val = REG_INT_TO | REG_INT_CRC | REG_INT_OE | REG_INT_EOF | REG_INT_AC | REG_INT_DECE\
|
||||
| REG_INT_RDOE | REG_INT_DEX | REG_INT_RDE; //IER2, 4, 5, 6, 7, 8, 9, 12
|
||||
break;
|
||||
|
||||
@@ -754,4 +753,9 @@ void BU92725GUW_dump_register(void)
|
||||
printk("IER: 0x%x\n", BU92725GUW_READ_REG(REG_IER_ADDR));
|
||||
}
|
||||
|
||||
|
||||
/* [Add] AIC 2011/09/29 */
|
||||
int BU92725GUW_get_length_in_fifo_buffer(void)
|
||||
{
|
||||
return( (int)BU92725GUW_READ_REG(REG_FLV_ADDR) );
|
||||
}
|
||||
/* [Add-end] AIC 2011/09/29 */
|
||||
|
||||
@@ -227,5 +227,8 @@ int irda_hw_shutdown(void);
|
||||
int irda_hw_startup(void);
|
||||
int irda_hw_set_speed(u32 speed);
|
||||
|
||||
/* [Add] AIC 2011/09/29 */
|
||||
int BU92725GUW_get_length_in_fifo_buffer(void);
|
||||
/* [Add-end] AIC 2011/09/29 */
|
||||
|
||||
#endif /*__BU92725GUW_H*/
|
||||
|
||||
@@ -198,10 +198,6 @@ static int bu92747_irda_do_tx(struct bu92747_port *s)
|
||||
}
|
||||
|
||||
/* [Modify] AIC 2011/09/27
|
||||
* <20><><EFBFBD>ťХåե<C3A5><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǩ`<60><><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˆ<EFBFBD><CB86>}<7D><><EFBFBD><EFBFBD><EFBFBD>ꡢһ<EAA1A2><D2BB><EFBFBD><EFBFBD>
|
||||
* <20>ǩ`<60><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͤ<EFBFBD><CDA4>ʤ<EFBFBD><CAA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD>뤿<EFBFBD><EBA4BF><EFBFBD>ˡ<EFBFBD><CBA1><EFBFBD><EFBFBD>ťǩ`<60><><EFBFBD><EFBFBD>
|
||||
* ȡ<>÷<EFBFBD><C3B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD>
|
||||
*
|
||||
* BU92725GUW_send_data(xmit->buf+xmit->tail, len, NULL, 0);
|
||||
*/
|
||||
if ( (xmit->tail + len) > UART_XMIT_SIZE ) {
|
||||
@@ -269,6 +265,26 @@ static irqreturn_t bu92747_irda_irq(int irqno, void *dev_id)
|
||||
}
|
||||
|
||||
if (irq_src & (REG_INT_DRX | FRM_EVT_RX_EOFRX | FRM_EVT_RX_RDE)) {
|
||||
//fixing CA001 (IrSimple mode sending) failing issue
|
||||
/* modified to process a frame ending processing first, when RDE_EI and EOF_EI are happen at the same time.
|
||||
* Before the modification, disconnect packet was processed as the previous packet,
|
||||
* not as a disconnect packet. The packets were combined.
|
||||
*/
|
||||
if ((irq_src & REG_INT_EOF) && (s->port.state->port.tty != NULL)) {
|
||||
tty_flip_buffer_push(s->port.state->port.tty);
|
||||
if (IS_FIR(s)) {
|
||||
spin_lock(&s->data_lock);
|
||||
if (add_frame_length(f, s->cur_frame_length) == 0) {
|
||||
s->cur_frame_length = 0;
|
||||
}
|
||||
else {
|
||||
printk("func %s,line %d: FIR frame length buf full......\n", __FUNCTION__, __LINE__);
|
||||
}
|
||||
spin_unlock(&s->data_lock);
|
||||
}
|
||||
}
|
||||
//~
|
||||
|
||||
len = bu92747_irda_do_rx(s);
|
||||
if (!IS_FIR(s))
|
||||
tty_flip_buffer_push(s->port.state->port.tty);
|
||||
@@ -280,38 +296,49 @@ static irqreturn_t bu92747_irda_irq(int irqno, void *dev_id)
|
||||
}
|
||||
|
||||
if ((irq_src & REG_INT_EOF) && (s->port.state->port.tty != NULL)) {
|
||||
spin_lock(&s->data_lock); // [Modify] AIC 2011/09/30
|
||||
tty_flip_buffer_push(s->port.state->port.tty);
|
||||
if (IS_FIR(s)) {
|
||||
spin_lock(&s->data_lock);
|
||||
/* [Modify] AIC 2011/09/30
|
||||
* spin_lock(&s->data_lock);
|
||||
*/
|
||||
if (add_frame_length(f, s->cur_frame_length) == 0) {
|
||||
s->cur_frame_length = 0;
|
||||
}
|
||||
else {
|
||||
printk("func %s,line %d: FIR frame length buf full......\n", __FUNCTION__, __LINE__);
|
||||
}
|
||||
spin_unlock(&s->data_lock);
|
||||
/* [Modify] AIC 2011/09/30
|
||||
* spin_unlock(&s->data_lock);
|
||||
*/
|
||||
}
|
||||
spin_unlock(&s->data_lock); // [Modify] AIC 2011/09/30
|
||||
}
|
||||
|
||||
/* [Modify] AIC 2011/09/27
|
||||
* WRE_EI(EIR11)<29><><EFBFBD><EFBFBD><EFBFBD>z<EFBFBD>ߤΕr<CE95><72><EFBFBD>ǡ<EFBFBD><C7A1><EFBFBD><EFBFBD>ť<EFBFBD><C5A5>`<60>ɤ<EFBFBD><C9A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ť<EFBFBD><C5A5>`<60>ɤ<EFBFBD>
|
||||
* <20>Ф<EFBFBD><D0A4>椨<EFBFBD>Ƥ<EFBFBD><C6A4>ޤ<EFBFBD><DEA4>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>ťǩ`<60><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>β<EFBFBD><CEB2>֤<EFBFBD><D6A4><EFBFBD><EFBFBD>Ť<EFBFBD><C5A4><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4><EFBFBD><EFBFBD>Ȥ<EFBFBD>
|
||||
* <20><><EFBFBD>뤿<EFBFBD>ᡢ<EFBFBD><E1A1A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˸<EFBFBD><CBB8><EFBFBD><EFBFBD>z<EFBFBD><7A>(TXE_EI:EIR3)<29><><EFBFBD><EFBFBD><EFBFBD>Ĥ褦<C4A4><E8A4A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD>
|
||||
*
|
||||
* if (irq_src & (FRM_EVT_TX_TXE | FRM_EVT_TX_WRE)) {
|
||||
* s->tx_empty = 1;
|
||||
* irda_hw_set_moderx();
|
||||
* }
|
||||
*/
|
||||
if (irq_src & (FRM_EVT_TX_TXE | FRM_EVT_TX_WRE)) {
|
||||
/* <20><><EFBFBD>Ť<EFBFBD><C5A4>A<EFBFBD><41><EFBFBD><EFBFBD><EFBFBD>Ϥϡ<CFA4><CFA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǴΤΥǩ`<60><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ſ<EFBFBD><C5BF>ܤȤʤ<C8A4> */
|
||||
/* [Modify] AIC 2011/09/29
|
||||
*
|
||||
* if (irq_src & (FRM_EVT_TX_TXE | FRM_EVT_TX_WRE)) {
|
||||
* s->tx_empty = 1;
|
||||
* if ( irq_src & FRM_EVT_TX_TXE ) {
|
||||
* irda_hw_set_moderx();
|
||||
* }
|
||||
*/
|
||||
if ( (irq_src & (FRM_EVT_TX_TXE | FRM_EVT_TX_WRE)) &&
|
||||
(BU92725GUW_get_length_in_fifo_buffer() == 0) ) {
|
||||
s->tx_empty = 1;
|
||||
if (irq_src & FRM_EVT_TX_TXE) {
|
||||
/* <20><>ȫ<EFBFBD><C8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˤȤʤä<CAA4><C3A4><EFBFBD><EFBFBD>ϡ<EFBFBD><CFA1><EFBFBD><EFBFBD>ť<EFBFBD><C5A5>`<60>ɤ<EFBFBD><C9A4>Ф<EFBFBD><D0A4>椨<EFBFBD><E6A4A8> */
|
||||
|
||||
if ( irq_src & FRM_EVT_TX_TXE ) {
|
||||
irda_hw_set_moderx();
|
||||
}
|
||||
}
|
||||
/* [Modify-end] AIC 2011/09/27 */
|
||||
/* [Modify-end] AIC 2011/09/29 */
|
||||
#if 0
|
||||
/* error */
|
||||
if (irq_src & REG_INT_TO) {
|
||||
|
||||
Reference in New Issue
Block a user