mediatek: 6.6: refresh patches
[openwrt/staging/nbd.git] / target / linux / mediatek / patches-6.6 / 432-drivers-spi-Add-support-for-dynamic-calibration.patch
index b2c9df4386a446f510d676c3b886cb5f0c2e819f..b5505c803a9685e21ab8128c064533c9a2299e26 100644 (file)
@@ -11,7 +11,7 @@ Signed-off-by: SkyLake.Huang <skylake.huang@mediatek.com>
 
 --- a/drivers/spi/spi.c
 +++ b/drivers/spi/spi.c
-@@ -1385,6 +1385,70 @@ static int spi_transfer_wait(struct spi_
+@@ -1366,6 +1366,70 @@ static int spi_transfer_wait(struct spi_
        return 0;
  }
  
@@ -82,7 +82,7 @@ Signed-off-by: SkyLake.Huang <skylake.huang@mediatek.com>
  static void _spi_transfer_delay_ns(u32 ns)
  {
        if (!ns)
-@@ -2223,6 +2287,75 @@ void spi_flush_queue(struct spi_controll
+@@ -2211,6 +2275,75 @@ void spi_flush_queue(struct spi_controll
  /*-------------------------------------------------------------------------*/
  
  #if defined(CONFIG_OF)
@@ -155,10 +155,10 @@ Signed-off-by: SkyLake.Huang <skylake.huang@mediatek.com>
 +      return 0;
 +}
 +
- static int of_spi_parse_dt(struct spi_controller *ctlr, struct spi_device *spi,
-                          struct device_node *nc)
+ static void of_spi_parse_dt_cs_delay(struct device_node *nc,
+                                    struct spi_delay *delay, const char *prop)
  {
-@@ -2341,6 +2474,10 @@ of_register_spi_device(struct spi_contro
+@@ -2350,6 +2483,10 @@ of_register_spi_device(struct spi_contro
        if (rc)
                goto err_out;
  
@@ -168,10 +168,10 @@ Signed-off-by: SkyLake.Huang <skylake.huang@mediatek.com>
 +
        /* Store a pointer to the node in the device structure */
        of_node_get(nc);
-       spi->dev.of_node = nc;
 --- a/include/linux/spi/spi.h
 +++ b/include/linux/spi/spi.h
-@@ -318,6 +318,40 @@ struct spi_driver {
+@@ -330,6 +330,40 @@ struct spi_driver {
        struct device_driver    driver;
  };
  
@@ -212,7 +212,7 @@ Signed-off-by: SkyLake.Huang <skylake.huang@mediatek.com>
  static inline struct spi_driver *to_spi_driver(struct device_driver *drv)
  {
        return drv ? container_of(drv, struct spi_driver, driver) : NULL;
-@@ -703,6 +737,11 @@ struct spi_controller {
+@@ -727,6 +761,11 @@ struct spi_controller {
        void                    *dummy_rx;
        void                    *dummy_tx;
  
@@ -224,13 +224,13 @@ Signed-off-by: SkyLake.Huang <skylake.huang@mediatek.com>
        int (*fw_translate_cs)(struct spi_controller *ctlr, unsigned cs);
  
        /*
-@@ -1510,6 +1549,9 @@ spi_register_board_info(struct spi_board
+@@ -1600,6 +1639,9 @@ spi_register_board_info(struct spi_board
        { return 0; }
  #endif
  
 +extern int spi_do_calibration(struct spi_controller *ctlr,
 +      struct spi_device *spi, int (*cal_read)(void *, u32 *, int, u8 *, int), void *drv_priv);
 +
- /* If you're hotplugging an adapter with devices (parport, usb, etc)
+ /*
+  * If you're hotplugging an adapter with devices (parport, USB, etc)
   * use spi_new_device() to describe each device.  You can also call
-  * spi_unregister_device() to start making that device vanish, but