Guillaume Ranquet
95bd315f0a
phy: mediatek: hdmi: mt8195: fix prediv bad upper limit test
...
The pll prediv calculus searchs for the smallest prediv that gets
the ns_hdmipll_ck in the range of 5 GHz to 12 GHz.
A typo in the upper bound test was testing for 5Ghz to 1Ghz
Fixes: 45810d486b ("phy: mediatek: add support for phy-mtk-hdmi-mt8195")
Signed-off-by: Guillaume Ranquet <granquet@baylibre.com >
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Link: https://lore.kernel.org/r/20230529-hdmi_phy_fix-v1-1-bf65f53af533@baylibre.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2023-07-12 22:27:02 +05:30
Dan Carpenter
5782017cc4
phy: phy-mtk-dp: Fix an error code in probe()
...
Negative -EINVAL was intended instead of positive EINVAL.
Fixes: 6a23afad44 ("phy: phy-mtk-dp: Add driver for DP phy")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org >
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org >
Link: https://lore.kernel.org/r/3c699e00-2883-40d9-92c3-0da1dc38fdd4@moroto.mountain
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2023-07-12 22:27:02 +05:30
Chunfeng Yun
e45076007e
phy: mediatek: tphy: add debugfs files
...
These debugfs files are mainly used to make eye diagram test easier,
especially helpful to do HQA test for a new IC without efuse enabled.
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com >
Link: https://lore.kernel.org/r/20230513092218.21139-2-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2023-05-19 23:23:52 +05:30
Tom Rix
03262a3f5b
phy: mediatek: rework the floating point comparisons to fixed point
...
gcc on aarch64 reports
drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c: In function ‘mtk_hdmi_pll_set_rate’:
drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c:240:52: error: ‘-mgeneral-regs-only’
is incompatible with the use of floating-point types
240 | else if (tmds_clk >= 54 * MEGA && tmds_clk < 148.35 * MEGA)
Floating point should not be used, so rework the floating point comparisons
to fixed point.
Signed-off-by: Tom Rix <trix@redhat.com >
Reviewed-by: Chunfeng Yun <chunfeng.yun@mediatek.com >
Link: https://lore.kernel.org/r/20230502145005.2927101-1-trix@redhat.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2023-05-16 19:48:06 +05:30
Guillaume Ranquet
9d9ff3d2a4
phy: mediatek: hdmi: mt8195: fix wrong pll calculus
...
The clock rate calculus in mtk_hdmi_pll_calc() was wrong when it has
been replaced by 'div_u64'.
Fix the issue by multiplying the values in the denominator instead of
dividing them.
Fixes: 45810d486b ("phy: mediatek: add support for phy-mtk-hdmi-mt8195")
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Signed-off-by: Guillaume Ranquet <granquet@baylibre.com >
Link: https://lore.kernel.org/r/20230413-fixes-for-mt8195-hdmi-phy-v2-2-bbad62e64321@baylibre.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2023-05-04 23:12:11 +05:30
Guillaume Ranquet
714dd3c29a
phy: mediatek: hdmi: mt8195: fix uninitialized variable usage in pll_calc
...
The ret variable in mtk_hdmi_pll_calc() was used unitialized as reported
by the kernel test robot.
Fix the issue by removing the variable altogether and testing out the
return value of mtk_hdmi_pll_set_hw()
Fixes: 45810d486b ("phy: mediatek: add support for phy-mtk-hdmi-mt8195")
Reported-by: kernel test robot <lkp@intel.com >
Signed-off-by: Guillaume Ranquet <granquet@baylibre.com >
Reviewed-by: Nathan Chancellor <nathan@kernel.org >
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Link: https://lore.kernel.org/r/20230413-fixes-for-mt8195-hdmi-phy-v2-1-bbad62e64321@baylibre.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2023-05-04 23:12:11 +05:30
Guillaume Ranquet
45810d486b
phy: mediatek: add support for phy-mtk-hdmi-mt8195
...
Add support for the mediatek hdmi phy on MT8195 SoC
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Signed-off-by: Guillaume Ranquet <granquet@baylibre.com >
Link: https://lore.kernel.org/r/20220919-v8-3-a84c80468fe9@baylibre.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2023-04-12 21:56:41 +05:30
Guillaume Ranquet
605b903719
phy: phy-mtk-hdmi: Add generic phy configure callback
...
Some phys, such as mt8195, needs to have a configure callback defined.
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com >
Signed-off-by: Guillaume Ranquet <granquet@baylibre.com >
Link: https://lore.kernel.org/r/20220919-v8-2-a84c80468fe9@baylibre.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2023-04-12 21:56:40 +05:30
Uwe Kleine-König
30850b6e2b
phy: mediatek: phy-mtk-mipi-dsi: Convert to platform remove callback returning void
...
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/20230307115900.2293120-9-u.kleine-koenig@pengutronix.de
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2023-03-20 18:14:56 +05:30
Chunfeng Yun
49094d9286
phy: mediatek: remove temporary variable @mask_
...
Remove the temporary @mask_, this may cause build warning when use clang
compiler for powerpc, but can't reproduce it when compile for arm64.
the build warning is caused by:
"warning: result of comparison of constant 18446744073709551615 with
expression of type (aka 'unsigned long') is always false
[-Wtautological-constant-out-of-range-compare]"
More information provided in below lore link.
After removing @mask_, there is a "CHECK:MACRO_ARG_REUSE" when run
checkpatch.pl, but due to @mask is constant, no reuse problem will happen.
Link: https://lore.kernel.org/lkml/202212160357.jJuesD8n-lkp@intel.com/t/
Fixes: 84513eccd6 ("phy: mediatek: fix build warning of FIELD_PREP()")
Reported-by: kernel test robot <lkp@intel.com >
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com >
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Link: https://lore.kernel.org/r/20230118084343.26913-1-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2023-02-02 18:35:13 +05:30
Colin Ian King
9aa0dade8f
phy: phy-mtk-dp: make array driving_params static const
...
Don't populate the read-only array driving_params on the stack but instead
make it static const. Also makes the object code a little smaller.
Signed-off-by: Colin Ian King <colin.i.king@gmail.com >
Link: https://lore.kernel.org/r/20220929130147.97375-1-colin.i.king@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-09-29 21:01:27 +05:30
Chunfeng Yun
84513eccd6
phy: mediatek: fix build warning of FIELD_PREP()
...
Change the inline function mtk_phy_update_field() into a macro to
avoid check warning of FIELD_PREP() with compiler parameter
-Wtautological-constant-out-of-range-compare
the warning is caused by mask check:
"BUILD_BUG_ON_MSG(__bf_cast_unsigned(_mask, _mask) > \"
Fixes: 29c0747755 ("phy: mediatek: add a new helper to update bitfield")
Reported-by: kernel test robot <lkp@intel.com >
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com >
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Link: https://lore.kernel.org/r/20220928070746.5393-1-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-09-29 11:12:31 +05:30
Chunfeng Yun
60d9b6aaab
phy: mediatek: mipi: remove register access helpers
...
Remove private register access helpers, use the common ones instead.
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com >
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Link: https://lore.kernel.org/r/20220920090038.15133-19-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-09-24 11:57:51 +05:30
Chunfeng Yun
5f88a93b5a
phy: mediatek: mipi: mt8183: use common helper to access registers
...
Use MediaTek phy's common helper to access registers, then we can remove
mipi-dsi's I/O helpers.
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com >
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Link: https://lore.kernel.org/r/20220920090038.15133-18-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-09-24 11:57:51 +05:30
Chunfeng Yun
d36d69a551
phy: mediatek: mipi: mt8183: use GENMASK to generate bits mask
...
Use GENMASK() macro to generate bits mask
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com >
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Link: https://lore.kernel.org/r/20220920090038.15133-17-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-09-24 11:57:51 +05:30
Chunfeng Yun
bd4ba730ff
phy: mediatek: mipi: mt8173: use common helper to access registers
...
Use MediaTek phy's common helper to access registers, then we can remove
mipi-dsi's I/O helpers.
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com >
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Link: https://lore.kernel.org/r/20220920090038.15133-16-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-09-24 11:57:50 +05:30
Chunfeng Yun
993aa53ed0
phy: mediatek: mipi: mt8173: use FIELD_PREP to prepare bits field
...
Use FIELD_PREP() macro to prepare bits field value, then no need define
macros of bits offset.
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com >
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Link: https://lore.kernel.org/r/20220920090038.15133-15-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-09-24 11:57:50 +05:30
Chunfeng Yun
7bd7271432
phy: mediatek: mipi: mt8173: use GENMASK to generate bits mask
...
Use GENMASK() macro to generate bits mask
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com >
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Link: https://lore.kernel.org/r/20220920090038.15133-14-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-09-24 11:57:50 +05:30
Chunfeng Yun
299a9c72ac
phy: mediatek: hdmi: remove register access helpers
...
Remove private register access helpers, use the common ones instead.
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com >
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Link: https://lore.kernel.org/r/20220920090038.15133-13-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-09-24 11:57:50 +05:30
Chunfeng Yun
0fb5e57e67
phy: mediatek: hdmi: mt8173: use common helper to access registers
...
Use MediaTek phy's common helper to access registers, then we can remove
hdmi's I/O helpers.
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com >
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Link: https://lore.kernel.org/r/20220920090038.15133-12-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-09-24 11:57:50 +05:30
Chunfeng Yun
309b4fec53
phy: mediatek: hdmi: mt8173: use FIELD_PREP to prepare bits field
...
Use FIELD_PREP() macro to prepare bits field value, then no need define
macros of bits offset.
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com >
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Link: https://lore.kernel.org/r/20220920090038.15133-11-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-09-24 11:57:50 +05:30
Chunfeng Yun
a8a78274c6
phy: mediatek: hdmi: mt8173: use GENMASK to generate bits mask
...
Use GENMASK() macro to generate bits mask
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com >
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Link: https://lore.kernel.org/r/20220920090038.15133-10-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-09-24 11:57:50 +05:30
Chunfeng Yun
cff81a618a
phy: mediatek: hdmi: mt2701: use common helper to access registers
...
Use MediaTek phy's common helper to access registers, then we can remove
hdmi's I/O helpers.
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com >
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Link: https://lore.kernel.org/r/20220920090038.15133-9-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-09-24 11:57:50 +05:30
Chunfeng Yun
a98d935eac
phy: mediatek: hdmi: mt2701: use FIELD_PREP to prepare bits field
...
Use FIELD_PREP() macro to prepare bits field value, then no need define
macros of bits offset.
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com >
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Link: https://lore.kernel.org/r/20220920090038.15133-8-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-09-24 11:57:50 +05:30
Chunfeng Yun
b0870c0151
phy: mediatek: hdmi: mt2701: use GENMASK and BIT to generate mask and bits
...
Use GENMASK() and BIT() macros to generate mask and bits
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com >
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Link: https://lore.kernel.org/r/20220920090038.15133-7-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-09-24 11:57:49 +05:30
Chunfeng Yun
d87f2b8373
phy: mediatek: pcie: use new helper to update register bits
...
The new helper will use FIELD_PREP() macro to prepare bits value
according to mask, then we no need do it anymore.
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com >
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Link: https://lore.kernel.org/r/20220920090038.15133-6-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-09-24 11:57:49 +05:30
Chunfeng Yun
2b0c004384
phy: mediatek: ufs: use common register access helpers
...
No need define private register access helpers, use common ones defined
in phy-mtk-io.h
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com >
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Link: https://lore.kernel.org/r/20220920090038.15133-5-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-09-24 11:57:49 +05:30
Chunfeng Yun
c221baa355
phy: mediatek: xsphy: remove macros used to prepare bitfield value
...
Prefer to make use of FIELD_PREP() macro to prepare bitfield value,
then no need local ones anymore.
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com >
Link: https://lore.kernel.org/r/20220920090038.15133-4-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-09-24 11:57:49 +05:30
Chunfeng Yun
6b5ef19461
phy: mediatek: tphy: remove macros to prepare bitfield value
...
Prefer to make use of FIELD_PREP() macro to prepare bitfield value,
then no need local ones anymore.
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com >
Link: https://lore.kernel.org/r/20220920090038.15133-3-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-09-24 11:57:49 +05:30
Chunfeng Yun
29c0747755
phy: mediatek: add a new helper to update bitfield
...
Due to FIELD_PREP() macro can be used to prepare a bitfield value,
local ones can be remove; add the new helper to make bitfield update
easier.
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com >
Link: https://lore.kernel.org/r/20220920090038.15133-2-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-09-24 11:57:49 +05:30
Chunfeng Yun
931c05a8cb
phy: phy-mtk-tphy: fix the phy type setting issue
...
The PHY type is not set if the index is non zero, prepare type
value according to the index, like as mask value.
Fixes: 39099a4433 ("phy: phy-mtk-tphy: support type switch by pericfg")
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com >
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Link: https://lore.kernel.org/r/20220914060746.10004-7-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-09-20 11:59:06 +05:30
Chunfeng Yun
1e77f026eb
phy: phy-mtk-tphy: set utmi 0 register in init() ops
...
No need repeat to clear utmi 0 register in ->power_on() and
->power_off(), just do it in ->init()
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com >
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Link: https://lore.kernel.org/r/20220914060746.10004-6-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-09-20 11:59:05 +05:30
Chunfeng Yun
3fbbb75c40
phy: phy-mtk-tphy: disable gpio mode for all usb2 phys
...
Disable DP/DM's GPIO mode for all usb2 phy, not only for the first
usb2 phy which usually supports dual-role mode.
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com >
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Link: https://lore.kernel.org/r/20220914060746.10004-5-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-09-20 11:59:05 +05:30
Chunfeng Yun
8da71ebad8
phy: phy-mtk-tphy: disable hardware efuse when set INTR
...
INTR's value is able autoload from hardware efuse by default, when
software tries to update its value, should disable hardware efuse
firstly.
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com >
Link: https://lore.kernel.org/r/20220914060746.10004-4-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-09-20 11:59:05 +05:30
Chunfeng Yun
930981b425
phy: phy-mtk-tphy: add property to set pre-emphasis
...
Add a property to set usb2 phy's pre-emphasis, it's disabled by default
on some SoCs.
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com >
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Link: https://lore.kernel.org/r/20220914060746.10004-3-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-09-20 11:59:05 +05:30
Yang Yingliang
08fd292fdf
phy: phy-mtk-dp: change mtk_dp_phy_driver to static
...
mtk_dp_phy_driver is only used in phy-mtk-dp.c now, change it to static.
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com >
Link: https://lore.kernel.org/r/20220707135309.801181-1-yangyingliang@huawei.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-07-08 10:44:06 +05:30
Markus Schneider-Pargmann
6a23afad44
phy: phy-mtk-dp: Add driver for DP phy
...
This is a new driver that supports the integrated DisplayPort phy for
mediatek SoCs, especially the mt8195. The phy is integrated into the
DisplayPort controller and will be created by the mtk-dp driver. This
driver expects a struct regmap to be able to work on the same registers
as the DisplayPort controller. It sets the device data to be the struct
phy so that the DisplayPort controller can easily work with it.
The driver does not have any devicetree bindings because the datasheet
does not list the controller and the phy as distinct units.
The interaction with the controller can be covered by the configure
callback of the phy framework and its displayport parameters.
Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com >
Signed-off-by: Guillaume Ranquet <granquet@baylibre.com >
[Bo-Chen: Modify reviewers' comments.]
Signed-off-by: Bo-Chen Chen <rex-bc.chen@mediatek.com >
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Link: https://lore.kernel.org/r/20220624062725.4095-1-rex-bc.chen@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-07-05 12:28:09 +05:30
Jianjun Wang
e4e46bc71c
phy: mediatek: Add PCIe PHY driver
...
Add PCIe GEN3 PHY driver support on MediaTek chipsets.
Signed-off-by: Jianjun Wang <jianjun.wang@mediatek.com >
Reviewed-by: Chunfeng Yun <chunfeng.yun@mediatek.com >
Reviewed-by: AngeloGioachino Del Regno <angelogioacchino.delregno@collabora.com >
Link: https://lore.kernel.org/r/20220617070246.20142-3-jianjun.wang@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-07-05 10:58:38 +05:30
AngeloGioacchino Del Regno
f038084355
phy: mediatek: phy-mtk-hdmi: Simplify with dev_err_probe()
...
Use the dev_err_probe() helper to simplify error handling during probe.
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Link: https://lore.kernel.org/r/20220328111046.210736-1-angelogioacchino.delregno@collabora.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-04-13 13:19:09 +05:30
AngeloGioacchino Del Regno
b7b930f3b3
phy: mediatek: phy-mtk-mipi-dsi: Simplify with dev_err_probe()
...
Use the dev_err_probe() helper to simplify error handling during probe.
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Link: https://lore.kernel.org/r/20220328145217.228457-1-angelogioacchino.delregno@collabora.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-04-13 13:19:09 +05:30
Wan Jiabing
46e9947178
phy: phy-mtk-tphy: Fix duplicated argument in phy-mtk-tphy
...
Fix following coccicheck warning:
./drivers/phy/mediatek/phy-mtk-tphy.c:994:6-29: duplicated argument
to && or ||
The efuse_rx_imp is duplicate. Here should be efuse_tx_imp.
Signed-off-by: Wan Jiabing <wanjiabing@vivo.com >
Acked-by: Chunfeng Yun <chunfeng.yun@mediatek.com >
Link: https://lore.kernel.org/r/20220107025050.787720-1-wanjiabing@vivo.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-01-27 12:14:34 +05:30
Miaoqian Lin
399c91c3f3
phy: mediatek: Fix missing check in mtk_mipi_tx_probe
...
The of_device_get_match_data() function may return NULL.
Add check to prevent potential null dereference.
Signed-off-by: Miaoqian Lin <linmq006@gmail.com >
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Link: https://lore.kernel.org/r/20211224082103.7658-1-linmq006@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2021-12-27 15:58:03 +05:30
Chunfeng Yun
33d18746fa
phy: phy-mtk-tphy: use new io helpers to access register
...
Use new helpers mtk_phy_clear/set/update_bits() to access registers
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com >
Link: https://lore.kernel.org/r/20211218082802.5256-5-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2021-12-24 10:06:38 +05:30
Chunfeng Yun
9520bbf3cb
phy: phy-mtk-xsphy: use new io helpers to access register
...
Use new helpers mtk_phy_clear/set/update_bits() to access registers
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com >
Link: https://lore.kernel.org/r/20211218082802.5256-4-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2021-12-24 10:06:37 +05:30
Chunfeng Yun
1371b9a563
phy: mediatek: add helpers to update bits of registers
...
Add three helpers mtk_phy_clear/set/update_bits() for registers operation
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com >
Link: https://lore.kernel.org/r/20211218082802.5256-3-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2021-12-24 10:06:37 +05:30
Chunfeng Yun
6f2b033cb8
phy: phy-mtk-tphy: add support efuse setting
...
Due to some SoCs have a bit shift issue that will drop a bit for usb3
phy or pcie phy, fix it by adding software efuse reading and setting,
but only support it optionally for version 2/3.
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com >
Link: https://lore.kernel.org/r/20211218082802.5256-2-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2021-12-24 10:06:37 +05:30
Chunfeng Yun
7508d1e403
phy: phy-mtk-mipi-dsi: convert to devm_platform_ioremap_resource
...
Use devm_platform_ioremap_resource to simplify code
Acked-by: Chun-Kuang Hu <chunkuang.hu@kernel.org >
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com >
Link: https://lore.kernel.org/r/1629191987-20774-9-git-send-email-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2021-08-17 15:51:59 +05:30
Chunfeng Yun
75203e7994
phy: phy-mtk-mipi-dsi: remove dummy assignment of error number
...
Return the error number directly without assignment
Acked-by: Chun-Kuang Hu <chunkuang.hu@kernel.org >
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com >
Link: https://lore.kernel.org/r/1629191987-20774-8-git-send-email-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2021-08-17 15:51:59 +05:30
Chunfeng Yun
9474458753
phy: phy-mtk-hdmi: convert to devm_platform_ioremap_resource
...
Use devm_platform_ioremap_resource to simplify code
Acked-by: Chun-Kuang Hu <chunkuang.hu@kernel.org >
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com >
Link: https://lore.kernel.org/r/1629191987-20774-7-git-send-email-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2021-08-17 15:51:59 +05:30
Chunfeng Yun
5f71b1e4f7
phy: phy-mtk-ufs: use clock bulk to get clocks
...
Use clock bulk helpers to get/enable/disable clocks
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com >
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com >
Link: https://lore.kernel.org/r/1629191987-20774-6-git-send-email-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2021-08-17 15:51:59 +05:30