Dmitry Baryshkov
36c5dde5fd
drm/msm/dsi: stop passing src_pll_id to the phy_enable call
...
Phy driver already knows the source PLL id basing on the set usecase and
the current PLL id. Stop passing it to the phy_enable call. As a
reminder, dsi manager will always use DSI 0 as a clock master in a slave
mode, so PLL 0 is always a clocksource for DSI 0 and it is always a
clocksource for DSI 1 too unless DSI 1 is used in the standalone mode.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Tested-by: Stephen Boyd <swboyd@chromium.org > # on sc7180 lazor
Reviewed-by: Abhinav Kumar <abhinavk@codeaurora.org >
Link: https://lore.kernel.org/r/20210331105735.3690009-25-dmitry.baryshkov@linaro.org
Signed-off-by: Rob Clark <robdclark@chromium.org >
2021-04-07 11:05:47 -07:00
Dmitry Baryshkov
6e2ad9c3bf
drm/msm/dsi: inline msm_dsi_phy_set_src_pll
...
The src_truthtable config is not used for some of phys, which use other
means of configuring the master/slave usecases. Inline this function
with the goal of removing src_pll_id argument in the next commit.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Tested-by: Stephen Boyd <swboyd@chromium.org > # on sc7180 lazor
Reviewed-by: Abhinav Kumar <abhinavk@codeaurora.org >
Link: https://lore.kernel.org/r/20210331105735.3690009-24-dmitry.baryshkov@linaro.org
Signed-off-by: Rob Clark <robdclark@chromium.org >
2021-04-07 11:05:46 -07:00
Dmitry Baryshkov
001d8dc338
drm/msm/dsi: remove temp data from global pll structure
...
The 7nm, 10nm and 14nm drivers would store interim data used during
VCO/PLL rate setting in the global dsi_pll_Nnm structure. Move this data
structures to the onstack storage. While we are at it, drop
unused/static 'config' data, unused config fields, etc.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Abhinav Kumar <abhinavk@codeaurora.org >
Tested-by: Stephen Boyd <swboyd@chromium.org > # on sc7180 lazor
Link: https://lore.kernel.org/r/20210331105735.3690009-23-dmitry.baryshkov@linaro.org
Signed-off-by: Rob Clark <robdclark@chromium.org >
2021-04-07 11:05:46 -07:00
Dmitry Baryshkov
9f91f22aaf
drm/msm/dsi: remove duplicate fields from dsi_pll_Nnm instances
...
Drop duplicate fields pdev and id from dsi_pll_Nnm instances. Reuse
those fields from the provided msm_dsi_phy.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Abhinav Kumar <abhinavk@codeaurora.org >
Tested-by: Stephen Boyd <swboyd@chromium.org > # on sc7180 lazor
Link: https://lore.kernel.org/r/20210331105735.3690009-22-dmitry.baryshkov@linaro.org
Signed-off-by: Rob Clark <robdclark@chromium.org >
2021-04-07 11:05:46 -07:00
Dmitry Baryshkov
b7cf8a5454
drm/msm/dsi: move ioremaps to dsi_phy_driver_probe
...
All PHY drivers would map dsi_pll area. Some PHY drivers would also
map dsi_phy area again (a leftover from old PHY/PLL separation). Move
all ioremaps to the common dsi_phy driver code and drop individual
ioremapped areas from PHY drivers.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Abhinav Kumar <abhinavk@codeaurora.org >
Tested-by: Stephen Boyd <swboyd@chromium.org > # on sc7180 lazor
Link: https://lore.kernel.org/r/20210331105735.3690009-21-dmitry.baryshkov@linaro.org
Signed-off-by: Rob Clark <robdclark@chromium.org >
2021-04-07 11:05:46 -07:00
Dmitry Baryshkov
e55b3fbbbb
drm/msm/dsi: drop PLL accessor functions
...
Replace PLL accessor functions (pll_read/pll_write*) with the DSI PHY
accessors, reducing duplication.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Abhinav Kumar <abhinavk@codeaurora.org >
Tested-by: Stephen Boyd <swboyd@chromium.org > # on sc7180 lazor
Link: https://lore.kernel.org/r/20210331105735.3690009-20-dmitry.baryshkov@linaro.org
Signed-off-by: Rob Clark <robdclark@chromium.org >
2021-04-07 11:05:46 -07:00
Dmitry Baryshkov
007687c38a
drm/msm/dsi: drop msm_dsi_pll abstraction
...
Drop the struct msm_dsi_pll abstraction, by including vco's clk_hw
directly into struct msm_dsi_phy.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Abhinav Kumar <abhinavk@codeaurora.org >
Tested-by: Stephen Boyd <swboyd@chromium.org > # on sc7180 lazor
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Link: https://lore.kernel.org/r/20210331105735.3690009-19-dmitry.baryshkov@linaro.org
Signed-off-by: Rob Clark <robdclark@chromium.org >
2021-04-07 11:05:46 -07:00
Dmitry Baryshkov
2a831d9e38
drm/msm/dsi: make save_state/restore_state callbacks accept msm_dsi_phy
...
Make save_state/restore callbacks accept struct msm_dsi_phy rather than
struct msm_dsi_pll. This moves them to struct msm_dsi_phy_ops, allowing
us to drop struct msm_dsi_pll_ops.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Tested-by: Stephen Boyd <swboyd@chromium.org > # on sc7180 lazor
Reviewed-by: Abhinav Kumar <abhinavk@codeaurora.org >
Link: https://lore.kernel.org/r/20210331105735.3690009-18-dmitry.baryshkov@linaro.org
Signed-off-by: Rob Clark <robdclark@chromium.org >
2021-04-07 11:05:46 -07:00
Dmitry Baryshkov
015cf32983
drm/msm/dsi: drop vco_delay setting from 7nm, 10nm, 14nm drivers
...
These drivers do not use vco_delay variable, so drop it from all of
them.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Abhinav Kumar <abhinavk@codeaurora.org >
Tested-by: Stephen Boyd <swboyd@chromium.org > # on sc7180 lazor
Link: https://lore.kernel.org/r/20210331105735.3690009-15-dmitry.baryshkov@linaro.org
Signed-off-by: Rob Clark <robdclark@chromium.org >
2021-04-07 11:05:46 -07:00
Dmitry Baryshkov
aaadcbb4d7
drm/msm/dsi: make save/restore_state phy-level functions
...
Morph msm_dsi_pll_save/restore_state() into msm_dsi_phy_save/restore_state(),
thus removing last bits of knowledge about msm_dsi_pll from dsi_manager.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Abhinav Kumar <abhinavk@codeaurora.org >
Tested-by: Stephen Boyd <swboyd@chromium.org > # on sc7180 lazor
Link: https://lore.kernel.org/r/20210331105735.3690009-14-dmitry.baryshkov@linaro.org
Signed-off-by: Rob Clark <robdclark@chromium.org >
2021-04-07 11:05:45 -07:00
Dmitry Baryshkov
613cbd1da3
drm/msm/dsi: use devm_clk_*register to registe DSI PHY clocks
...
Use devres-enabled version of clock registration functions. This lets us
remove dsi_pll destroy callbacks completely.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Abhinav Kumar <abhinavk@codeaurora.org >
Tested-by: Stephen Boyd <swboyd@chromium.org > # on sc7180 lazor
Link: https://lore.kernel.org/r/20210331105735.3690009-12-dmitry.baryshkov@linaro.org
Signed-off-by: Rob Clark <robdclark@chromium.org >
2021-04-07 11:05:45 -07:00
Dmitry Baryshkov
5d13459650
drm/msm/dsi: push provided clocks handling into a generic code
...
All MSM DSI PHYs provide two clocks: byte and pixel ones.
Register/unregister provided clocks from the generic place, removing
boilerplate code from all MSM DSI PHY drivers.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Abhinav Kumar <abhinavk@codeaurora.org >
Tested-by: Stephen Boyd <swboyd@chromium.org > # on sc7180 lazor
Link: https://lore.kernel.org/r/20210331105735.3690009-11-dmitry.baryshkov@linaro.org
Signed-off-by: Rob Clark <robdclark@chromium.org >
2021-04-07 11:05:45 -07:00
Dmitry Baryshkov
95b814e4f6
drm/msm/dsi: remove msm_dsi_pll_set_usecase
...
msm_dsi_pll_set_usecase() function is not used outside of individual DSI
PHY drivers, so drop it in favour of calling the the respective
set_usecase functions directly.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Abhinav Kumar <abhinavk@codeaurora.org >
Tested-by: Stephen Boyd <swboyd@chromium.org > # on sc7180 lazor
Link: https://lore.kernel.org/r/20210331105735.3690009-10-dmitry.baryshkov@linaro.org
Signed-off-by: Rob Clark <robdclark@chromium.org >
2021-04-07 11:05:45 -07:00
Dmitry Baryshkov
076437c9e3
drm/msm/dsi: move min/max PLL rate to phy config
...
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Abhinav Kumar <abhinavk@codeaurora.org >
Tested-by: Stephen Boyd <swboyd@chromium.org > # on sc7180 lazor
Link: https://lore.kernel.org/r/20210331105735.3690009-9-dmitry.baryshkov@linaro.org
Signed-off-by: Rob Clark <robdclark@chromium.org >
2021-04-07 11:05:45 -07:00
Dmitry Baryshkov
80d2229bf0
drm/msm/dsi: drop global msm_dsi_phy_type enumaration
...
With the current upstream driver the msm_dsi_phy_type enum does not make
much sense: all DSI PHYs are probed using the dt bindings, the phy type
is not passed between drivers. Use quirks in phy individual PHY drivers
to differentiate minor harware differences and drop the enum.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Abhinav Kumar <abhinavk@codeaurora.org >
Tested-by: Stephen Boyd <swboyd@chromium.org > # on sc7180 lazor
Link: https://lore.kernel.org/r/20210331105735.3690009-8-dmitry.baryshkov@linaro.org
Signed-off-by: Rob Clark <robdclark@chromium.org >
2021-04-07 11:05:45 -07:00
Dmitry Baryshkov
93cf7d6289
drm/msm/dsi: move all PLL callbacks into PHY config struct
...
Move all PLL-related callbacks into struct msm_dsi_phy_cfg. This limits
the amount of data in the struct msm_dsi_pll.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Abhinav Kumar <abhinavk@codeaurora.org >
Tested-by: Stephen Boyd <swboyd@chromium.org > # on sc7180 lazor
Link: https://lore.kernel.org/r/20210331105735.3690009-7-dmitry.baryshkov@linaro.org
Signed-off-by: Rob Clark <robdclark@chromium.org >
2021-04-07 11:05:45 -07:00
Dmitry Baryshkov
d6d1439ec4
drm/msm/dsi: fuse dsi_pll_* code into dsi_phy_* code
...
Each phy version is tightly coupled with the corresponding PLL code,
there is no need to keep them separate. Fuse source files together in
order to simplify DSI code.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Abhinav Kumar <abhinavk@codeaurora.org >
Tested-by: Stephen Boyd <swboyd@chromium.org > # on sc7180 lazor
Link: https://lore.kernel.org/r/20210331105735.3690009-5-dmitry.baryshkov@linaro.org
Signed-off-by: Rob Clark <robdclark@chromium.org >
2021-04-07 11:05:45 -07:00
Dmitry Baryshkov
266a4e58a1
drm/msm/dsi: replace PHY's init callback with configurable data
...
DSI PHY init callback would either map dsi_phy_regulator or dsi_phy_lane
depending on the PHY type. Replace those callbacks with configuration
options governing mapping those regions.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Abhinav Kumar <abhinavk@codeaurora.org >
Tested-by: Stephen Boyd <swboyd@chromium.org > # on sc7180 lazor
Link: https://lore.kernel.org/r/20210331105735.3690009-4-dmitry.baryshkov@linaro.org
Signed-off-by: Rob Clark <robdclark@chromium.org >
2021-04-07 11:05:44 -07:00
Dmitry Baryshkov
e92ce317fb
drm/msm/dsi_phy_10nm: implement PHY disabling
...
Implement phy_disable() callback to disable DSI PHY lanes and blocks
when phy is not used.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Fixes: ff73ff1940 ("drm/msm/dsi: Populate the 10nm PHY funcs")
Signed-off-by: Rob Clark <robdclark@chromium.org >
2020-11-04 08:26:26 -08:00
Nathan Chancellor
01a090c746
drm/msm/dsi: Add parentheses to quirks check in dsi_phy_hw_v3_0_lane_settings
...
Clang warns:
drivers/gpu/drm/msm/dsi/phy/dsi_phy_10nm.c:80:6: warning: logical not is
only applied to the left hand side of this bitwise operator
[-Wlogical-not-parentheses]
if (!phy->cfg->quirks & V3_0_0_10NM_OLD_TIMINGS_QUIRK) {
^ ~
drivers/gpu/drm/msm/dsi/phy/dsi_phy_10nm.c:80:6: note: add parentheses
after the '!' to evaluate the bitwise operator first
if (!phy->cfg->quirks & V3_0_0_10NM_OLD_TIMINGS_QUIRK) {
^
( )
drivers/gpu/drm/msm/dsi/phy/dsi_phy_10nm.c:80:6: note: add parentheses
around left hand side expression to silence this warning
if (!phy->cfg->quirks & V3_0_0_10NM_OLD_TIMINGS_QUIRK) {
^
( )
1 warning generated.
Add parentheses around the bitwise AND so it is evaluated first then
negated.
Fixes: 3dbbf8f09e ("drm/msm/dsi: Add old timings quirk for 10nm phy")
Link: https://github.com/ClangBuiltLinux/linux/issues/547
Reported-by: kbuild test robot <lkp@intel.com >
Reviewed-by: Jeffrey Hugo <jeffrey.l.hugo@gmail.com >
Reviewed-by: Sean Paul <sean@poorly.run >
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com >
Signed-off-by: Rob Clark <robdclark@chromium.org >
2019-06-19 12:30:55 -07:00
Jeffrey Hugo
3dbbf8f09e
drm/msm/dsi: Add old timings quirk for 10nm phy
...
The v3.0.0 10nm phy has two different implementations between MSM8998 and
SDM845, which require different timings calculations. Unfortunately, the
hardware designers did not choose to revise the version to account for this
delta so implement a quirk instead.
Signed-off-by: Jeffrey Hugo <jeffrey.l.hugo@gmail.com >
Signed-off-by: Rob Clark <robdclark@chromium.org >
2019-06-18 13:56:43 -07:00
Jeffrey Hugo
d440b3374b
drm/msm/dsi: Add support for MSM8998 10nm dsi phy
...
The MSM8998 dsi phy is 10nm v3.0.0 like SDM845, however there appear to
be minor differences such as the address space location.
Signed-off-by: Jeffrey Hugo <jeffrey.l.hugo@gmail.com >
Signed-off-by: Rob Clark <robdclark@chromium.org >
2019-06-18 13:56:43 -07:00
Mamta Shukla
6a41da17e8
drm: msm: Use DRM_DEV_* instead of dev_*
...
Use DRM_DEV_INFO/ERROR/WARN instead of dev_info/err/debug to generate
drm-formatted specific log messages so that it will be easy to
differentiate in case of multiple instances of driver.
Signed-off-by: Mamta Shukla <mamtashukla555@gmail.com >
Signed-off-by: Rob Clark <robdclark@gmail.com >
2018-12-11 13:05:22 -05:00
Abhinav Kumar
f1fa7ff440
drm/msm/dsi: implement auto PHY timing calculator for 10nm PHY
...
Currently the DSI PHY timings are hard-coded for a specific panel
for the 10nm PHY.
Replace this with the auto PHY timing calculator which can calculate
the PHY timings for any panel.
Changes in v4:
- None
Changes in v3:
- None
Changes in v2:
- None
Reviewed-by: Sean Paul <seanpaul@chromium.org >
Reviewed-by: Archit Taneja <architt@codeaurora.org >
Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org >
Signed-off-by: Sean Paul <seanpaul@chromium.org >
Signed-off-by: Rob Clark <robdclark@gmail.com >
2018-04-19 10:08:16 -04:00
Archit Taneja
ff73ff1940
drm/msm/dsi: Populate the 10nm PHY funcs
...
Populate the PHY ops with the downstream driver as reference.
There are a couple of TODOs which need to be resolved:
- The PHY timings are all hardcoded for now. This needs to be replaced
with automatic calculations once we get/understand them.
- There are some lane configuration registers which use a new
representation between physical and logical lane mappings. For now,
we've hardcoced them to follow the default mapping (i.e
logical 0 -> phy 0, logical 1 -> phy 1 etc).
Signed-off-by: Archit Taneja <architt@codeaurora.org >
Signed-off-by: Rob Clark <robdclark@gmail.com >
2018-02-20 10:41:21 -05:00
Archit Taneja
973e02db35
drm/msm/dsi: Add skeleton 10nm PHY/PLL code
...
Add new 10nm DSI PLL/PHY files that will be used on SDM845.
Just populate empty pll/phy funcs for now. These will be filled up
later.
Signed-off-by: Archit Taneja <architt@codeaurora.org >
Signed-off-by: Rob Clark <robdclark@gmail.com >
2018-02-20 10:41:20 -05:00