* [PATCH] spi: fsl-dspi: Set max_speed_hz for master @ 2016-03-21 20:11 Bhuvanchandra DV [not found] ` <1458591112-2743-1-git-send-email-bhuvanchandra.dv-2KBjVHiyJgBBDgjK7y7TUQ@public.gmane.org> 0 siblings, 1 reply; 3+ messages in thread From: Bhuvanchandra DV @ 2016-03-21 20:11 UTC (permalink / raw) To: broonie-DgEjT+Ai2ygdnm+yROfE0A, shawnguo-DgEjT+Ai2ygdnm+yROfE0A, kernel-bIcnvbaLZ9MEGnE8C9+IrQ Cc: stefan-XLVq0VzYD2Y, haikun.wang-KZfg59tc24xl57MIdRCFDg, han.xu-3arQi8VN3Tc, linux-spi-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Bhuvanchandra DV Calculate and update max speed from bus clock for SoC's using DSPI IP. The bus clock factor's are taken from the data sheet's of respective SoC's. Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv-2KBjVHiyJgBBDgjK7y7TUQ@public.gmane.org> --- drivers/spi/spi-fsl-dspi.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c index 59a1143..8753276 100644 --- a/drivers/spi/spi-fsl-dspi.c +++ b/drivers/spi/spi-fsl-dspi.c @@ -121,18 +121,22 @@ enum dspi_trans_mode { struct fsl_dspi_devtype_data { enum dspi_trans_mode trans_mode; + u8 max_clock_factor; }; static const struct fsl_dspi_devtype_data vf610_data = { .trans_mode = DSPI_EOQ_MODE, + .max_clock_factor = 2, }; static const struct fsl_dspi_devtype_data ls1021a_v1_data = { .trans_mode = DSPI_TCFQ_MODE, + .max_clock_factor = 8, }; static const struct fsl_dspi_devtype_data ls2085a_data = { .trans_mode = DSPI_TCFQ_MODE, + .max_clock_factor = 8, }; struct fsl_dspi { @@ -726,6 +730,9 @@ static int dspi_probe(struct platform_device *pdev) } clk_prepare_enable(dspi->clk); + master->max_speed_hz = + clk_get_rate(dspi->clk) / dspi->devtype_data->max_clock_factor; + init_waitqueue_head(&dspi->waitq); platform_set_drvdata(pdev, master); -- 2.7.3 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 3+ messages in thread
[parent not found: <1458591112-2743-1-git-send-email-bhuvanchandra.dv-2KBjVHiyJgBBDgjK7y7TUQ@public.gmane.org>]
* Re: [PATCH] spi: fsl-dspi: Set max_speed_hz for master [not found] ` <1458591112-2743-1-git-send-email-bhuvanchandra.dv-2KBjVHiyJgBBDgjK7y7TUQ@public.gmane.org> @ 2016-03-23 6:35 ` Stefan Agner 2016-03-23 13:55 ` Applied "spi: fsl-dspi: Set max_speed_hz for master" to the spi tree Mark Brown 1 sibling, 0 replies; 3+ messages in thread From: Stefan Agner @ 2016-03-23 6:35 UTC (permalink / raw) To: Bhuvanchandra DV Cc: broonie-DgEjT+Ai2ygdnm+yROfE0A, shawnguo-DgEjT+Ai2ygdnm+yROfE0A, kernel-bIcnvbaLZ9MEGnE8C9+IrQ, haikun.wang-KZfg59tc24xl57MIdRCFDg, han.xu-3arQi8VN3Tc, linux-spi-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA On 2016-03-21 13:11, Bhuvanchandra DV wrote: > Calculate and update max speed from bus clock for SoC's > using DSPI IP. > > The bus clock factor's are taken from the data sheet's > of respective SoC's. Plurals are without apostrophe... I wonder if GCC optimizes this to a bit shift... Acked-by: Stefan Agner <stefan-XLVq0VzYD2Y@public.gmane.org> > > Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv-2KBjVHiyJgBBDgjK7y7TUQ@public.gmane.org> > --- > drivers/spi/spi-fsl-dspi.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c > index 59a1143..8753276 100644 > --- a/drivers/spi/spi-fsl-dspi.c > +++ b/drivers/spi/spi-fsl-dspi.c > @@ -121,18 +121,22 @@ enum dspi_trans_mode { > > struct fsl_dspi_devtype_data { > enum dspi_trans_mode trans_mode; > + u8 max_clock_factor; > }; > > static const struct fsl_dspi_devtype_data vf610_data = { > .trans_mode = DSPI_EOQ_MODE, > + .max_clock_factor = 2, > }; > > static const struct fsl_dspi_devtype_data ls1021a_v1_data = { > .trans_mode = DSPI_TCFQ_MODE, > + .max_clock_factor = 8, > }; > > static const struct fsl_dspi_devtype_data ls2085a_data = { > .trans_mode = DSPI_TCFQ_MODE, > + .max_clock_factor = 8, > }; > > struct fsl_dspi { > @@ -726,6 +730,9 @@ static int dspi_probe(struct platform_device *pdev) > } > clk_prepare_enable(dspi->clk); > > + master->max_speed_hz = > + clk_get_rate(dspi->clk) / dspi->devtype_data->max_clock_factor; > + > init_waitqueue_head(&dspi->waitq); > platform_set_drvdata(pdev, master); -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 3+ messages in thread
* Applied "spi: fsl-dspi: Set max_speed_hz for master" to the spi tree [not found] ` <1458591112-2743-1-git-send-email-bhuvanchandra.dv-2KBjVHiyJgBBDgjK7y7TUQ@public.gmane.org> 2016-03-23 6:35 ` Stefan Agner @ 2016-03-23 13:55 ` Mark Brown 1 sibling, 0 replies; 3+ messages in thread From: Mark Brown @ 2016-03-23 13:55 UTC (permalink / raw) To: Bhuvanchandra DV, Stefan Agner, Mark Brown Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA The patch spi: fsl-dspi: Set max_speed_hz for master has been applied to the spi tree at git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From 9419b2006cf47c75985ea51d36ddc51346d29efd Mon Sep 17 00:00:00 2001 From: Bhuvanchandra DV <bhuvanchandra.dv-2KBjVHiyJgBBDgjK7y7TUQ@public.gmane.org> Date: Tue, 22 Mar 2016 01:41:52 +0530 Subject: [PATCH] spi: fsl-dspi: Set max_speed_hz for master Calculate and update max speed from bus clock for SoCs using DSPI IP. The bus clock factor's are taken from the data sheets of respective SoCs. Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv-2KBjVHiyJgBBDgjK7y7TUQ@public.gmane.org> Acked-by: Stefan Agner <stefan-XLVq0VzYD2Y@public.gmane.org> Signed-off-by: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> --- drivers/spi/spi-fsl-dspi.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c index 39412c9097c6..559ed70fd229 100644 --- a/drivers/spi/spi-fsl-dspi.c +++ b/drivers/spi/spi-fsl-dspi.c @@ -121,18 +121,22 @@ enum dspi_trans_mode { struct fsl_dspi_devtype_data { enum dspi_trans_mode trans_mode; + u8 max_clock_factor; }; static const struct fsl_dspi_devtype_data vf610_data = { .trans_mode = DSPI_EOQ_MODE, + .max_clock_factor = 2, }; static const struct fsl_dspi_devtype_data ls1021a_v1_data = { .trans_mode = DSPI_TCFQ_MODE, + .max_clock_factor = 8, }; static const struct fsl_dspi_devtype_data ls2085a_data = { .trans_mode = DSPI_TCFQ_MODE, + .max_clock_factor = 8, }; struct fsl_dspi { @@ -726,6 +730,9 @@ static int dspi_probe(struct platform_device *pdev) } clk_prepare_enable(dspi->clk); + master->max_speed_hz = + clk_get_rate(dspi->clk) / dspi->devtype_data->max_clock_factor; + init_waitqueue_head(&dspi->waitq); platform_set_drvdata(pdev, master); -- 2.7.0 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-03-23 13:55 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-03-21 20:11 [PATCH] spi: fsl-dspi: Set max_speed_hz for master Bhuvanchandra DV [not found] ` <1458591112-2743-1-git-send-email-bhuvanchandra.dv-2KBjVHiyJgBBDgjK7y7TUQ@public.gmane.org> 2016-03-23 6:35 ` Stefan Agner 2016-03-23 13:55 ` Applied "spi: fsl-dspi: Set max_speed_hz for master" to the spi tree Mark Brown
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).