Commit 6bfb8b58 authored by Dmitry Baryshkov's avatar Dmitry Baryshkov

Merge branches 'msm-next-lumag-dp', 'msm-next-lumag-dsi',...

Merge branches 'msm-next-lumag-dp', 'msm-next-lumag-dsi', 'msm-next-lumag-mdp5' and 'msm-next-lumag-mdp4' into msm-next-lumag

Core:
 - Bugfixes for error handling during probe
 - rework UBWC decoder programming
 - prepare_commit cleanup
 - bindings for SM8550 (MDSS, DPU), SM8450 (DP)
 - uapi C++ compatibility fix
 - timeout calculation fixup
 - msm_fbdev conversion to drm_client

DP:
 - interrupts cleanup

DPU:
 - DSPP sub-block flush on sc7280
 - support AR30 in addition to XR30 format
 - Allow using REC_0 and REC_1 to handle wide (4k) RGB planes

DSI:
 - rework DSI instance ID detection on obscure platforms

and misc small fixes as usual.
Signed-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
...@@ -15,7 +15,8 @@ description: | ...@@ -15,7 +15,8 @@ description: |
properties: properties:
compatible: compatible:
enum: oneOf:
- enum:
- qcom,sc7180-dp - qcom,sc7180-dp
- qcom,sc7280-dp - qcom,sc7280-dp
- qcom,sc7280-edp - qcom,sc7280-edp
...@@ -25,6 +26,10 @@ properties: ...@@ -25,6 +26,10 @@ properties:
- qcom,sc8280xp-edp - qcom,sc8280xp-edp
- qcom,sdm845-dp - qcom,sdm845-dp
- qcom,sm8350-dp - qcom,sm8350-dp
- items:
- enum:
- qcom,sm8450-dp
- const: qcom,sm8350-dp
reg: reg:
minItems: 4 minItems: 4
......
...@@ -25,16 +25,16 @@ properties: ...@@ -25,16 +25,16 @@ properties:
- qcom,sc7280-dsi-ctrl - qcom,sc7280-dsi-ctrl
- qcom,sdm660-dsi-ctrl - qcom,sdm660-dsi-ctrl
- qcom,sdm845-dsi-ctrl - qcom,sdm845-dsi-ctrl
- qcom,sm6115-dsi-ctrl
- qcom,sm8150-dsi-ctrl - qcom,sm8150-dsi-ctrl
- qcom,sm8250-dsi-ctrl - qcom,sm8250-dsi-ctrl
- qcom,sm8350-dsi-ctrl - qcom,sm8350-dsi-ctrl
- qcom,sm8450-dsi-ctrl - qcom,sm8450-dsi-ctrl
- qcom,sm8550-dsi-ctrl - qcom,sm8550-dsi-ctrl
- const: qcom,mdss-dsi-ctrl - const: qcom,mdss-dsi-ctrl
- items:
- enum: - enum:
- dsi-ctrl-6g-qcm2290 - qcom,dsi-ctrl-6g-qcm2290
- const: qcom,mdss-dsi-ctrl - qcom,mdss-dsi-ctrl # This should always come with an SoC-specific compatible
deprecated: true deprecated: true
reg: reg:
...@@ -351,6 +351,7 @@ allOf: ...@@ -351,6 +351,7 @@ allOf:
contains: contains:
enum: enum:
- qcom,sdm845-dsi-ctrl - qcom,sdm845-dsi-ctrl
- qcom,sm6115-dsi-ctrl
then: then:
properties: properties:
clocks: clocks:
......
...@@ -40,6 +40,12 @@ patternProperties: ...@@ -40,6 +40,12 @@ patternProperties:
type: object type: object
properties: properties:
compatible: compatible:
oneOf:
- items:
- const: qcom,sm6115-dsi-ctrl
- const: qcom,mdss-dsi-ctrl
- description: Old binding, please don't use
deprecated: true
const: qcom,dsi-ctrl-6g-qcm2290 const: qcom,dsi-ctrl-6g-qcm2290
"^phy@[0-9a-f]+$": "^phy@[0-9a-f]+$":
...@@ -114,7 +120,7 @@ examples: ...@@ -114,7 +120,7 @@ examples:
}; };
dsi@5e94000 { dsi@5e94000 {
compatible = "qcom,dsi-ctrl-6g-qcm2290"; compatible = "qcom,sm6115-dsi-ctrl", "qcom,mdss-dsi-ctrl";
reg = <0x05e94000 0x400>; reg = <0x05e94000 0x400>;
reg-names = "dsi_ctrl"; reg-names = "dsi_ctrl";
......
...@@ -84,10 +84,6 @@ static void mdp4_disable_commit(struct msm_kms *kms) ...@@ -84,10 +84,6 @@ static void mdp4_disable_commit(struct msm_kms *kms)
mdp4_disable(mdp4_kms); mdp4_disable(mdp4_kms);
} }
static void mdp4_prepare_commit(struct msm_kms *kms, struct drm_atomic_state *state)
{
}
static void mdp4_flush_commit(struct msm_kms *kms, unsigned crtc_mask) static void mdp4_flush_commit(struct msm_kms *kms, unsigned crtc_mask)
{ {
/* TODO */ /* TODO */
...@@ -154,7 +150,6 @@ static const struct mdp_kms_funcs kms_funcs = { ...@@ -154,7 +150,6 @@ static const struct mdp_kms_funcs kms_funcs = {
.disable_vblank = mdp4_disable_vblank, .disable_vblank = mdp4_disable_vblank,
.enable_commit = mdp4_enable_commit, .enable_commit = mdp4_enable_commit,
.disable_commit = mdp4_disable_commit, .disable_commit = mdp4_disable_commit,
.prepare_commit = mdp4_prepare_commit,
.flush_commit = mdp4_flush_commit, .flush_commit = mdp4_flush_commit,
.wait_flush = mdp4_wait_flush, .wait_flush = mdp4_wait_flush,
.complete_commit = mdp4_complete_commit, .complete_commit = mdp4_complete_commit,
......
...@@ -655,7 +655,7 @@ static const struct mdp5_cfg_hw msm8x96_config = { ...@@ -655,7 +655,7 @@ static const struct mdp5_cfg_hw msm8x96_config = {
.max_clk = 412500000, .max_clk = 412500000,
}; };
const struct mdp5_cfg_hw msm8x76_config = { static const struct mdp5_cfg_hw msm8x76_config = {
.name = "msm8x76", .name = "msm8x76",
.mdp = { .mdp = {
.count = 1, .count = 1,
......
...@@ -162,47 +162,6 @@ static ssize_t dp_aux_cmd_fifo_rx(struct dp_aux_private *aux, ...@@ -162,47 +162,6 @@ static ssize_t dp_aux_cmd_fifo_rx(struct dp_aux_private *aux,
return i; return i;
} }
static void dp_aux_native_handler(struct dp_aux_private *aux, u32 isr)
{
if (isr & DP_INTR_AUX_I2C_DONE)
aux->aux_error_num = DP_AUX_ERR_NONE;
else if (isr & DP_INTR_WRONG_ADDR)
aux->aux_error_num = DP_AUX_ERR_ADDR;
else if (isr & DP_INTR_TIMEOUT)
aux->aux_error_num = DP_AUX_ERR_TOUT;
if (isr & DP_INTR_NACK_DEFER)
aux->aux_error_num = DP_AUX_ERR_NACK;
if (isr & DP_INTR_AUX_ERROR) {
aux->aux_error_num = DP_AUX_ERR_PHY;
dp_catalog_aux_clear_hw_interrupts(aux->catalog);
}
}
static void dp_aux_i2c_handler(struct dp_aux_private *aux, u32 isr)
{
if (isr & DP_INTR_AUX_I2C_DONE) {
if (isr & (DP_INTR_I2C_NACK | DP_INTR_I2C_DEFER))
aux->aux_error_num = DP_AUX_ERR_NACK;
else
aux->aux_error_num = DP_AUX_ERR_NONE;
} else {
if (isr & DP_INTR_WRONG_ADDR)
aux->aux_error_num = DP_AUX_ERR_ADDR;
else if (isr & DP_INTR_TIMEOUT)
aux->aux_error_num = DP_AUX_ERR_TOUT;
if (isr & DP_INTR_NACK_DEFER)
aux->aux_error_num = DP_AUX_ERR_NACK_DEFER;
if (isr & DP_INTR_I2C_NACK)
aux->aux_error_num = DP_AUX_ERR_NACK;
if (isr & DP_INTR_I2C_DEFER)
aux->aux_error_num = DP_AUX_ERR_DEFER;
if (isr & DP_INTR_AUX_ERROR) {
aux->aux_error_num = DP_AUX_ERR_PHY;
dp_catalog_aux_clear_hw_interrupts(aux->catalog);
}
}
}
static void dp_aux_update_offset_and_segment(struct dp_aux_private *aux, static void dp_aux_update_offset_and_segment(struct dp_aux_private *aux,
struct drm_dp_aux_msg *input_msg) struct drm_dp_aux_msg *input_msg)
{ {
...@@ -409,14 +368,14 @@ static ssize_t dp_aux_transfer(struct drm_dp_aux *dp_aux, ...@@ -409,14 +368,14 @@ static ssize_t dp_aux_transfer(struct drm_dp_aux *dp_aux,
return ret; return ret;
} }
void dp_aux_isr(struct drm_dp_aux *dp_aux) irqreturn_t dp_aux_isr(struct drm_dp_aux *dp_aux)
{ {
u32 isr; u32 isr;
struct dp_aux_private *aux; struct dp_aux_private *aux;
if (!dp_aux) { if (!dp_aux) {
DRM_ERROR("invalid input\n"); DRM_ERROR("invalid input\n");
return; return IRQ_NONE;
} }
aux = container_of(dp_aux, struct dp_aux_private, dp_aux); aux = container_of(dp_aux, struct dp_aux_private, dp_aux);
...@@ -425,17 +384,48 @@ void dp_aux_isr(struct drm_dp_aux *dp_aux) ...@@ -425,17 +384,48 @@ void dp_aux_isr(struct drm_dp_aux *dp_aux)
/* no interrupts pending, return immediately */ /* no interrupts pending, return immediately */
if (!isr) if (!isr)
return; return IRQ_NONE;
if (!aux->cmd_busy) if (!aux->cmd_busy) {
return; DRM_ERROR("Unexpected DP AUX IRQ %#010x when not busy\n", isr);
return IRQ_NONE;
}
/*
* The logic below assumes only one error bit is set (other than "done"
* which can apparently be set at the same time as some of the other
* bits). Warn if more than one get set so we know we need to improve
* the logic.
*/
if (hweight32(isr & ~DP_INTR_AUX_XFER_DONE) > 1)
DRM_WARN("Some DP AUX interrupts unhandled: %#010x\n", isr);
if (aux->native) if (isr & DP_INTR_AUX_ERROR) {
dp_aux_native_handler(aux, isr); aux->aux_error_num = DP_AUX_ERR_PHY;
dp_catalog_aux_clear_hw_interrupts(aux->catalog);
} else if (isr & DP_INTR_NACK_DEFER) {
aux->aux_error_num = DP_AUX_ERR_NACK_DEFER;
} else if (isr & DP_INTR_WRONG_ADDR) {
aux->aux_error_num = DP_AUX_ERR_ADDR;
} else if (isr & DP_INTR_TIMEOUT) {
aux->aux_error_num = DP_AUX_ERR_TOUT;
} else if (!aux->native && (isr & DP_INTR_I2C_NACK)) {
aux->aux_error_num = DP_AUX_ERR_NACK;
} else if (!aux->native && (isr & DP_INTR_I2C_DEFER)) {
if (isr & DP_INTR_AUX_XFER_DONE)
aux->aux_error_num = DP_AUX_ERR_NACK;
else else
dp_aux_i2c_handler(aux, isr); aux->aux_error_num = DP_AUX_ERR_DEFER;
} else if (isr & DP_INTR_AUX_XFER_DONE) {
aux->aux_error_num = DP_AUX_ERR_NONE;
} else {
DRM_WARN("Unexpected interrupt: %#010x\n", isr);
return IRQ_NONE;
}
complete(&aux->comp); complete(&aux->comp);
return IRQ_HANDLED;
} }
void dp_aux_reconfig(struct drm_dp_aux *dp_aux) void dp_aux_reconfig(struct drm_dp_aux *dp_aux)
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
int dp_aux_register(struct drm_dp_aux *dp_aux); int dp_aux_register(struct drm_dp_aux *dp_aux);
void dp_aux_unregister(struct drm_dp_aux *dp_aux); void dp_aux_unregister(struct drm_dp_aux *dp_aux);
void dp_aux_isr(struct drm_dp_aux *dp_aux); irqreturn_t dp_aux_isr(struct drm_dp_aux *dp_aux);
void dp_aux_init(struct drm_dp_aux *dp_aux); void dp_aux_init(struct drm_dp_aux *dp_aux);
void dp_aux_deinit(struct drm_dp_aux *dp_aux); void dp_aux_deinit(struct drm_dp_aux *dp_aux);
void dp_aux_reconfig(struct drm_dp_aux *dp_aux); void dp_aux_reconfig(struct drm_dp_aux *dp_aux);
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#define DP_INTF_CONFIG_DATABUS_WIDEN BIT(4) #define DP_INTF_CONFIG_DATABUS_WIDEN BIT(4)
#define DP_INTERRUPT_STATUS1 \ #define DP_INTERRUPT_STATUS1 \
(DP_INTR_AUX_I2C_DONE| \ (DP_INTR_AUX_XFER_DONE| \
DP_INTR_WRONG_ADDR | DP_INTR_TIMEOUT | \ DP_INTR_WRONG_ADDR | DP_INTR_TIMEOUT | \
DP_INTR_NACK_DEFER | DP_INTR_WRONG_DATA_CNT | \ DP_INTR_NACK_DEFER | DP_INTR_WRONG_DATA_CNT | \
DP_INTR_I2C_NACK | DP_INTR_I2C_DEFER | \ DP_INTR_I2C_NACK | DP_INTR_I2C_DEFER | \
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
/* interrupts */ /* interrupts */
#define DP_INTR_HPD BIT(0) #define DP_INTR_HPD BIT(0)
#define DP_INTR_AUX_I2C_DONE BIT(3) #define DP_INTR_AUX_XFER_DONE BIT(3)
#define DP_INTR_WRONG_ADDR BIT(6) #define DP_INTR_WRONG_ADDR BIT(6)
#define DP_INTR_TIMEOUT BIT(9) #define DP_INTR_TIMEOUT BIT(9)
#define DP_INTR_NACK_DEFER BIT(12) #define DP_INTR_NACK_DEFER BIT(12)
......
...@@ -2042,13 +2042,14 @@ int dp_ctrl_off(struct dp_ctrl *dp_ctrl) ...@@ -2042,13 +2042,14 @@ int dp_ctrl_off(struct dp_ctrl *dp_ctrl)
return ret; return ret;
} }
void dp_ctrl_isr(struct dp_ctrl *dp_ctrl) irqreturn_t dp_ctrl_isr(struct dp_ctrl *dp_ctrl)
{ {
struct dp_ctrl_private *ctrl; struct dp_ctrl_private *ctrl;
u32 isr; u32 isr;
irqreturn_t ret = IRQ_NONE;
if (!dp_ctrl) if (!dp_ctrl)
return; return IRQ_NONE;
ctrl = container_of(dp_ctrl, struct dp_ctrl_private, dp_ctrl); ctrl = container_of(dp_ctrl, struct dp_ctrl_private, dp_ctrl);
...@@ -2070,15 +2071,20 @@ void dp_ctrl_isr(struct dp_ctrl *dp_ctrl) ...@@ -2070,15 +2071,20 @@ void dp_ctrl_isr(struct dp_ctrl *dp_ctrl)
isr = dp_catalog_ctrl_get_interrupt(ctrl->catalog); isr = dp_catalog_ctrl_get_interrupt(ctrl->catalog);
if (isr & DP_CTRL_INTR_READY_FOR_VIDEO) { if (isr & DP_CTRL_INTR_READY_FOR_VIDEO) {
drm_dbg_dp(ctrl->drm_dev, "dp_video_ready\n"); drm_dbg_dp(ctrl->drm_dev, "dp_video_ready\n");
complete(&ctrl->video_comp); complete(&ctrl->video_comp);
ret = IRQ_HANDLED;
} }
if (isr & DP_CTRL_INTR_IDLE_PATTERN_SENT) { if (isr & DP_CTRL_INTR_IDLE_PATTERN_SENT) {
drm_dbg_dp(ctrl->drm_dev, "idle_patterns_sent\n"); drm_dbg_dp(ctrl->drm_dev, "idle_patterns_sent\n");
complete(&ctrl->idle_comp); complete(&ctrl->idle_comp);
ret = IRQ_HANDLED;
} }
return ret;
} }
struct dp_ctrl *dp_ctrl_get(struct device *dev, struct dp_link *link, struct dp_ctrl *dp_ctrl_get(struct device *dev, struct dp_link *link,
......
...@@ -25,7 +25,7 @@ int dp_ctrl_off_link_stream(struct dp_ctrl *dp_ctrl); ...@@ -25,7 +25,7 @@ int dp_ctrl_off_link_stream(struct dp_ctrl *dp_ctrl);
int dp_ctrl_off_link(struct dp_ctrl *dp_ctrl); int dp_ctrl_off_link(struct dp_ctrl *dp_ctrl);
int dp_ctrl_off(struct dp_ctrl *dp_ctrl); int dp_ctrl_off(struct dp_ctrl *dp_ctrl);
void dp_ctrl_push_idle(struct dp_ctrl *dp_ctrl); void dp_ctrl_push_idle(struct dp_ctrl *dp_ctrl);
void dp_ctrl_isr(struct dp_ctrl *dp_ctrl); irqreturn_t dp_ctrl_isr(struct dp_ctrl *dp_ctrl);
void dp_ctrl_handle_sink_request(struct dp_ctrl *dp_ctrl); void dp_ctrl_handle_sink_request(struct dp_ctrl *dp_ctrl);
struct dp_ctrl *dp_ctrl_get(struct device *dev, struct dp_link *link, struct dp_ctrl *dp_ctrl_get(struct device *dev, struct dp_link *link,
struct dp_panel *panel, struct drm_dp_aux *aux, struct dp_panel *panel, struct drm_dp_aux *aux,
......
...@@ -1215,7 +1215,7 @@ static int dp_hpd_event_thread_start(struct dp_display_private *dp_priv) ...@@ -1215,7 +1215,7 @@ static int dp_hpd_event_thread_start(struct dp_display_private *dp_priv)
static irqreturn_t dp_display_irq_handler(int irq, void *dev_id) static irqreturn_t dp_display_irq_handler(int irq, void *dev_id)
{ {
struct dp_display_private *dp = dev_id; struct dp_display_private *dp = dev_id;
irqreturn_t ret = IRQ_HANDLED; irqreturn_t ret = IRQ_NONE;
u32 hpd_isr_status; u32 hpd_isr_status;
if (!dp) { if (!dp) {
...@@ -1243,13 +1243,15 @@ static irqreturn_t dp_display_irq_handler(int irq, void *dev_id) ...@@ -1243,13 +1243,15 @@ static irqreturn_t dp_display_irq_handler(int irq, void *dev_id)
if (hpd_isr_status & DP_DP_HPD_UNPLUG_INT_MASK) if (hpd_isr_status & DP_DP_HPD_UNPLUG_INT_MASK)
dp_add_event(dp, EV_HPD_UNPLUG_INT, 0, 0); dp_add_event(dp, EV_HPD_UNPLUG_INT, 0, 0);
ret = IRQ_HANDLED;
} }
/* DP controller isr */ /* DP controller isr */
dp_ctrl_isr(dp->ctrl); ret |= dp_ctrl_isr(dp->ctrl);
/* DP aux isr */ /* DP aux isr */
dp_aux_isr(dp->aux); ret |= dp_aux_isr(dp->aux);
return ret; return ret;
} }
......
...@@ -1090,7 +1090,7 @@ int dp_link_process_request(struct dp_link *dp_link) ...@@ -1090,7 +1090,7 @@ int dp_link_process_request(struct dp_link *dp_link)
} else if (dp_link_read_psr_error_status(link)) { } else if (dp_link_read_psr_error_status(link)) {
DRM_ERROR("PSR IRQ_HPD received\n"); DRM_ERROR("PSR IRQ_HPD received\n");
} else if (dp_link_psr_capability_changed(link)) { } else if (dp_link_psr_capability_changed(link)) {
drm_dbg_dp(link->drm_dev, "PSR Capabiity changed"); drm_dbg_dp(link->drm_dev, "PSR Capability changed");
} else { } else {
ret = dp_link_process_link_status_update(link); ret = dp_link_process_link_status_update(link);
if (!ret) { if (!ret) {
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
*/ */
#include "dsi.h" #include "dsi.h"
#include "dsi_cfg.h"
bool msm_dsi_is_cmd_mode(struct msm_dsi *msm_dsi) bool msm_dsi_is_cmd_mode(struct msm_dsi *msm_dsi)
{ {
...@@ -173,8 +172,10 @@ static int dsi_dev_remove(struct platform_device *pdev) ...@@ -173,8 +172,10 @@ static int dsi_dev_remove(struct platform_device *pdev)
} }
static const struct of_device_id dt_match[] = { static const struct of_device_id dt_match[] = {
{ .compatible = "qcom,mdss-dsi-ctrl", .data = NULL /* autodetect cfg */ }, { .compatible = "qcom,mdss-dsi-ctrl" },
{ .compatible = "qcom,dsi-ctrl-6g-qcm2290", .data = &qcm2290_dsi_cfg_handler },
/* Deprecated, don't use */
{ .compatible = "qcom,dsi-ctrl-6g-qcm2290" },
{} {}
}; };
......
...@@ -21,8 +21,9 @@ static const struct msm_dsi_config apq8064_dsi_cfg = { ...@@ -21,8 +21,9 @@ static const struct msm_dsi_config apq8064_dsi_cfg = {
.num_regulators = ARRAY_SIZE(apq8064_dsi_regulators), .num_regulators = ARRAY_SIZE(apq8064_dsi_regulators),
.bus_clk_names = dsi_v2_bus_clk_names, .bus_clk_names = dsi_v2_bus_clk_names,
.num_bus_clks = ARRAY_SIZE(dsi_v2_bus_clk_names), .num_bus_clks = ARRAY_SIZE(dsi_v2_bus_clk_names),
.io_start = { 0x4700000, 0x5800000 }, .io_start = {
.num_dsi = 2, { 0x4700000, 0x5800000 },
},
}; };
static const char * const dsi_6g_bus_clk_names[] = { static const char * const dsi_6g_bus_clk_names[] = {
...@@ -41,46 +42,40 @@ static const struct msm_dsi_config msm8974_apq8084_dsi_cfg = { ...@@ -41,46 +42,40 @@ static const struct msm_dsi_config msm8974_apq8084_dsi_cfg = {
.num_regulators = ARRAY_SIZE(msm8974_apq8084_regulators), .num_regulators = ARRAY_SIZE(msm8974_apq8084_regulators),
.bus_clk_names = dsi_6g_bus_clk_names, .bus_clk_names = dsi_6g_bus_clk_names,
.num_bus_clks = ARRAY_SIZE(dsi_6g_bus_clk_names), .num_bus_clks = ARRAY_SIZE(dsi_6g_bus_clk_names),
.io_start = { 0xfd922800, 0xfd922b00 }, .io_start = {
.num_dsi = 2, { 0xfd922800, 0xfd922b00 },
},
}; };
static const char * const dsi_8916_bus_clk_names[] = { static const char * const dsi_v1_3_1_clk_names[] = {
"mdp_core", "iface", "bus", "mdp_core", "iface", "bus",
}; };
static const struct regulator_bulk_data msm8916_dsi_regulators[] = { static const struct regulator_bulk_data dsi_v1_3_1_regulators[] = {
{ .supply = "vdda", .init_load_uA = 100000 }, /* 1.2 V */ { .supply = "vdda", .init_load_uA = 100000 }, /* 1.2 V */
{ .supply = "vddio", .init_load_uA = 100000 }, /* 1.8 V */ { .supply = "vddio", .init_load_uA = 100000 }, /* 1.8 V */
}; };
static const struct msm_dsi_config msm8916_dsi_cfg = { static const struct msm_dsi_config msm8916_dsi_cfg = {
.io_offset = DSI_6G_REG_SHIFT, .io_offset = DSI_6G_REG_SHIFT,
.regulator_data = msm8916_dsi_regulators, .regulator_data = dsi_v1_3_1_regulators,
.num_regulators = ARRAY_SIZE(msm8916_dsi_regulators), .num_regulators = ARRAY_SIZE(dsi_v1_3_1_regulators),
.bus_clk_names = dsi_8916_bus_clk_names, .bus_clk_names = dsi_v1_3_1_clk_names,
.num_bus_clks = ARRAY_SIZE(dsi_8916_bus_clk_names), .num_bus_clks = ARRAY_SIZE(dsi_v1_3_1_clk_names),
.io_start = { 0x1a98000 }, .io_start = {
.num_dsi = 1, { 0x1a98000 },
}; },
static const char * const dsi_8976_bus_clk_names[] = {
"mdp_core", "iface", "bus",
};
static const struct regulator_bulk_data msm8976_dsi_regulators[] = {
{ .supply = "vdda", .init_load_uA = 100000 }, /* 1.2 V */
{ .supply = "vddio", .init_load_uA = 100000 }, /* 1.8 V */
}; };
static const struct msm_dsi_config msm8976_dsi_cfg = { static const struct msm_dsi_config msm8976_dsi_cfg = {
.io_offset = DSI_6G_REG_SHIFT, .io_offset = DSI_6G_REG_SHIFT,
.regulator_data = msm8976_dsi_regulators, .regulator_data = dsi_v1_3_1_regulators,
.num_regulators = ARRAY_SIZE(msm8976_dsi_regulators), .num_regulators = ARRAY_SIZE(dsi_v1_3_1_regulators),
.bus_clk_names = dsi_8976_bus_clk_names, .bus_clk_names = dsi_v1_3_1_clk_names,
.num_bus_clks = ARRAY_SIZE(dsi_8976_bus_clk_names), .num_bus_clks = ARRAY_SIZE(dsi_v1_3_1_clk_names),
.io_start = { 0x1a94000, 0x1a96000 }, .io_start = {
.num_dsi = 2, { 0x1a94000, 0x1a96000 },
},
}; };
static const struct regulator_bulk_data msm8994_dsi_regulators[] = { static const struct regulator_bulk_data msm8994_dsi_regulators[] = {
...@@ -98,12 +93,9 @@ static const struct msm_dsi_config msm8994_dsi_cfg = { ...@@ -98,12 +93,9 @@ static const struct msm_dsi_config msm8994_dsi_cfg = {
.num_regulators = ARRAY_SIZE(msm8994_dsi_regulators), .num_regulators = ARRAY_SIZE(msm8994_dsi_regulators),
.bus_clk_names = dsi_6g_bus_clk_names, .bus_clk_names = dsi_6g_bus_clk_names,
.num_bus_clks = ARRAY_SIZE(dsi_6g_bus_clk_names), .num_bus_clks = ARRAY_SIZE(dsi_6g_bus_clk_names),
.io_start = { 0xfd998000, 0xfd9a0000 }, .io_start = {
.num_dsi = 2, { 0xfd998000, 0xfd9a0000 },
}; },
static const char * const dsi_8996_bus_clk_names[] = {
"mdp_core", "iface", "bus", "core_mmss",
}; };
static const struct regulator_bulk_data msm8996_dsi_regulators[] = { static const struct regulator_bulk_data msm8996_dsi_regulators[] = {
...@@ -116,10 +108,11 @@ static const struct msm_dsi_config msm8996_dsi_cfg = { ...@@ -116,10 +108,11 @@ static const struct msm_dsi_config msm8996_dsi_cfg = {
.io_offset = DSI_6G_REG_SHIFT, .io_offset = DSI_6G_REG_SHIFT,
.regulator_data = msm8996_dsi_regulators, .regulator_data = msm8996_dsi_regulators,
.num_regulators = ARRAY_SIZE(msm8996_dsi_regulators), .num_regulators = ARRAY_SIZE(msm8996_dsi_regulators),
.bus_clk_names = dsi_8996_bus_clk_names, .bus_clk_names = dsi_6g_bus_clk_names,
.num_bus_clks = ARRAY_SIZE(dsi_8996_bus_clk_names), .num_bus_clks = ARRAY_SIZE(dsi_6g_bus_clk_names),
.io_start = { 0x994000, 0x996000 }, .io_start = {
.num_dsi = 2, { 0x994000, 0x996000 },
},
}; };
static const char * const dsi_msm8998_bus_clk_names[] = { static const char * const dsi_msm8998_bus_clk_names[] = {
...@@ -137,8 +130,9 @@ static const struct msm_dsi_config msm8998_dsi_cfg = { ...@@ -137,8 +130,9 @@ static const struct msm_dsi_config msm8998_dsi_cfg = {
.num_regulators = ARRAY_SIZE(msm8998_dsi_regulators), .num_regulators = ARRAY_SIZE(msm8998_dsi_regulators),
.bus_clk_names = dsi_msm8998_bus_clk_names, .bus_clk_names = dsi_msm8998_bus_clk_names,
.num_bus_clks = ARRAY_SIZE(dsi_msm8998_bus_clk_names), .num_bus_clks = ARRAY_SIZE(dsi_msm8998_bus_clk_names),
.io_start = { 0xc994000, 0xc996000 }, .io_start = {
.num_dsi = 2, { 0xc994000, 0xc996000 },
},
}; };
static const char * const dsi_sdm660_bus_clk_names[] = { static const char * const dsi_sdm660_bus_clk_names[] = {
...@@ -155,30 +149,29 @@ static const struct msm_dsi_config sdm660_dsi_cfg = { ...@@ -155,30 +149,29 @@ static const struct msm_dsi_config sdm660_dsi_cfg = {
.num_regulators = ARRAY_SIZE(sdm660_dsi_regulators), .num_regulators = ARRAY_SIZE(sdm660_dsi_regulators),
.bus_clk_names = dsi_sdm660_bus_clk_names, .bus_clk_names = dsi_sdm660_bus_clk_names,
.num_bus_clks = ARRAY_SIZE(dsi_sdm660_bus_clk_names), .num_bus_clks = ARRAY_SIZE(dsi_sdm660_bus_clk_names),
.io_start = { 0xc994000, 0xc996000 }, .io_start = {
.num_dsi = 2, { 0xc994000, 0xc996000 },
},
}; };
static const char * const dsi_sdm845_bus_clk_names[] = { static const char * const dsi_v2_4_clk_names[] = {
"iface", "bus", "iface", "bus",
}; };
static const char * const dsi_sc7180_bus_clk_names[] = { static const struct regulator_bulk_data dsi_v2_4_regulators[] = {
"iface", "bus",
};
static const struct regulator_bulk_data sdm845_dsi_regulators[] = {
{ .supply = "vdda", .init_load_uA = 21800 }, /* 1.2 V */ { .supply = "vdda", .init_load_uA = 21800 }, /* 1.2 V */
}; };
static const struct msm_dsi_config sdm845_dsi_cfg = { static const struct msm_dsi_config sdm845_dsi_cfg = {
.io_offset = DSI_6G_REG_SHIFT, .io_offset = DSI_6G_REG_SHIFT,
.regulator_data = sdm845_dsi_regulators, .regulator_data = dsi_v2_4_regulators,
.num_regulators = ARRAY_SIZE(sdm845_dsi_regulators), .num_regulators = ARRAY_SIZE(dsi_v2_4_regulators),
.bus_clk_names = dsi_sdm845_bus_clk_names, .bus_clk_names = dsi_v2_4_clk_names,
.num_bus_clks = ARRAY_SIZE(dsi_sdm845_bus_clk_names), .num_bus_clks = ARRAY_SIZE(dsi_v2_4_clk_names),
.io_start = { 0xae94000, 0xae96000 }, .io_start = {
.num_dsi = 2, { 0xae94000, 0xae96000 }, /* SDM845 / SDM670 */
{ 0x5e94000 }, /* QCM2290 / SM6115 / SM6125 / SM6375 */
},
}; };
static const struct regulator_bulk_data sm8550_dsi_regulators[] = { static const struct regulator_bulk_data sm8550_dsi_regulators[] = {
...@@ -189,28 +182,11 @@ static const struct msm_dsi_config sm8550_dsi_cfg = { ...@@ -189,28 +182,11 @@ static const struct msm_dsi_config sm8550_dsi_cfg = {
.io_offset = DSI_6G_REG_SHIFT, .io_offset = DSI_6G_REG_SHIFT,
.regulator_data = sm8550_dsi_regulators, .regulator_data = sm8550_dsi_regulators,
.num_regulators = ARRAY_SIZE(sm8550_dsi_regulators), .num_regulators = ARRAY_SIZE(sm8550_dsi_regulators),
.bus_clk_names = dsi_sdm845_bus_clk_names, .bus_clk_names = dsi_v2_4_clk_names,
.num_bus_clks = ARRAY_SIZE(dsi_sdm845_bus_clk_names), .num_bus_clks = ARRAY_SIZE(dsi_v2_4_clk_names),
.io_start = { 0xae94000, 0xae96000 }, .io_start = {
.num_dsi = 2, { 0xae94000, 0xae96000 },
}; },
static const struct regulator_bulk_data sc7180_dsi_regulators[] = {
{ .supply = "vdda", .init_load_uA = 21800 }, /* 1.2 V */
};
static const struct msm_dsi_config sc7180_dsi_cfg = {
.io_offset = DSI_6G_REG_SHIFT,
.regulator_data = sc7180_dsi_regulators,
.num_regulators = ARRAY_SIZE(sc7180_dsi_regulators),
.bus_clk_names = dsi_sc7180_bus_clk_names,
.num_bus_clks = ARRAY_SIZE(dsi_sc7180_bus_clk_names),
.io_start = { 0xae94000 },
.num_dsi = 1,
};
static const char * const dsi_sc7280_bus_clk_names[] = {
"iface", "bus",
}; };
static const struct regulator_bulk_data sc7280_dsi_regulators[] = { static const struct regulator_bulk_data sc7280_dsi_regulators[] = {
...@@ -221,28 +197,11 @@ static const struct msm_dsi_config sc7280_dsi_cfg = { ...@@ -221,28 +197,11 @@ static const struct msm_dsi_config sc7280_dsi_cfg = {
.io_offset = DSI_6G_REG_SHIFT, .io_offset = DSI_6G_REG_SHIFT,
.regulator_data = sc7280_dsi_regulators, .regulator_data = sc7280_dsi_regulators,
.num_regulators = ARRAY_SIZE(sc7280_dsi_regulators), .num_regulators = ARRAY_SIZE(sc7280_dsi_regulators),
.bus_clk_names = dsi_sc7280_bus_clk_names, .bus_clk_names = dsi_v2_4_clk_names,
.num_bus_clks = ARRAY_SIZE(dsi_sc7280_bus_clk_names), .num_bus_clks = ARRAY_SIZE(dsi_v2_4_clk_names),
.io_start = { 0xae94000, 0xae96000 }, .io_start = {
.num_dsi = 2, { 0xae94000, 0xae96000 },
}; },
static const char * const dsi_qcm2290_bus_clk_names[] = {
"iface", "bus",
};
static const struct regulator_bulk_data qcm2290_dsi_cfg_regulators[] = {
{ .supply = "vdda", .init_load_uA = 21800 }, /* 1.2 V */
};
static const struct msm_dsi_config qcm2290_dsi_cfg = {
.io_offset = DSI_6G_REG_SHIFT,
.regulator_data = qcm2290_dsi_cfg_regulators,
.num_regulators = ARRAY_SIZE(qcm2290_dsi_cfg_regulators),
.bus_clk_names = dsi_qcm2290_bus_clk_names,
.num_bus_clks = ARRAY_SIZE(dsi_qcm2290_bus_clk_names),
.io_start = { 0x5e94000 },
.num_dsi = 1,
}; };
static const struct msm_dsi_host_cfg_ops msm_dsi_v2_host_ops = { static const struct msm_dsi_host_cfg_ops msm_dsi_v2_host_ops = {
...@@ -311,7 +270,7 @@ static const struct msm_dsi_cfg_handler dsi_cfg_handlers[] = { ...@@ -311,7 +270,7 @@ static const struct msm_dsi_cfg_handler dsi_cfg_handlers[] = {
{MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_4_0, {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_4_0,
&sdm845_dsi_cfg, &msm_dsi_6g_v2_host_ops}, &sdm845_dsi_cfg, &msm_dsi_6g_v2_host_ops},
{MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_4_1, {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_4_1,
&sc7180_dsi_cfg, &msm_dsi_6g_v2_host_ops}, &sdm845_dsi_cfg, &msm_dsi_6g_v2_host_ops},
{MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_5_0, {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_5_0,
&sc7280_dsi_cfg, &msm_dsi_6g_v2_host_ops}, &sc7280_dsi_cfg, &msm_dsi_6g_v2_host_ops},
{MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_6_0, {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_6_0,
...@@ -335,9 +294,3 @@ const struct msm_dsi_cfg_handler *msm_dsi_cfg_get(u32 major, u32 minor) ...@@ -335,9 +294,3 @@ const struct msm_dsi_cfg_handler *msm_dsi_cfg_get(u32 major, u32 minor)
return cfg_hnd; return cfg_hnd;
} }
/* Non autodetect configs */
const struct msm_dsi_cfg_handler qcm2290_dsi_cfg_handler = {
.cfg = &qcm2290_dsi_cfg,
.ops = &msm_dsi_6g_v2_host_ops,
};
...@@ -32,14 +32,16 @@ ...@@ -32,14 +32,16 @@
#define DSI_6G_REG_SHIFT 4 #define DSI_6G_REG_SHIFT 4
/* Maximum number of configurations matched against the same hw revision */
#define VARIANTS_MAX 2
struct msm_dsi_config { struct msm_dsi_config {
u32 io_offset; u32 io_offset;
const struct regulator_bulk_data *regulator_data; const struct regulator_bulk_data *regulator_data;
int num_regulators; int num_regulators;
const char * const *bus_clk_names; const char * const *bus_clk_names;
const int num_bus_clks; const int num_bus_clks;
const resource_size_t io_start[DSI_MAX]; const resource_size_t io_start[VARIANTS_MAX][DSI_MAX];
const int num_dsi;
}; };
struct msm_dsi_host_cfg_ops { struct msm_dsi_host_cfg_ops {
...@@ -63,8 +65,5 @@ struct msm_dsi_cfg_handler { ...@@ -63,8 +65,5 @@ struct msm_dsi_cfg_handler {
const struct msm_dsi_cfg_handler *msm_dsi_cfg_get(u32 major, u32 minor); const struct msm_dsi_cfg_handler *msm_dsi_cfg_get(u32 major, u32 minor);
/* Non autodetect configs */
extern const struct msm_dsi_cfg_handler qcm2290_dsi_cfg_handler;
#endif /* __MSM_DSI_CFG_H__ */ #endif /* __MSM_DSI_CFG_H__ */
...@@ -214,10 +214,6 @@ static const struct msm_dsi_cfg_handler *dsi_get_config( ...@@ -214,10 +214,6 @@ static const struct msm_dsi_cfg_handler *dsi_get_config(
int ret; int ret;
u32 major = 0, minor = 0; u32 major = 0, minor = 0;
cfg_hnd = device_get_match_data(dev);
if (cfg_hnd)
return cfg_hnd;
ahb_clk = msm_clk_get(msm_host->pdev, "iface"); ahb_clk = msm_clk_get(msm_host->pdev, "iface");
if (IS_ERR(ahb_clk)) { if (IS_ERR(ahb_clk)) {
pr_err("%s: cannot get interface clock\n", __func__); pr_err("%s: cannot get interface clock\n", __func__);
...@@ -1862,16 +1858,16 @@ static int dsi_host_get_id(struct msm_dsi_host *msm_host) ...@@ -1862,16 +1858,16 @@ static int dsi_host_get_id(struct msm_dsi_host *msm_host)
struct platform_device *pdev = msm_host->pdev; struct platform_device *pdev = msm_host->pdev;
const struct msm_dsi_config *cfg = msm_host->cfg_hnd->cfg; const struct msm_dsi_config *cfg = msm_host->cfg_hnd->cfg;
struct resource *res; struct resource *res;
int i; int i, j;
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dsi_ctrl"); res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dsi_ctrl");
if (!res) if (!res)
return -EINVAL; return -EINVAL;
for (i = 0; i < cfg->num_dsi; i++) { for (i = 0; i < VARIANTS_MAX; i++)
if (cfg->io_start[i] == res->start) for (j = 0; j < DSI_MAX; j++)
return i; if (cfg->io_start[i][j] == res->start)
} return j;
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment