@@ -160,6 +160,7 @@ struct lantiq_ssc_hwcfg {
160
160
unsigned int irnen_t ;
161
161
unsigned int irncr ;
162
162
unsigned int irnicr ;
163
+ bool irq_ack ;
163
164
};
164
165
165
166
struct lantiq_ssc_spi {
@@ -622,9 +623,14 @@ static void rx_request(struct lantiq_ssc_spi *spi)
622
623
static irqreturn_t lantiq_ssc_xmit_interrupt (int irq , void * data )
623
624
{
624
625
struct lantiq_ssc_spi * spi = data ;
626
+ const struct lantiq_ssc_hwcfg * hwcfg = spi -> hwcfg ;
627
+ u32 val = lantiq_ssc_readl (spi , hwcfg -> irncr );
625
628
unsigned long flags ;
626
629
627
630
spin_lock_irqsave (& spi -> lock , flags );
631
+ if (hwcfg -> irq_ack )
632
+ lantiq_ssc_writel (spi , val , hwcfg -> irncr );
633
+
628
634
if (spi -> tx ) {
629
635
if (spi -> rx && spi -> rx_todo )
630
636
rx_fifo_read_full_duplex (spi );
@@ -659,13 +665,18 @@ static irqreturn_t lantiq_ssc_xmit_interrupt(int irq, void *data)
659
665
static irqreturn_t lantiq_ssc_err_interrupt (int irq , void * data )
660
666
{
661
667
struct lantiq_ssc_spi * spi = data ;
668
+ const struct lantiq_ssc_hwcfg * hwcfg = spi -> hwcfg ;
662
669
u32 stat = lantiq_ssc_readl (spi , LTQ_SPI_STAT );
670
+ u32 val = lantiq_ssc_readl (spi , hwcfg -> irncr );
663
671
unsigned long flags ;
664
672
665
673
if (!(stat & LTQ_SPI_STAT_ERRORS ))
666
674
return IRQ_NONE ;
667
675
668
676
spin_lock_irqsave (& spi -> lock , flags );
677
+ if (hwcfg -> irq_ack )
678
+ lantiq_ssc_writel (spi , val , hwcfg -> irncr );
679
+
669
680
if (stat & LTQ_SPI_STAT_RUE )
670
681
dev_err (spi -> dev , "receive underflow error\n" );
671
682
if (stat & LTQ_SPI_STAT_TUE )
@@ -796,13 +807,15 @@ static const struct lantiq_ssc_hwcfg lantiq_ssc_xway = {
796
807
.irnen_t = LTQ_SPI_IRNEN_T_XWAY ,
797
808
.irnicr = 0xF8 ,
798
809
.irncr = 0xFC ,
810
+ .irq_ack = false,
799
811
};
800
812
801
813
static const struct lantiq_ssc_hwcfg lantiq_ssc_xrx = {
802
814
.irnen_r = LTQ_SPI_IRNEN_R_XRX ,
803
815
.irnen_t = LTQ_SPI_IRNEN_T_XRX ,
804
816
.irnicr = 0xF8 ,
805
817
.irncr = 0xFC ,
818
+ .irq_ack = false,
806
819
};
807
820
808
821
static const struct of_device_id lantiq_ssc_match [] = {
0 commit comments