* [PATCH v1] add axi clock control for MT8192 spi-nor @ 2020-11-11 8:55 Bayi Cheng 2020-11-11 8:55 ` [PATCH v1] spi: spi-mtk-nor: " Bayi Cheng ` (2 more replies) 0 siblings, 3 replies; 5+ messages in thread From: Bayi Cheng @ 2020-11-11 8:55 UTC (permalink / raw) To: Mark Brown Cc: Matthias Brugger, linux-spi, linux-arm-kernel, linux-mediatek, linux-kernel, Ikjoon Jang, Chuanhong Guo, srv_heupstream bayi cheng (1): spi: spi-mtk-nor: add axi clock control for MT8192 spi-nor drivers/spi/spi-mtk-nor.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) -- 1.9.1 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v1] spi: spi-mtk-nor: add axi clock control for MT8192 spi-nor 2020-11-11 8:55 [PATCH v1] add axi clock control for MT8192 spi-nor Bayi Cheng @ 2020-11-11 8:55 ` Bayi Cheng 2020-11-16 9:24 ` Ikjoon Jang 2020-11-16 20:00 ` [PATCH v1] " Mark Brown 2020-11-16 23:33 ` Mark Brown 2 siblings, 1 reply; 5+ messages in thread From: Bayi Cheng @ 2020-11-11 8:55 UTC (permalink / raw) To: Mark Brown Cc: Matthias Brugger, linux-spi, linux-arm-kernel, linux-mediatek, linux-kernel, Ikjoon Jang, Chuanhong Guo, srv_heupstream, bayi cheng From: bayi cheng <bayi.cheng@mediatek.com> MT8192 spi-nor is an independent sub system, we need extra control axi bus clock for it. Add support for the additional axi clock to allow it to be configured appropriately. Signed-off-by: bayi cheng <bayi.cheng@mediatek.com> --- drivers/spi/spi-mtk-nor.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-mtk-nor.c b/drivers/spi/spi-mtk-nor.c index b97f26a..bf2d0f9 100644 --- a/drivers/spi/spi-mtk-nor.c +++ b/drivers/spi/spi-mtk-nor.c @@ -103,6 +103,7 @@ struct mtk_nor { dma_addr_t buffer_dma; struct clk *spi_clk; struct clk *ctlr_clk; + struct clk *axi_clk; unsigned int spi_freq; bool wbuf_en; bool has_irq; @@ -672,6 +673,7 @@ static void mtk_nor_disable_clk(struct mtk_nor *sp) { clk_disable_unprepare(sp->spi_clk); clk_disable_unprepare(sp->ctlr_clk); + clk_disable_unprepare(sp->axi_clk); } static int mtk_nor_enable_clk(struct mtk_nor *sp) @@ -688,6 +690,13 @@ static int mtk_nor_enable_clk(struct mtk_nor *sp) return ret; } + ret = clk_prepare_enable(sp->axi_clk); + if (ret) { + clk_disable_unprepare(sp->spi_clk); + clk_disable_unprepare(sp->ctlr_clk); + return ret; + } + return 0; } @@ -746,7 +755,7 @@ static int mtk_nor_probe(struct platform_device *pdev) struct spi_controller *ctlr; struct mtk_nor *sp; void __iomem *base; - struct clk *spi_clk, *ctlr_clk; + struct clk *spi_clk, *ctlr_clk, *axi_clk; int ret, irq; unsigned long dma_bits; @@ -762,6 +771,10 @@ static int mtk_nor_probe(struct platform_device *pdev) if (IS_ERR(ctlr_clk)) return PTR_ERR(ctlr_clk); + axi_clk = devm_clk_get_optional(&pdev->dev, "axi"); + if (IS_ERR(axi_clk)) + return PTR_ERR(axi_clk); + dma_bits = (unsigned long)of_device_get_match_data(&pdev->dev); if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(dma_bits))) { dev_err(&pdev->dev, "failed to set dma mask(%lu)\n", dma_bits); @@ -794,6 +807,7 @@ static int mtk_nor_probe(struct platform_device *pdev) sp->dev = &pdev->dev; sp->spi_clk = spi_clk; sp->ctlr_clk = ctlr_clk; + sp->axi_clk = axi_clk; sp->high_dma = (dma_bits > 32); sp->buffer = dmam_alloc_coherent(&pdev->dev, MTK_NOR_BOUNCE_BUF_SIZE + MTK_NOR_DMA_ALIGN, -- 1.9.1 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v1] spi: spi-mtk-nor: add axi clock control for MT8192 spi-nor 2020-11-11 8:55 ` [PATCH v1] spi: spi-mtk-nor: " Bayi Cheng @ 2020-11-16 9:24 ` Ikjoon Jang 0 siblings, 0 replies; 5+ messages in thread From: Ikjoon Jang @ 2020-11-16 9:24 UTC (permalink / raw) To: Bayi Cheng Cc: Mark Brown, Matthias Brugger, linux-spi, moderated list:ARM/Mediatek SoC support, moderated list:ARM/Mediatek SoC support, open list, Chuanhong Guo, srv_heupstream On Wed, Nov 11, 2020 at 4:55 PM Bayi Cheng <bayi.cheng@mediatek.com> wrote: > > From: bayi cheng <bayi.cheng@mediatek.com> > > MT8192 spi-nor is an independent sub system, we need extra control axi > bus clock for it. Add support for the additional axi clock to allow it > to be configured appropriately. > > Signed-off-by: bayi cheng <bayi.cheng@mediatek.com> Tested-by: Ikjoon Jang <ikjn@chromium.org> > --- > drivers/spi/spi-mtk-nor.c | 16 +++++++++++++++- > 1 file changed, 15 insertions(+), 1 deletion(-) > > diff --git a/drivers/spi/spi-mtk-nor.c b/drivers/spi/spi-mtk-nor.c > index b97f26a..bf2d0f9 100644 > --- a/drivers/spi/spi-mtk-nor.c > +++ b/drivers/spi/spi-mtk-nor.c > @@ -103,6 +103,7 @@ struct mtk_nor { > dma_addr_t buffer_dma; > struct clk *spi_clk; > struct clk *ctlr_clk; > + struct clk *axi_clk; > unsigned int spi_freq; > bool wbuf_en; > bool has_irq; > @@ -672,6 +673,7 @@ static void mtk_nor_disable_clk(struct mtk_nor *sp) > { > clk_disable_unprepare(sp->spi_clk); > clk_disable_unprepare(sp->ctlr_clk); > + clk_disable_unprepare(sp->axi_clk); > } > > static int mtk_nor_enable_clk(struct mtk_nor *sp) > @@ -688,6 +690,13 @@ static int mtk_nor_enable_clk(struct mtk_nor *sp) > return ret; > } > > + ret = clk_prepare_enable(sp->axi_clk); > + if (ret) { > + clk_disable_unprepare(sp->spi_clk); > + clk_disable_unprepare(sp->ctlr_clk); > + return ret; > + } > + > return 0; > } > > @@ -746,7 +755,7 @@ static int mtk_nor_probe(struct platform_device *pdev) > struct spi_controller *ctlr; > struct mtk_nor *sp; > void __iomem *base; > - struct clk *spi_clk, *ctlr_clk; > + struct clk *spi_clk, *ctlr_clk, *axi_clk; > int ret, irq; > unsigned long dma_bits; > > @@ -762,6 +771,10 @@ static int mtk_nor_probe(struct platform_device *pdev) > if (IS_ERR(ctlr_clk)) > return PTR_ERR(ctlr_clk); > > + axi_clk = devm_clk_get_optional(&pdev->dev, "axi"); > + if (IS_ERR(axi_clk)) > + return PTR_ERR(axi_clk); > + > dma_bits = (unsigned long)of_device_get_match_data(&pdev->dev); > if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(dma_bits))) { > dev_err(&pdev->dev, "failed to set dma mask(%lu)\n", dma_bits); > @@ -794,6 +807,7 @@ static int mtk_nor_probe(struct platform_device *pdev) > sp->dev = &pdev->dev; > sp->spi_clk = spi_clk; > sp->ctlr_clk = ctlr_clk; > + sp->axi_clk = axi_clk; > sp->high_dma = (dma_bits > 32); > sp->buffer = dmam_alloc_coherent(&pdev->dev, > MTK_NOR_BOUNCE_BUF_SIZE + MTK_NOR_DMA_ALIGN, > -- > 1.9.1 > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v1] add axi clock control for MT8192 spi-nor 2020-11-11 8:55 [PATCH v1] add axi clock control for MT8192 spi-nor Bayi Cheng 2020-11-11 8:55 ` [PATCH v1] spi: spi-mtk-nor: " Bayi Cheng @ 2020-11-16 20:00 ` Mark Brown 2020-11-16 23:33 ` Mark Brown 2 siblings, 0 replies; 5+ messages in thread From: Mark Brown @ 2020-11-16 20:00 UTC (permalink / raw) To: Bayi Cheng Cc: Matthias Brugger, linux-spi, linux-arm-kernel, linux-mediatek, linux-kernel, Ikjoon Jang, Chuanhong Guo, srv_heupstream [-- Attachment #1: Type: text/plain, Size: 450 bytes --] On Wed, Nov 11, 2020 at 04:55:01PM +0800, Bayi Cheng wrote: > bayi cheng (1): > spi: spi-mtk-nor: add axi clock control for MT8192 spi-nor Please don't send cover letters for single patches, if there is anything that needs saying put it in the changelog of the patch or after the --- if it's administrative stuff. This reduces mail volume and ensures that any important information is recorded in the changelog rather than being lost. [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 488 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v1] add axi clock control for MT8192 spi-nor 2020-11-11 8:55 [PATCH v1] add axi clock control for MT8192 spi-nor Bayi Cheng 2020-11-11 8:55 ` [PATCH v1] spi: spi-mtk-nor: " Bayi Cheng 2020-11-16 20:00 ` [PATCH v1] " Mark Brown @ 2020-11-16 23:33 ` Mark Brown 2 siblings, 0 replies; 5+ messages in thread From: Mark Brown @ 2020-11-16 23:33 UTC (permalink / raw) To: Bayi Cheng Cc: linux-spi, srv_heupstream, linux-mediatek, Chuanhong Guo, linux-kernel, linux-arm-kernel, Ikjoon Jang, Matthias Brugger On Wed, 11 Nov 2020 16:55:01 +0800, Bayi Cheng wrote: > bayi cheng (1): > spi: spi-mtk-nor: add axi clock control for MT8192 spi-nor > > drivers/spi/spi-mtk-nor.c | 16 +++++++++++++++- > 1 file changed, 15 insertions(+), 1 deletion(-) > > -- > 1.9.1 > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next Thanks! [1/1] spi: spi-mtk-nor: add axi clock control for MT8192 spi-nor commit: f32cce8483f18a098ae50b524f926ef0f2bd2e12 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 ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-11-16 23:34 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2020-11-11 8:55 [PATCH v1] add axi clock control for MT8192 spi-nor Bayi Cheng 2020-11-11 8:55 ` [PATCH v1] spi: spi-mtk-nor: " Bayi Cheng 2020-11-16 9:24 ` Ikjoon Jang 2020-11-16 20:00 ` [PATCH v1] " Mark Brown 2020-11-16 23:33 ` 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).