summaryrefslogtreecommitdiff
path: root/drivers/spi/spi-mtk-snfi.c
AgeCommit message (Collapse)AuthorFilesLines
2023-09-12spi: Use devm_clk_get_*() helper function toMark Brown1-52/+9
Merge series from Li Zetao <lizetao1@huawei.com>: Commit 7ef9651e9792 ("clk: Provide new devm_clk helpers for prepared and enabled clocks") provides a new helper function for prepared and enabled clocks when a driver keeps a clock prepared (or enabled) during the whole lifetime of the driver. So where drivers get clocks and enable them immediately, it can be combined into a single function devm_clk_get_*(). Moreover, the unprepare and disable function has been registered to devm_clk_state, and before devm_clk_state is released, the clocks will be unprepareed and disable, so it is unnecessary to unprepare and disable clocks explicitly when remove drivers or in the error handling path.
2023-09-11spi: mtk-snfi: Use helper function devm_clk_get_enabled()Li Zetao1-52/+9
Since commit 7ef9651e9792 ("clk: Provide new devm_clk helpers for prepared and enabled clocks"), devm_clk_get() and clk_prepare_enable() can now be replaced by devm_clk_get_enabled() when driver enables (and possibly prepares) the clocks for the whole lifetime of the device. Moreover, it is no longer necessary to unprepare and disable the clocks explicitly. Also, devm_clk_get_optional() and clk_prepare_enable() can now be replaced by devm_clk_get_optional_enabled().Moreover, the two functions mtk_snand_enable_clk() and mtk_snand_disable_clk() no longer are used, drop them for clean code. Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Li Zetao <lizetao1@huawei.com> Link: https://lore.kernel.org/r/20230823133938.1359106-20-lizetao1@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11spi: mtk-snfi: switch to use modern nameYang Yingliang1-3/+3
Change legacy name master to modern name host or controller. No functional changed. Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20230823033003.3407403-14-yangyingliang@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-14spi: Explicitly include correct DT includesRob Herring1-1/+2
The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it as merged into the regular platform bus. As part of that merge prepping Arm DT support 13 years ago, they "temporarily" include each other. They also include platform_device.h and of.h. As a result, there's a pretty much random mix of those include files used throughout the tree. In order to detangle these headers and replace the implicit includes with struct declarations, users need to explicitly include the correct includes. Signed-off-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20230714174955.4064174-1-robh@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2023-03-07spi: mtk-snfi: Convert to platform remove callback returning voidUwe Kleine-König1-3/+2
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20230303172041.2103336-43-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-09spi: mtk-snfi: Add snfi sample delay and read latency adjustmentXiangsheng Hou1-0/+20
Add snfi sample delay and read latency adjustment which can get from dts property. Signed-off-by: Xiangsheng Hou <xiangsheng.hou@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20230201020921.26712-5-xiangsheng.hou@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-09spi: mtk-snfi: Add optional nfi_hclk which is needed for MT7986Xiangsheng Hou1-0/+18
Add optional nfi_hclk which is needed for MT7986. Signed-off-by: Xiangsheng Hou <xiangsheng.hou@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20230201020921.26712-3-xiangsheng.hou@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-09spi: mtk-snfi: Change default page format to setup default settingXiangsheng Hou1-2/+1
Change default page format to setup default setting since the sector size 1024 on MT7986 will lead to probe fail. Signed-off-by: Xiangsheng Hou <xiangsheng.hou@mediatek.com> Link: https://lore.kernel.org/r/20230201020921.26712-2-xiangsheng.hou@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-12-06spi: mtk-snfi: Add snfi support for MT7986 ICXiangsheng Hou1-2/+27
Add snfi support for MT7986 IC. Signed-off-by: Xiangsheng Hou <xiangsheng.hou@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20221205065756.26875-2-xiangsheng.hou@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-05-03spi: mtk-snfi: preserve dma_mapping_error() error codesDan Carpenter1-2/+4
Return -ENOMEM of there is a dma mapping error. Do not return success. Fixes: 764f1b748164 ("spi: add driver for MTK SPI NAND Flash Interface") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Chuanhong Guo <gch981213@gmail.com> Link: https://lore.kernel.org/r/YmwjUcTKyQNrrn2g@kili Signed-off-by: Mark Brown <broonie@kernel.org>
2022-04-27spi: add driver for MTK SPI NAND Flash InterfaceChuanhong Guo1-0/+1470
This driver implements support for the SPI-NAND mode of MTK NAND Flash Interface as a SPI-MEM controller with pipelined ECC capability. Signed-off-by: Chuanhong Guo <gch981213@gmail.com> Tested-by: Daniel Golle <daniel@makrotopia.org> Link: https://lore.kernel.org/r/20220424032527.673605-3-gch981213@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>