--- 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;
}
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)
+ 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;
+
/* 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;
};
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;
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