Message ID | 1412711297-31857-2-git-send-email-tthayer@opensource.altera.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 10/07/2014 02:48 PM, tthayer@opensource.altera.com wrote: > From: Thor Thayer <tthayer@opensource.altera.com> > > 1. The of_node element must be initialized to enable discovery of node > children. The discovery takes place in the of_register_spi_devices() function. > 2. Grabbing the bus-num from the device tree. > 3. Update the SOCFPGA configuration. updating the socfpga_defconfig should be a separate patch. Dinh -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 10/07/2014 02:42 PM, Dinh Nguyen wrote: > On 10/07/2014 02:48 PM, tthayer@opensource.altera.com wrote: >> From: Thor Thayer <tthayer@opensource.altera.com> >> >> 1. The of_node element must be initialized to enable discovery of node >> children. The discovery takes place in the of_register_spi_devices() function. >> 2. Grabbing the bus-num from the device tree. >> 3. Update the SOCFPGA configuration. > updating the socfpga_defconfig should be a separate patch. > > Dinh OK, I will remove it. Thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Tue, Oct 07, 2014 at 02:48:16PM -0500, tthayer@opensource.altera.com wrote: > From: Thor Thayer <tthayer@opensource.altera.com> > > 1. The of_node element must be initialized to enable discovery of node > children. The discovery takes place in the of_register_spi_devices() function. > 2. Grabbing the bus-num from the device tree. > 3. Update the SOCFPGA configuration. No, each of these should be in a separate patch - it's especially bad to be updating the defconfig in the same patch as the driver, these changes should be totally unrelated.
On 10/07/2014 03:40 PM, Mark Brown wrote: > On Tue, Oct 07, 2014 at 02:48:16PM -0500, tthayer@opensource.altera.com wrote: >> From: Thor Thayer <tthayer@opensource.altera.com> >> >> 1. The of_node element must be initialized to enable discovery of node >> children. The discovery takes place in the of_register_spi_devices() function. >> 2. Grabbing the bus-num from the device tree. >> 3. Update the SOCFPGA configuration. > No, each of these should be in a separate patch - it's especially bad to > be updating the defconfig in the same patch as the driver, these changes > should be totally unrelated. OK. I will split these and remove the defconfig. Dinh pointed the defconfig issue out to me as well. Thanks for reviewing, Thor -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Tue, 2014-10-07 at 14:48 -0500, tthayer@opensource.altera.com wrote: > From: Thor Thayer <tthayer@opensource.altera.com> > > 1. The of_node element must be initialized to enable discovery of node > children. The discovery takes place in the of_register_spi_devices() function. > 2. Grabbing the bus-num from the device tree. > 3. Update the SOCFPGA configuration. [] > --- a/drivers/spi/spi-dw.c > +++ b/drivers/spi/spi-dw.c > @@ -671,6 +671,9 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws) > master->cleanup = dw_spi_cleanup; > master->transfer_one_message = dw_spi_transfer_one_message; > master->max_speed_hz = dws->max_freq; > +#if defined(CONFIG_OF) > + master->dev.of_node = dev->of_node; > +#endif I'm not sure you need this #ifdef surrounded an assignment. If I'm wrong then you probably have to use if (IS_ENABLED(CONFIG_OF)).
On 10/08/2014 03:17 AM, Andy Shevchenko wrote: > On Tue, 2014-10-07 at 14:48 -0500, tthayer@opensource.altera.com wrote: >> From: Thor Thayer <tthayer@opensource.altera.com> >> >> 1. The of_node element must be initialized to enable discovery of node >> children. The discovery takes place in the of_register_spi_devices() function. >> 2. Grabbing the bus-num from the device tree. >> 3. Update the SOCFPGA configuration. > [] > >> --- a/drivers/spi/spi-dw.c >> +++ b/drivers/spi/spi-dw.c >> @@ -671,6 +671,9 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws) >> master->cleanup = dw_spi_cleanup; >> master->transfer_one_message = dw_spi_transfer_one_message; >> master->max_speed_hz = dws->max_freq; >> +#if defined(CONFIG_OF) >> + master->dev.of_node = dev->of_node; >> +#endif > I'm not sure you need this #ifdef surrounded an assignment. > If I'm wrong then you probably have to use if (IS_ENABLED(CONFIG_OF)). > Hi Andy. Good point. I will remove those. Thank you for reviewing. -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/arch/arm/configs/socfpga_defconfig b/arch/arm/configs/socfpga_defconfig index d7a5855..54f3540 100644 --- a/arch/arm/configs/socfpga_defconfig +++ b/arch/arm/configs/socfpga_defconfig @@ -52,6 +52,7 @@ CONFIG_CAN_C_CAN_PLATFORM=y CONFIG_CAN_DEBUG_DEVICES=y CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" CONFIG_DEVTMPFS=y +CONFIG_DEVTMPFS_MOUNT=y CONFIG_PROC_DEVICETREE=y CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_COUNT=2 diff --git a/drivers/spi/spi-dw-mmio.c b/drivers/spi/spi-dw-mmio.c index 21ce0e3..b8483057 100644 --- a/drivers/spi/spi-dw-mmio.c +++ b/drivers/spi/spi-dw-mmio.c @@ -82,7 +82,10 @@ static int dw_spi_mmio_probe(struct platform_device *pdev) dws->num_cs = num_cs; if (pdev->dev.of_node) { - int i; + int i, prop; + + if (!of_property_read_u32(pdev->dev.of_node, "bus-num", &prop)) + dws->bus_num = prop; for (i = 0; i < dws->num_cs; i++) { int cs_gpio = of_get_named_gpio(pdev->dev.of_node, diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c index 0dd0623..d8be9f9 100644 --- a/drivers/spi/spi-dw.c +++ b/drivers/spi/spi-dw.c @@ -671,6 +671,9 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws) master->cleanup = dw_spi_cleanup; master->transfer_one_message = dw_spi_transfer_one_message; master->max_speed_hz = dws->max_freq; +#if defined(CONFIG_OF) + master->dev.of_node = dev->of_node; +#endif /* Basic HW init */ spi_hw_init(dws);