@@ -702,6 +702,24 @@ static irqreturn_t lantiq_ssc_err_interrupt(int irq, void *data)
702
702
return IRQ_HANDLED ;
703
703
}
704
704
705
+ static irqreturn_t intel_lgm_ssc_isr (int irq , void * data )
706
+ {
707
+ struct lantiq_ssc_spi * spi = data ;
708
+ const struct lantiq_ssc_hwcfg * hwcfg = spi -> hwcfg ;
709
+ u32 val = lantiq_ssc_readl (spi , hwcfg -> irncr );
710
+
711
+ if (!(val & LTQ_SPI_IRNEN_ALL ))
712
+ return IRQ_NONE ;
713
+
714
+ if (val & LTQ_SPI_IRNEN_E )
715
+ return lantiq_ssc_err_interrupt (irq , data );
716
+
717
+ if ((val & hwcfg -> irnen_t ) || (val & hwcfg -> irnen_r ))
718
+ return lantiq_ssc_xmit_interrupt (irq , data );
719
+
720
+ return IRQ_HANDLED ;
721
+ }
722
+
705
723
static int transfer_start (struct lantiq_ssc_spi * spi , struct spi_device * spidev ,
706
724
struct spi_transfer * t )
707
725
{
@@ -802,6 +820,17 @@ static int lantiq_ssc_transfer_one(struct spi_master *master,
802
820
return transfer_start (spi , spidev , t );
803
821
}
804
822
823
+ static int intel_lgm_cfg_irq (struct platform_device * pdev , struct lantiq_ssc_spi * spi )
824
+ {
825
+ int irq ;
826
+
827
+ irq = platform_get_irq (pdev , 0 );
828
+ if (irq < 0 )
829
+ return irq ;
830
+
831
+ return devm_request_irq (& pdev -> dev , irq , intel_lgm_ssc_isr , 0 , "spi" , spi );
832
+ }
833
+
805
834
static int lantiq_cfg_irq (struct platform_device * pdev , struct lantiq_ssc_spi * spi )
806
835
{
807
836
int irq , err ;
@@ -854,10 +883,21 @@ static const struct lantiq_ssc_hwcfg lantiq_ssc_xrx = {
854
883
.irq_ack = false,
855
884
};
856
885
886
+ static const struct lantiq_ssc_hwcfg intel_ssc_lgm = {
887
+ .cfg_irq = intel_lgm_cfg_irq ,
888
+ .irnen_r = LTQ_SPI_IRNEN_R_XRX ,
889
+ .irnen_t = LTQ_SPI_IRNEN_T_XRX ,
890
+ .irnicr = 0xFC ,
891
+ .irncr = 0xF8 ,
892
+ .fifo_size_mask = GENMASK (7 , 0 ),
893
+ .irq_ack = true,
894
+ };
895
+
857
896
static const struct of_device_id lantiq_ssc_match [] = {
858
897
{ .compatible = "lantiq,ase-spi" , .data = & lantiq_ssc_xway , },
859
898
{ .compatible = "lantiq,falcon-spi" , .data = & lantiq_ssc_xrx , },
860
899
{ .compatible = "lantiq,xrx100-spi" , .data = & lantiq_ssc_xrx , },
900
+ { .compatible = "intel,lgm-spi" , .data = & intel_ssc_lgm , },
861
901
{},
862
902
};
863
903
MODULE_DEVICE_TABLE (of , lantiq_ssc_match );
0 commit comments