@@ -661,8 +661,8 @@ static struct spi_board_info beagledaq_mcspi_board_info[] = {
},
};
-static int mcspi3_cs_gpios[4];
-static int mcspi4_cs_gpios[4];
+int mcspi3_cs_gpios[4];
+int mcspi4_cs_gpios[4];
static void __init beagledaq_init(void)
{
@@ -341,6 +341,9 @@ struct omap_device_pm_latency omap_mcspi_latency[] = {
},
};
+extern int mcspi3_cs_gpios[4];
+extern int mcspi4_cs_gpios[4];
+
static int omap_mcspi_init(struct omap_hwmod *oh, void *unused)
{
struct omap_device *od;
@@ -369,6 +372,18 @@ static int omap_mcspi_init(struct omap_hwmod *oh, void *unused)
return -EINVAL;
}
+ /* HACK: Not enough time to figure out how to export cs_gpios from
+ * board file to driver correctly */
+ if (spi_num == 2) {
+ // Setup McSPI3 cs_gpios
+ pdata->num_cs = 4;
+ pdata->cs_gpios = mcspi3_cs_gpios;
+ } else if (spi_num == 3) {
+ // Setup McSPI4 cs_gpios
+ pdata->num_cs = 4;
+ pdata->cs_gpios = mcspi4_cs_gpios;
+ }
+
spi_num++;
od = omap_device_build(name, spi_num, oh, pdata,
sizeof(*pdata), omap_mcspi_latency,