Global symbols in the kernel should be prefixed by the name of the subsystem and/or driver to avoid conflicts when all code is built-in. In this case, function names like 'hdmi_register' or 'hdmi_set_mode' are way too generic for an MSM specific DRM driver, so I'm renaming them all to msm_hdmi_* here. I also rename a lot of the 'static' symbols along with the global names for consistency, even though those are relatively harmless; they might only be slightly confusing when they show up in backtraces.
Unified · Split
| @@ -21,7 +21,7 @@ · 20 unmodified lines | |||
| 21 | 21 | ||
| 22 | #include "hdmi.h" | 22 | #include "hdmi.h" |
| 23 | 23 | ||
| 24 | void hdmi_set_mode(struct hdmi *hdmi, bool power_on) | 24 | void msm_hdmi_set_mode(struct hdmi *hdmi, bool power_on) |
| 25 | { | 25 | { |
| 26 | uint32_t ctrl = 0; | 26 | uint32_t ctrl = 0; |
| 27 | unsigned long flags; | 27 | unsigned long flags; |
| @@ -46,26 +46,26 @@ void hdmi_set_mode(struct hdmi *hdmi, bool power_on) · 18 unmodified lines | |||
| 46 | power_on ? "Enable" : "Disable", ctrl); | 46 | power_on ? "Enable" : "Disable", ctrl); |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | static irqreturn_t hdmi_irq(int irq, void *dev_id) | 49 | static irqreturn_t msm_hdmi_irq(int irq, void *dev_id) |
| 50 | { | 50 | { |
| 51 | struct hdmi *hdmi = dev_id; | 51 | struct hdmi *hdmi = dev_id; |
| 52 | 52 | ||
| 53 | /* Process HPD: */ | 53 | /* Process HPD: */ |
| 54 | hdmi_connector_irq(hdmi->connector); | 54 | msm_hdmi_connector_irq(hdmi->connector); |
| 55 | 55 | ||
| 56 | /* Process DDC: */ | 56 | /* Process DDC: */ |
| 57 | hdmi_i2c_irq(hdmi->i2c); | 57 | msm_hdmi_i2c_irq(hdmi->i2c); |
| 58 | 58 | ||
| 59 | /* Process HDCP: */ | 59 | /* Process HDCP: */ |
| 60 | if (hdmi->hdcp_ctrl) | 60 | if (hdmi->hdcp_ctrl) |
| 61 | hdmi_hdcp_irq(hdmi->hdcp_ctrl); | 61 | msm_hdmi_hdcp_irq(hdmi->hdcp_ctrl); |
| 62 | 62 | ||
| 63 | /* TODO audio.. */ | 63 | /* TODO audio.. */ |
| 64 | 64 | ||
| 65 | return IRQ_HANDLED; | 65 | return IRQ_HANDLED; |
| 66 | } | 66 | } |
| 67 | 67 | ||
| 68 | static void hdmi_destroy(struct hdmi *hdmi) | 68 | static void msm_hdmi_destroy(struct hdmi *hdmi) |
| 69 | { | 69 | { |
| 70 | /* | 70 | /* |
| 71 | * at this point, hpd has been disabled, | 71 | * at this point, hpd has been disabled, |
| @@ -75,7 +75,7 @@ static void hdmi_destroy(struct hdmi *hdmi) · 3 unmodified lines | |||
| 75 | flush_workqueue(hdmi->workq); | 75 | flush_workqueue(hdmi->workq); |
| 76 | destroy_workqueue(hdmi->workq); | 76 | destroy_workqueue(hdmi->workq); |
| 77 | } | 77 | } |
| 78 | hdmi_hdcp_destroy(hdmi); | 78 | msm_hdmi_hdcp_destroy(hdmi); |
| 79 | 79 | ||
| 80 | if (hdmi->phy_dev) { | 80 | if (hdmi->phy_dev) { |
| 81 | put_device(hdmi->phy_dev); | 81 | put_device(hdmi->phy_dev); |
| @@ -84,12 +84,12 @@ static void hdmi_destroy(struct hdmi *hdmi) · 2 unmodified lines | |||
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | if (hdmi->i2c) | 86 | if (hdmi->i2c) |
| 87 | hdmi_i2c_destroy(hdmi->i2c); | 87 | msm_hdmi_i2c_destroy(hdmi->i2c); |
| 88 | 88 | ||
| 89 | platform_set_drvdata(hdmi->pdev, NULL); | 89 | platform_set_drvdata(hdmi->pdev, NULL); |
| 90 | } | 90 | } |
| 91 | 91 | ||
| 92 | static int hdmi_get_phy(struct hdmi *hdmi) | 92 | static int msm_hdmi_get_phy(struct hdmi *hdmi) |
| 93 | { | 93 | { |
| 94 | struct platform_device *pdev = hdmi->pdev; | 94 | struct platform_device *pdev = hdmi->pdev; |
| 95 | struct platform_device *phy_pdev; | 95 | struct platform_device *phy_pdev; |
| @@ -121,7 +121,7 @@ static int hdmi_get_phy(struct hdmi *hdmi) · 25 unmodified lines | |||
| 121 | * we are to EPROBE_DEFER we want to do it here, rather than later | 121 | * we are to EPROBE_DEFER we want to do it here, rather than later |
| 122 | * at modeset_init() time | 122 | * at modeset_init() time |
| 123 | */ | 123 | */ |
| 124 | static struct hdmi *hdmi_init(struct platform_device *pdev) | 124 | static struct hdmi *msm_hdmi_init(struct platform_device *pdev) |
| 125 | { | 125 | { |
| 126 | struct hdmi_platform_config *config = pdev->dev.platform_data; | 126 | struct hdmi_platform_config *config = pdev->dev.platform_data; |
| 127 | struct hdmi *hdmi = NULL; | 127 | struct hdmi *hdmi = NULL; |
| @@ -240,7 +240,7 @@ static struct hdmi *hdmi_init(struct platform_device *pdev) · 112 unmodified lines | |||
| 240 | 240 | ||
| 241 | hdmi->workq = alloc_ordered_workqueue("msm_hdmi", 0); | 241 | hdmi->workq = alloc_ordered_workqueue("msm_hdmi", 0); |
| 242 | 242 | ||
| 243 | hdmi->i2c = hdmi_i2c_init(hdmi); | 243 | hdmi->i2c = msm_hdmi_i2c_init(hdmi); |
| 244 | if (IS_ERR(hdmi->i2c)) { | 244 | if (IS_ERR(hdmi->i2c)) { |
| 245 | ret = PTR_ERR(hdmi->i2c); | 245 | ret = PTR_ERR(hdmi->i2c); |
| 246 | dev_err(&pdev->dev, "failed to get i2c: %d\n", ret); | 246 | dev_err(&pdev->dev, "failed to get i2c: %d\n", ret); |
| @@ -248,13 +248,13 @@ static struct hdmi *hdmi_init(struct platform_device *pdev) · 1 unmodified line | |||
| 248 | goto fail; | 248 | goto fail; |
| 249 | } | 249 | } |
| 250 | 250 | ||
| 251 | ret = hdmi_get_phy(hdmi); | 251 | ret = msm_hdmi_get_phy(hdmi); |
| 252 | if (ret) { | 252 | if (ret) { |
| 253 | dev_err(&pdev->dev, "failed to get phy\n"); | 253 | dev_err(&pdev->dev, "failed to get phy\n"); |
| 254 | goto fail; | 254 | goto fail; |
| 255 | } | 255 | } |
| 256 | 256 | ||
| 257 | hdmi->hdcp_ctrl = hdmi_hdcp_init(hdmi); | 257 | hdmi->hdcp_ctrl = msm_hdmi_hdcp_init(hdmi); |
| 258 | if (IS_ERR(hdmi->hdcp_ctrl)) { | 258 | if (IS_ERR(hdmi->hdcp_ctrl)) { |
| 259 | dev_warn(&pdev->dev, "failed to init hdcp: disabled\n"); | 259 | dev_warn(&pdev->dev, "failed to init hdcp: disabled\n"); |
| 260 | hdmi->hdcp_ctrl = NULL; | 260 | hdmi->hdcp_ctrl = NULL; |
| @@ -264,7 +264,7 @@ static struct hdmi *hdmi_init(struct platform_device *pdev) · 3 unmodified lines | |||
| 264 | 264 | ||
| 265 | fail: | 265 | fail: |
| 266 | if (hdmi) | 266 | if (hdmi) |
| 267 | hdmi_destroy(hdmi); | 267 | msm_hdmi_destroy(hdmi); |
| 268 | 268 | ||
| 269 | return ERR_PTR(ret); | 269 | return ERR_PTR(ret); |
| 270 | } | 270 | } |
| @@ -274,10 +274,10 @@ fail: · 3 unmodified lines | |||
| 274 | * driver (not hdmi sub-device's probe/bind!) | 274 | * driver (not hdmi sub-device's probe/bind!) |
| 275 | * | 275 | * |
| 276 | * Any resource (regulator/clk/etc) which could be missing at boot | 276 | * Any resource (regulator/clk/etc) which could be missing at boot |
| 277 | * should be handled in hdmi_init() so that failure happens from | 277 | * should be handled in msm_hdmi_init() so that failure happens from |
| 278 | * hdmi sub-device's probe. | 278 | * hdmi sub-device's probe. |
| 279 | */ | 279 | */ |
| 280 | int hdmi_modeset_init(struct hdmi *hdmi, | 280 | int msm_hdmi_modeset_init(struct hdmi *hdmi, |
| 281 | struct drm_device *dev, struct drm_encoder *encoder) | 281 | struct drm_device *dev, struct drm_encoder *encoder) |
| 282 | { | 282 | { |
| 283 | struct msm_drm_private *priv = dev->dev_private; | 283 | struct msm_drm_private *priv = dev->dev_private; |
| @@ -289,7 +289,7 @@ int hdmi_modeset_init(struct hdmi *hdmi, · 5 unmodified lines | |||
| 289 | 289 | ||
| 290 | hdmi_audio_infoframe_init(&hdmi->audio.infoframe); | 290 | hdmi_audio_infoframe_init(&hdmi->audio.infoframe); |
| 291 | 291 | ||
| 292 | hdmi->bridge = hdmi_bridge_init(hdmi); | 292 | hdmi->bridge = msm_hdmi_bridge_init(hdmi); |
| 293 | if (IS_ERR(hdmi->bridge)) { | 293 | if (IS_ERR(hdmi->bridge)) { |
| 294 | ret = PTR_ERR(hdmi->bridge); | 294 | ret = PTR_ERR(hdmi->bridge); |
| 295 | dev_err(dev->dev, "failed to create HDMI bridge: %d\n", ret); | 295 | dev_err(dev->dev, "failed to create HDMI bridge: %d\n", ret); |
| @@ -297,7 +297,7 @@ int hdmi_modeset_init(struct hdmi *hdmi, · 1 unmodified line | |||
| 297 | goto fail; | 297 | goto fail; |
| 298 | } | 298 | } |
| 299 | 299 | ||
| 300 | hdmi->connector = hdmi_connector_init(hdmi); | 300 | hdmi->connector = msm_hdmi_connector_init(hdmi); |
| 301 | if (IS_ERR(hdmi->connector)) { | 301 | if (IS_ERR(hdmi->connector)) { |
| 302 | ret = PTR_ERR(hdmi->connector); | 302 | ret = PTR_ERR(hdmi->connector); |
| 303 | dev_err(dev->dev, "failed to create HDMI connector: %d\n", ret); | 303 | dev_err(dev->dev, "failed to create HDMI connector: %d\n", ret); |
| @@ -313,7 +313,7 @@ int hdmi_modeset_init(struct hdmi *hdmi, · 9 unmodified lines | |||
| 313 | } | 313 | } |
| 314 | 314 | ||
| 315 | ret = devm_request_irq(&pdev->dev, hdmi->irq, | 315 | ret = devm_request_irq(&pdev->dev, hdmi->irq, |
| 316 | hdmi_irq, IRQF_TRIGGER_HIGH | IRQF_ONESHOT, | 316 | msm_hdmi_irq, IRQF_TRIGGER_HIGH | IRQF_ONESHOT, |
| 317 | "hdmi_isr", hdmi); | 317 | "hdmi_isr", hdmi); |
| 318 | if (ret < 0) { | 318 | if (ret < 0) { |
| 319 | dev_err(dev->dev, "failed to request IRQ%u: %d\n", | 319 | dev_err(dev->dev, "failed to request IRQ%u: %d\n", |
| @@ -333,7 +333,7 @@ int hdmi_modeset_init(struct hdmi *hdmi, · 13 unmodified lines | |||
| 333 | fail: | 333 | fail: |
| 334 | /* bridge is normally destroyed by drm: */ | 334 | /* bridge is normally destroyed by drm: */ |
| 335 | if (hdmi->bridge) { | 335 | if (hdmi->bridge) { |
| 336 | hdmi_bridge_destroy(hdmi->bridge); | 336 | msm_hdmi_bridge_destroy(hdmi->bridge); |
| 337 | hdmi->bridge = NULL; | 337 | hdmi->bridge = NULL; |
| 338 | } | 338 | } |
| 339 | if (hdmi->connector) { | 339 | if (hdmi->connector) { |
| @@ -410,7 +410,7 @@ static const struct { · 70 unmodified lines | |||
| 410 | const bool output; | 410 | const bool output; |
| 411 | const int value; | 411 | const int value; |
| 412 | const char *label; | 412 | const char *label; |
| 413 | } hdmi_gpio_pdata[] = { | 413 | } msm_hdmi_gpio_pdata[] = { |
| 414 | { "qcom,hdmi-tx-ddc-clk", true, 1, "HDMI_DDC_CLK" }, | 414 | { "qcom,hdmi-tx-ddc-clk", true, 1, "HDMI_DDC_CLK" }, |
| 415 | { "qcom,hdmi-tx-ddc-data", true, 1, "HDMI_DDC_DATA" }, | 415 | { "qcom,hdmi-tx-ddc-data", true, 1, "HDMI_DDC_DATA" }, |
| 416 | { "qcom,hdmi-tx-hpd", false, 1, "HDMI_HPD" }, | 416 | { "qcom,hdmi-tx-hpd", false, 1, "HDMI_HPD" }, |
| @@ -419,7 +419,7 @@ static const struct { · 2 unmodified lines | |||
| 419 | { "qcom,hdmi-tx-mux-lpm", true, 1, "HDMI_MUX_LPM" }, | 419 | { "qcom,hdmi-tx-mux-lpm", true, 1, "HDMI_MUX_LPM" }, |
| 420 | }; | 420 | }; |
| 421 | 421 | ||
| 422 | static int get_gpio(struct device_node *of_node, const char *name) | 422 | static int msm_hdmi_get_gpio(struct device_node *of_node, const char *name) |
| 423 | { | 423 | { |
| 424 | int gpio = of_get_named_gpio(of_node, name, 0); | 424 | int gpio = of_get_named_gpio(of_node, name, 0); |
| 425 | if (gpio < 0) { | 425 | if (gpio < 0) { |
| @@ -434,7 +434,7 @@ static int get_gpio(struct device_node *of_node, const char *name) · 8 unmodified lines | |||
| 434 | return gpio; | 434 | return gpio; |
| 435 | } | 435 | } |
| 436 | 436 | ||
| 437 | static int hdmi_bind(struct device *dev, struct device *master, void *data) | 437 | static int msm_hdmi_bind(struct device *dev, struct device *master, void *data) |
| 438 | { | 438 | { |
| 439 | struct drm_device *drm = dev_get_drvdata(master); | 439 | struct drm_device *drm = dev_get_drvdata(master); |
| 440 | struct msm_drm_private *priv = drm->dev_private; | 440 | struct msm_drm_private *priv = drm->dev_private; |
| @@ -454,16 +454,16 @@ static int hdmi_bind(struct device *dev, struct device *master, void *data) · 13 unmodified lines | |||
| 454 | hdmi_cfg->qfprom_mmio_name = "qfprom_physical"; | 454 | hdmi_cfg->qfprom_mmio_name = "qfprom_physical"; |
| 455 | 455 | ||
| 456 | for (i = 0; i < HDMI_MAX_NUM_GPIO; i++) { | 456 | for (i = 0; i < HDMI_MAX_NUM_GPIO; i++) { |
| 457 | hdmi_cfg->gpios[i].num = get_gpio(of_node, | 457 | hdmi_cfg->gpios[i].num = msm_hdmi_get_gpio(of_node, |
| 458 | hdmi_gpio_pdata[i].name); | 458 | msm_hdmi_gpio_pdata[i].name); |
| 459 | hdmi_cfg->gpios[i].output = hdmi_gpio_pdata[i].output; | 459 | hdmi_cfg->gpios[i].output = msm_hdmi_gpio_pdata[i].output; |
| 460 | hdmi_cfg->gpios[i].value = hdmi_gpio_pdata[i].value; | 460 | hdmi_cfg->gpios[i].value = msm_hdmi_gpio_pdata[i].value; |
| 461 | hdmi_cfg->gpios[i].label = hdmi_gpio_pdata[i].label; | 461 | hdmi_cfg->gpios[i].label = msm_hdmi_gpio_pdata[i].label; |
| 462 | } | 462 | } |
| 463 | 463 | ||
| 464 | dev->platform_data = hdmi_cfg; | 464 | dev->platform_data = hdmi_cfg; |
| 465 | 465 | ||
| 466 | hdmi = hdmi_init(to_platform_device(dev)); | 466 | hdmi = msm_hdmi_init(to_platform_device(dev)); |
| 467 | if (IS_ERR(hdmi)) | 467 | if (IS_ERR(hdmi)) |
| 468 | return PTR_ERR(hdmi); | 468 | return PTR_ERR(hdmi); |
| 469 | priv->hdmi = hdmi; | 469 | priv->hdmi = hdmi; |
| @@ -471,34 +471,34 @@ static int hdmi_bind(struct device *dev, struct device *master, void *data) · 1 unmodified line | |||
| 471 | return 0; | 471 | return 0; |
| 472 | } | 472 | } |
| 473 | 473 | ||
| 474 | static void hdmi_unbind(struct device *dev, struct device *master, | 474 | static void msm_hdmi_unbind(struct device *dev, struct device *master, |
| 475 | void *data) | 475 | void *data) |
| 476 | { | 476 | { |
| 477 | struct drm_device *drm = dev_get_drvdata(master); | 477 | struct drm_device *drm = dev_get_drvdata(master); |
| 478 | struct msm_drm_private *priv = drm->dev_private; | 478 | struct msm_drm_private *priv = drm->dev_private; |
| 479 | if (priv->hdmi) { | 479 | if (priv->hdmi) { |
| 480 | hdmi_destroy(priv->hdmi); | 480 | msm_hdmi_destroy(priv->hdmi); |
| 481 | priv->hdmi = NULL; | 481 | priv->hdmi = NULL; |
| 482 | } | 482 | } |
| 483 | } | 483 | } |
| 484 | 484 | ||
| 485 | static const struct component_ops hdmi_ops = { | 485 | static const struct component_ops msm_hdmi_ops = { |
| 486 | .bind = hdmi_bind, | 486 | .bind = msm_hdmi_bind, |
| 487 | .unbind = hdmi_unbind, | 487 | .unbind = msm_hdmi_unbind, |
| 488 | }; | 488 | }; |
| 489 | 489 | ||
| 490 | static int hdmi_dev_probe(struct platform_device *pdev) | 490 | static int msm_hdmi_dev_probe(struct platform_device *pdev) |
| 491 | { | 491 | { |
| 492 | return component_add(&pdev->dev, &hdmi_ops); | 492 | return component_add(&pdev->dev, &msm_hdmi_ops); |
| 493 | } | 493 | } |
| 494 | 494 | ||
| 495 | static int hdmi_dev_remove(struct platform_device *pdev) | 495 | static int msm_hdmi_dev_remove(struct platform_device *pdev) |
| 496 | { | 496 | { |
| 497 | component_del(&pdev->dev, &hdmi_ops); | 497 | component_del(&pdev->dev, &msm_hdmi_ops); |
| 498 | return 0; | 498 | return 0; |
| 499 | } | 499 | } |
| 500 | 500 | ||
| 501 | static const struct of_device_id dt_match[] = { | 501 | static const struct of_device_id msm_hdmi_dt_match[] = { |
| 502 | { .compatible = "qcom,hdmi-tx-8996", .data = &hdmi_tx_8996_config }, | 502 | { .compatible = "qcom,hdmi-tx-8996", .data = &hdmi_tx_8996_config }, |
| 503 | { .compatible = "qcom,hdmi-tx-8994", .data = &hdmi_tx_8994_config }, | 503 | { .compatible = "qcom,hdmi-tx-8994", .data = &hdmi_tx_8994_config }, |
| 504 | { .compatible = "qcom,hdmi-tx-8084", .data = &hdmi_tx_8084_config }, | 504 | { .compatible = "qcom,hdmi-tx-8084", .data = &hdmi_tx_8084_config }, |
| @@ -508,23 +508,23 @@ static const struct of_device_id dt_match[] = { · 3 unmodified lines | |||
| 508 | {} | 508 | {} |
| 509 | }; | 509 | }; |
| 510 | 510 | ||
| 511 | static struct platform_driver hdmi_driver = { | 511 | static struct platform_driver msm_hdmi_driver = { |
| 512 | .probe = hdmi_dev_probe, | 512 | .probe = msm_hdmi_dev_probe, |
| 513 | .remove = hdmi_dev_remove, | 513 | .remove = msm_hdmi_dev_remove, |
| 514 | .driver = { | 514 | .driver = { |
| 515 | .name = "hdmi_msm", | 515 | .name = "hdmi_msm", |
| 516 | .of_match_table = dt_match, | 516 | .of_match_table = msm_hdmi_dt_match, |
| 517 | }, | 517 | }, |
| 518 | }; | 518 | }; |
| 519 | 519 | ||
| 520 | void __init hdmi_register(void) | 520 | void __init msm_hdmi_register(void) |
| 521 | { | 521 | { |
| 522 | hdmi_phy_driver_register(); | 522 | msm_hdmi_phy_driver_register(); |
| 523 | platform_driver_register(&hdmi_driver); | 523 | platform_driver_register(&msm_hdmi_driver); |
| 524 | } | 524 | } |
| 525 | 525 | ||
| 526 | void __exit hdmi_unregister(void) | 526 | void __exit msm_hdmi_unregister(void) |
| 527 | { | 527 | { |
| 528 | platform_driver_unregister(&hdmi_driver); | 528 | platform_driver_unregister(&msm_hdmi_driver); |
| 529 | hdmi_phy_driver_unregister(); | 529 | msm_hdmi_phy_driver_unregister(); |
| 530 | } | 530 | } |
| @@ -122,7 +122,7 @@ struct hdmi_platform_config { · 121 unmodified lines | |||
| 122 | struct hdmi_gpio_data gpios[HDMI_MAX_NUM_GPIO]; | 122 | struct hdmi_gpio_data gpios[HDMI_MAX_NUM_GPIO]; |
| 123 | }; | 123 | }; |
| 124 | 124 | ||
| 125 | void hdmi_set_mode(struct hdmi *hdmi, bool power_on); | 125 | void msm_hdmi_set_mode(struct hdmi *hdmi, bool power_on); |
| 126 | 126 | ||
| 127 | static inline void hdmi_write(struct hdmi *hdmi, u32 reg, u32 data) | 127 | static inline void hdmi_write(struct hdmi *hdmi, u32 reg, u32 data) |
| 128 | { | 128 | { |
| @@ -161,10 +161,10 @@ struct hdmi_phy_cfg { · 32 unmodified lines | |||
| 161 | int num_clks; | 161 | int num_clks; |
| 162 | }; | 162 | }; |
| 163 | 163 | ||
| 164 | extern const struct hdmi_phy_cfg hdmi_phy_8x60_cfg; | 164 | extern const struct hdmi_phy_cfg msm_hdmi_phy_8x60_cfg; |
| 165 | extern const struct hdmi_phy_cfg hdmi_phy_8960_cfg; | 165 | extern const struct hdmi_phy_cfg msm_hdmi_phy_8960_cfg; |
| 166 | extern const struct hdmi_phy_cfg hdmi_phy_8x74_cfg; | 166 | extern const struct hdmi_phy_cfg msm_hdmi_phy_8x74_cfg; |
| 167 | extern const struct hdmi_phy_cfg hdmi_phy_8996_cfg; | 167 | extern const struct hdmi_phy_cfg msm_hdmi_phy_8996_cfg; |
| 168 | 168 | ||
| 169 | struct hdmi_phy { | 169 | struct hdmi_phy { |
| 170 | struct platform_device *pdev; | 170 | struct platform_device *pdev; |
| @@ -185,23 +185,23 @@ static inline u32 hdmi_phy_read(struct hdmi_phy *phy, u32 reg) · 14 unmodified lines | |||
| 185 | return msm_readl(phy->mmio + reg); | 185 | return msm_readl(phy->mmio + reg); |
| 186 | } | 186 | } |
| 187 | 187 | ||
| 188 | int hdmi_phy_resource_enable(struct hdmi_phy *phy); | 188 | int msm_hdmi_phy_resource_enable(struct hdmi_phy *phy); |
| 189 | void hdmi_phy_resource_disable(struct hdmi_phy *phy); | 189 | void msm_hdmi_phy_resource_disable(struct hdmi_phy *phy); |
| 190 | void hdmi_phy_powerup(struct hdmi_phy *phy, unsigned long int pixclock); | 190 | void msm_hdmi_phy_powerup(struct hdmi_phy *phy, unsigned long int pixclock); |
| 191 | void hdmi_phy_powerdown(struct hdmi_phy *phy); | 191 | void msm_hdmi_phy_powerdown(struct hdmi_phy *phy); |
| 192 | void __init hdmi_phy_driver_register(void); | 192 | void __init msm_hdmi_phy_driver_register(void); |
| 193 | void __exit hdmi_phy_driver_unregister(void); | 193 | void __exit msm_hdmi_phy_driver_unregister(void); |
| 194 | 194 | ||
| 195 | #ifdef CONFIG_COMMON_CLK | 195 | #ifdef CONFIG_COMMON_CLK |
| 196 | int hdmi_pll_8960_init(struct platform_device *pdev); | 196 | int msm_hdmi_pll_8960_init(struct platform_device *pdev); |
| 197 | int hdmi_pll_8996_init(struct platform_device *pdev); | 197 | int msm_hdmi_pll_8996_init(struct platform_device *pdev); |
| 198 | #else | 198 | #else |
| 199 | int hdmi_pll_8960_init(struct platform_device *pdev); | 199 | static inline int msm_hdmi_pll_8960_init(struct platform_device *pdev); |
| 200 | { | 200 | { |
| 201 | return -ENODEV; | 201 | return -ENODEV; |
| 202 | } | 202 | } |
| 203 | 203 | ||
| 204 | int hdmi_pll_8996_init(struct platform_device *pdev) | 204 | static inline int msm_hdmi_pll_8996_init(struct platform_device *pdev) |
| 205 | { | 205 | { |
| 206 | return -ENODEV; | 206 | return -ENODEV; |
| 207 | } | 207 | } |
| @@ -211,42 +211,42 @@ int hdmi_pll_8996_init(struct platform_device *pdev) · 3 unmodified lines | |||
| 211 | * audio: | 211 | * audio: |
| 212 | */ | 212 | */ |
| 213 | 213 | ||
| 214 | int hdmi_audio_update(struct hdmi *hdmi); | 214 | int msm_hdmi_audio_update(struct hdmi *hdmi); |
| 215 | int hdmi_audio_info_setup(struct hdmi *hdmi, bool enabled, | 215 | int msm_hdmi_audio_info_setup(struct hdmi *hdmi, bool enabled, |
| 216 | uint32_t num_of_channels, uint32_t channel_allocation, | 216 | uint32_t num_of_channels, uint32_t channel_allocation, |
| 217 | uint32_t level_shift, bool down_mix); | 217 | uint32_t level_shift, bool down_mix); |
| 218 | void hdmi_audio_set_sample_rate(struct hdmi *hdmi, int rate); | 218 | void msm_hdmi_audio_set_sample_rate(struct hdmi *hdmi, int rate); |
| 219 | 219 | ||
| 220 | 220 | ||
| 221 | /* | 221 | /* |
| 222 | * hdmi bridge: | 222 | * hdmi bridge: |
| 223 | */ | 223 | */ |
| 224 | 224 | ||
| 225 | struct drm_bridge *hdmi_bridge_init(struct hdmi *hdmi); | 225 | struct drm_bridge *msm_hdmi_bridge_init(struct hdmi *hdmi); |
| 226 | void hdmi_bridge_destroy(struct drm_bridge *bridge); | 226 | void msm_hdmi_bridge_destroy(struct drm_bridge *bridge); |
| 227 | 227 | ||
| 228 | /* | 228 | /* |
| 229 | * hdmi connector: | 229 | * hdmi connector: |
| 230 | */ | 230 | */ |
| 231 | 231 | ||
| 232 | void hdmi_connector_irq(struct drm_connector *connector); | 232 | void msm_hdmi_connector_irq(struct drm_connector *connector); |
| 233 | struct drm_connector *hdmi_connector_init(struct hdmi *hdmi); | 233 | struct drm_connector *msm_hdmi_connector_init(struct hdmi *hdmi); |
| 234 | 234 | ||
| 235 | /* | 235 | /* |
| 236 | * i2c adapter for ddc: | 236 | * i2c adapter for ddc: |
| 237 | */ | 237 | */ |
| 238 | 238 | ||
| 239 | void hdmi_i2c_irq(struct i2c_adapter *i2c); | 239 | void msm_hdmi_i2c_irq(struct i2c_adapter *i2c); |
| 240 | void hdmi_i2c_destroy(struct i2c_adapter *i2c); | 240 | void msm_hdmi_i2c_destroy(struct i2c_adapter *i2c); |
| 241 | struct i2c_adapter *hdmi_i2c_init(struct hdmi *hdmi); | 241 | struct i2c_adapter *msm_hdmi_i2c_init(struct hdmi *hdmi); |
| 242 | 242 | ||
| 243 | /* | 243 | /* |
| 244 | * hdcp | 244 | * hdcp |
| 245 | */ | 245 | */ |
| 246 | struct hdmi_hdcp_ctrl *hdmi_hdcp_init(struct hdmi *hdmi); | 246 | struct hdmi_hdcp_ctrl *msm_hdmi_hdcp_init(struct hdmi *hdmi); |
| 247 | void hdmi_hdcp_destroy(struct hdmi *hdmi); | 247 | void msm_hdmi_hdcp_destroy(struct hdmi *hdmi); |
| 248 | void hdmi_hdcp_on(struct hdmi_hdcp_ctrl *hdcp_ctrl); | 248 | void msm_hdmi_hdcp_on(struct hdmi_hdcp_ctrl *hdcp_ctrl); |
| 249 | void hdmi_hdcp_off(struct hdmi_hdcp_ctrl *hdcp_ctrl); | 249 | void msm_hdmi_hdcp_off(struct hdmi_hdcp_ctrl *hdcp_ctrl); |
| 250 | void hdmi_hdcp_irq(struct hdmi_hdcp_ctrl *hdcp_ctrl); | 250 | void msm_hdmi_hdcp_irq(struct hdmi_hdcp_ctrl *hdcp_ctrl); |
| 251 | 251 | ||
| 252 | #endif /* __HDMI_CONNECTOR_H__ */ | 252 | #endif /* __HDMI_CONNECTOR_H__ */ |
| @@ -89,7 +89,7 @@ static const struct hdmi_msm_audio_arcs *get_arcs(unsigned long int pixclock) · 88 unmodified lines | |||
| 89 | return NULL; | 89 | return NULL; |
| 90 | } | 90 | } |
| 91 | 91 | ||
| 92 | int hdmi_audio_update(struct hdmi *hdmi) | 92 | int msm_hdmi_audio_update(struct hdmi *hdmi) |
| 93 | { | 93 | { |
| 94 | struct hdmi_audio *audio = &hdmi->audio; | 94 | struct hdmi_audio *audio = &hdmi->audio; |
| 95 | struct hdmi_audio_infoframe *info = &audio->infoframe; | 95 | struct hdmi_audio_infoframe *info = &audio->infoframe; |
| @@ -232,7 +232,7 @@ int hdmi_audio_update(struct hdmi *hdmi) · 136 unmodified lines | |||
| 232 | return 0; | 232 | return 0; |
| 233 | } | 233 | } |
| 234 | 234 | ||
| 235 | int hdmi_audio_info_setup(struct hdmi *hdmi, bool enabled, | 235 | int msm_hdmi_audio_info_setup(struct hdmi *hdmi, bool enabled, |
| 236 | uint32_t num_of_channels, uint32_t channel_allocation, | 236 | uint32_t num_of_channels, uint32_t channel_allocation, |
| 237 | uint32_t level_shift, bool down_mix) | 237 | uint32_t level_shift, bool down_mix) |
| 238 | { | 238 | { |
| @@ -252,10 +252,10 @@ int hdmi_audio_info_setup(struct hdmi *hdmi, bool enabled, · 13 unmodified lines | |||
| 252 | audio->infoframe.level_shift_value = level_shift; | 252 | audio->infoframe.level_shift_value = level_shift; |
| 253 | audio->infoframe.downmix_inhibit = down_mix; | 253 | audio->infoframe.downmix_inhibit = down_mix; |
| 254 | 254 | ||
| 255 | return hdmi_audio_update(hdmi); | 255 | return msm_hdmi_audio_update(hdmi); |
| 256 | } | 256 | } |
| 257 | 257 | ||
| 258 | void hdmi_audio_set_sample_rate(struct hdmi *hdmi, int rate) | 258 | void msm_hdmi_audio_set_sample_rate(struct hdmi *hdmi, int rate) |
| 259 | { | 259 | { |
| 260 | struct hdmi_audio *audio; | 260 | struct hdmi_audio *audio; |
| 261 | 261 | ||
| @@ -268,5 +268,5 @@ void hdmi_audio_set_sample_rate(struct hdmi *hdmi, int rate) · 6 unmodified lines | |||
| 268 | return; | 268 | return; |
| 269 | 269 | ||
| 270 | audio->rate = rate; | 270 | audio->rate = rate; |
| 271 | hdmi_audio_update(hdmi); | 271 | msm_hdmi_audio_update(hdmi); |
| 272 | } | 272 | } |
| @@ -23,11 +23,11 @@ struct hdmi_bridge { · 22 unmodified lines | |||
| 23 | }; | 23 | }; |
| 24 | #define to_hdmi_bridge(x) container_of(x, struct hdmi_bridge, base) | 24 | #define to_hdmi_bridge(x) container_of(x, struct hdmi_bridge, base) |
| 25 | 25 | ||
| 26 | void hdmi_bridge_destroy(struct drm_bridge *bridge) | 26 | void msm_hdmi_bridge_destroy(struct drm_bridge *bridge) |
| 27 | { | 27 | { |
| 28 | } | 28 | } |
| 29 | 29 | ||
| 30 | static void power_on(struct drm_bridge *bridge) | 30 | static void msm_hdmi_power_on(struct drm_bridge *bridge) |
| 31 | { | 31 | { |
| 32 | struct drm_device *dev = bridge->dev; | 32 | struct drm_device *dev = bridge->dev; |
| 33 | struct hdmi_bridge *hdmi_bridge = to_hdmi_bridge(bridge); | 33 | struct hdmi_bridge *hdmi_bridge = to_hdmi_bridge(bridge); |
| @@ -86,7 +86,7 @@ static void power_off(struct drm_bridge *bridge) · 52 unmodified lines | |||
| 86 | } | 86 | } |
| 87 | } | 87 | } |
| 88 | 88 | ||
| 89 | static void hdmi_bridge_pre_enable(struct drm_bridge *bridge) | 89 | static void msm_hdmi_bridge_pre_enable(struct drm_bridge *bridge) |
| 90 | { | 90 | { |
| 91 | struct hdmi_bridge *hdmi_bridge = to_hdmi_bridge(bridge); | 91 | struct hdmi_bridge *hdmi_bridge = to_hdmi_bridge(bridge); |
| 92 | struct hdmi *hdmi = hdmi_bridge->hdmi; | 92 | struct hdmi *hdmi = hdmi_bridge->hdmi; |
| @@ -95,51 +95,51 @@ static void hdmi_bridge_pre_enable(struct drm_bridge *bridge) · 2 unmodified lines | |||
| 95 | DBG("power up"); | 95 | DBG("power up"); |
| 96 | 96 | ||
| 97 | if (!hdmi->power_on) { | 97 | if (!hdmi->power_on) { |
| 98 | hdmi_phy_resource_enable(phy); | 98 | msm_hdmi_phy_resource_enable(phy); |
| 99 | power_on(bridge); | 99 | msm_hdmi_power_on(bridge); |
| 100 | hdmi->power_on = true; | 100 | hdmi->power_on = true; |
| 101 | hdmi_audio_update(hdmi); | 101 | msm_hdmi_audio_update(hdmi); |
| 102 | } | 102 | } |
| 103 | 103 | ||
| 104 | hdmi_phy_powerup(phy, hdmi->pixclock); | 104 | msm_hdmi_phy_powerup(phy, hdmi->pixclock); |
| 105 | 105 | ||
| 106 | hdmi_set_mode(hdmi, true); | 106 | msm_hdmi_set_mode(hdmi, true); |
| 107 | 107 | ||
| 108 | if (hdmi->hdcp_ctrl) | 108 | if (hdmi->hdcp_ctrl) |
| 109 | hdmi_hdcp_on(hdmi->hdcp_ctrl); | 109 | msm_hdmi_hdcp_on(hdmi->hdcp_ctrl); |
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | static void hdmi_bridge_enable(struct drm_bridge *bridge) | 112 | static void msm_hdmi_bridge_enable(struct drm_bridge *bridge) |
| 113 | { | 113 | { |
| 114 | } | 114 | } |
| 115 | 115 | ||
| 116 | static void hdmi_bridge_disable(struct drm_bridge *bridge) | 116 | static void msm_hdmi_bridge_disable(struct drm_bridge *bridge) |
| 117 | { | 117 | { |
| 118 | } | 118 | } |
| 119 | 119 | ||
| 120 | static void hdmi_bridge_post_disable(struct drm_bridge *bridge) | 120 | static void msm_hdmi_bridge_post_disable(struct drm_bridge *bridge) |
| 121 | { | 121 | { |
| 122 | struct hdmi_bridge *hdmi_bridge = to_hdmi_bridge(bridge); | 122 | struct hdmi_bridge *hdmi_bridge = to_hdmi_bridge(bridge); |
| 123 | struct hdmi *hdmi = hdmi_bridge->hdmi; | 123 | struct hdmi *hdmi = hdmi_bridge->hdmi; |
| 124 | struct hdmi_phy *phy = hdmi->phy; | 124 | struct hdmi_phy *phy = hdmi->phy; |
| 125 | 125 | ||
| 126 | if (hdmi->hdcp_ctrl) | 126 | if (hdmi->hdcp_ctrl) |
| 127 | hdmi_hdcp_off(hdmi->hdcp_ctrl); | 127 | msm_hdmi_hdcp_off(hdmi->hdcp_ctrl); |
| 128 | 128 | ||
| 129 | DBG("power down"); | 129 | DBG("power down"); |
| 130 | hdmi_set_mode(hdmi, false); | 130 | msm_hdmi_set_mode(hdmi, false); |
| 131 | 131 | ||
| 132 | hdmi_phy_powerdown(phy); | 132 | msm_hdmi_phy_powerdown(phy); |
| 133 | 133 | ||
| 134 | if (hdmi->power_on) { | 134 | if (hdmi->power_on) { |
| 135 | power_off(bridge); | 135 | power_off(bridge); |
| 136 | hdmi->power_on = false; | 136 | hdmi->power_on = false; |
| 137 | hdmi_audio_update(hdmi); | 137 | msm_hdmi_audio_update(hdmi); |
| 138 | hdmi_phy_resource_disable(phy); | 138 | msm_hdmi_phy_resource_disable(phy); |
| 139 | } | 139 | } |
| 140 | } | 140 | } |
| 141 | 141 | ||
| 142 | static void hdmi_bridge_mode_set(struct drm_bridge *bridge, | 142 | static void msm_hdmi_bridge_mode_set(struct drm_bridge *bridge, |
| 143 | struct drm_display_mode *mode, | 143 | struct drm_display_mode *mode, |
| 144 | struct drm_display_mode *adjusted_mode) | 144 | struct drm_display_mode *adjusted_mode) |
| 145 | { | 145 | { |
| @@ -196,20 +196,20 @@ static void hdmi_bridge_mode_set(struct drm_bridge *bridge, · 50 unmodified lines | |||
| 196 | DBG("frame_ctrl=%08x", frame_ctrl); | 196 | DBG("frame_ctrl=%08x", frame_ctrl); |
| 197 | hdmi_write(hdmi, REG_HDMI_FRAME_CTRL, frame_ctrl); | 197 | hdmi_write(hdmi, REG_HDMI_FRAME_CTRL, frame_ctrl); |
| 198 | 198 | ||
| 199 | hdmi_audio_update(hdmi); | 199 | msm_hdmi_audio_update(hdmi); |
| 200 | } | 200 | } |
| 201 | 201 | ||
| 202 | static const struct drm_bridge_funcs hdmi_bridge_funcs = { | 202 | static const struct drm_bridge_funcs msm_hdmi_bridge_funcs = { |
| 203 | .pre_enable = hdmi_bridge_pre_enable, | 203 | .pre_enable = msm_hdmi_bridge_pre_enable, |
| 204 | .enable = hdmi_bridge_enable, | 204 | .enable = msm_hdmi_bridge_enable, |
| 205 | .disable = hdmi_bridge_disable, | 205 | .disable = msm_hdmi_bridge_disable, |
| 206 | .post_disable = hdmi_bridge_post_disable, | 206 | .post_disable = msm_hdmi_bridge_post_disable, |
| 207 | .mode_set = hdmi_bridge_mode_set, | 207 | .mode_set = msm_hdmi_bridge_mode_set, |
| 208 | }; | 208 | }; |
| 209 | 209 | ||
| 210 | 210 | ||
| 211 | /* initialize bridge */ | 211 | /* initialize bridge */ |
| 212 | struct drm_bridge *hdmi_bridge_init(struct hdmi *hdmi) | 212 | struct drm_bridge *msm_hdmi_bridge_init(struct hdmi *hdmi) |
| 213 | { | 213 | { |
| 214 | struct drm_bridge *bridge = NULL; | 214 | struct drm_bridge *bridge = NULL; |
| 215 | struct hdmi_bridge *hdmi_bridge; | 215 | struct hdmi_bridge *hdmi_bridge; |
| @@ -225,7 +225,7 @@ struct drm_bridge *hdmi_bridge_init(struct hdmi *hdmi) · 9 unmodified lines | |||
| 225 | hdmi_bridge->hdmi = hdmi; | 225 | hdmi_bridge->hdmi = hdmi; |
| 226 | 226 | ||
| 227 | bridge = &hdmi_bridge->base; | 227 | bridge = &hdmi_bridge->base; |
| 228 | bridge->funcs = &hdmi_bridge_funcs; | 228 | bridge->funcs = &msm_hdmi_bridge_funcs; |
| 229 | 229 | ||
| 230 | ret = drm_bridge_attach(hdmi->dev, bridge); | 230 | ret = drm_bridge_attach(hdmi->dev, bridge); |
| 231 | if (ret) | 231 | if (ret) |
| @@ -235,7 +235,7 @@ struct drm_bridge *hdmi_bridge_init(struct hdmi *hdmi) · 3 unmodified lines | |||
| 235 | 235 | ||
| 236 | fail: | 236 | fail: |
| 237 | if (bridge) | 237 | if (bridge) |
| 238 | hdmi_bridge_destroy(bridge); | 238 | msm_hdmi_bridge_destroy(bridge); |
| 239 | 239 | ||
| 240 | return ERR_PTR(ret); | 240 | return ERR_PTR(ret); |
| 241 | } | 241 | } |
| @@ -28,7 +28,7 @@ struct hdmi_connector { · 27 unmodified lines | |||
| 28 | }; | 28 | }; |
| 29 | #define to_hdmi_connector(x) container_of(x, struct hdmi_connector, base) | 29 | #define to_hdmi_connector(x) container_of(x, struct hdmi_connector, base) |
| 30 | 30 | ||
| 31 | static void hdmi_phy_reset(struct hdmi *hdmi) | 31 | static void msm_hdmi_phy_reset(struct hdmi *hdmi) |
| 32 | { | 32 | { |
| 33 | unsigned int val; | 33 | unsigned int val; |
| 34 | 34 | ||
| @@ -179,9 +179,9 @@ static int hpd_enable(struct hdmi_connector *hdmi_connector) · 144 unmodified lines | |||
| 179 | } | 179 | } |
| 180 | } | 180 | } |
| 181 | 181 | ||
| 182 | hdmi_set_mode(hdmi, false); | 182 | msm_hdmi_set_mode(hdmi, false); |
| 183 | hdmi_phy_reset(hdmi); | 183 | msm_hdmi_phy_reset(hdmi); |
| 184 | hdmi_set_mode(hdmi, true); | 184 | msm_hdmi_set_mode(hdmi, true); |
| 185 | 185 | ||
| 186 | hdmi_write(hdmi, REG_HDMI_USEC_REFTIMER, 0x0001001b); | 186 | hdmi_write(hdmi, REG_HDMI_USEC_REFTIMER, 0x0001001b); |
| 187 | 187 | ||
| @@ -218,7 +218,7 @@ static void hdp_disable(struct hdmi_connector *hdmi_connector) · 30 unmodified lines | |||
| 218 | /* Disable HPD interrupt */ | 218 | /* Disable HPD interrupt */ |
| 219 | hdmi_write(hdmi, REG_HDMI_HPD_INT_CTRL, 0); | 219 | hdmi_write(hdmi, REG_HDMI_HPD_INT_CTRL, 0); |
| 220 | 220 | ||
| 221 | hdmi_set_mode(hdmi, false); | 221 | msm_hdmi_set_mode(hdmi, false); |
| 222 | 222 | ||
| 223 | for (i = 0; i < config->hpd_clk_cnt; i++) | 223 | for (i = 0; i < config->hpd_clk_cnt; i++) |
| 224 | clk_disable_unprepare(hdmi->hpd_clks[i]); | 224 | clk_disable_unprepare(hdmi->hpd_clks[i]); |
| @@ -240,7 +240,7 @@ static void hdp_disable(struct hdmi_connector *hdmi_connector) · 15 unmodified lines | |||
| 240 | } | 240 | } |
| 241 | 241 | ||
| 242 | static void | 242 | static void |
| 243 | hotplug_work(struct work_struct *work) | 243 | msm_hdmi_hotplug_work(struct work_struct *work) |
| 244 | { | 244 | { |
| 245 | struct hdmi_connector *hdmi_connector = | 245 | struct hdmi_connector *hdmi_connector = |
| 246 | container_of(work, struct hdmi_connector, hpd_work); | 246 | container_of(work, struct hdmi_connector, hpd_work); |
| @@ -248,7 +248,7 @@ hotplug_work(struct work_struct *work) · 1 unmodified line | |||
| 248 | drm_helper_hpd_irq_event(connector->dev); | 248 | drm_helper_hpd_irq_event(connector->dev); |
| 249 | } | 249 | } |
| 250 | 250 | ||
| 251 | void hdmi_connector_irq(struct drm_connector *connector) | 251 | void msm_hdmi_connector_irq(struct drm_connector *connector) |
| 252 | { | 252 | { |
| 253 | struct hdmi_connector *hdmi_connector = to_hdmi_connector(connector); | 253 | struct hdmi_connector *hdmi_connector = to_hdmi_connector(connector); |
| 254 | struct hdmi *hdmi = hdmi_connector->hdmi; | 254 | struct hdmi *hdmi = hdmi_connector->hdmi; |
| @@ -347,7 +347,7 @@ static void hdmi_connector_destroy(struct drm_connector *connector) · 92 unmodified lines | |||
| 347 | kfree(hdmi_connector); | 347 | kfree(hdmi_connector); |
| 348 | } | 348 | } |
| 349 | 349 | ||
| 350 | static int hdmi_connector_get_modes(struct drm_connector *connector) | 350 | static int msm_hdmi_connector_get_modes(struct drm_connector *connector) |
| 351 | { | 351 | { |
| 352 | struct hdmi_connector *hdmi_connector = to_hdmi_connector(connector); | 352 | struct hdmi_connector *hdmi_connector = to_hdmi_connector(connector); |
| 353 | struct hdmi *hdmi = hdmi_connector->hdmi; | 353 | struct hdmi *hdmi = hdmi_connector->hdmi; |
| @@ -373,7 +373,7 @@ static int hdmi_connector_get_modes(struct drm_connector *connector) · 19 unmodified lines | |||
| 373 | return ret; | 373 | return ret; |
| 374 | } | 374 | } |
| 375 | 375 | ||
| 376 | static int hdmi_connector_mode_valid(struct drm_connector *connector, | 376 | static int msm_hdmi_connector_mode_valid(struct drm_connector *connector, |
| 377 | struct drm_display_mode *mode) | 377 | struct drm_display_mode *mode) |
| 378 | { | 378 | { |
| 379 | struct hdmi_connector *hdmi_connector = to_hdmi_connector(connector); | 379 | struct hdmi_connector *hdmi_connector = to_hdmi_connector(connector); |
| @@ -403,7 +403,7 @@ static int hdmi_connector_mode_valid(struct drm_connector *connector, · 23 unmodified lines | |||
| 403 | } | 403 | } |
| 404 | 404 | ||
| 405 | static struct drm_encoder * | 405 | static struct drm_encoder * |
| 406 | hdmi_connector_best_encoder(struct drm_connector *connector) | 406 | msm_hdmi_connector_best_encoder(struct drm_connector *connector) |
| 407 | { | 407 | { |
| 408 | struct hdmi_connector *hdmi_connector = to_hdmi_connector(connector); | 408 | struct hdmi_connector *hdmi_connector = to_hdmi_connector(connector); |
| 409 | return hdmi_connector->hdmi->encoder; | 409 | return hdmi_connector->hdmi->encoder; |
| @@ -419,14 +419,14 @@ static const struct drm_connector_funcs hdmi_connector_funcs = { · 9 unmodified lines | |||
| 419 | .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, | 419 | .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, |
| 420 | }; | 420 | }; |
| 421 | 421 | ||
| 422 | static const struct drm_connector_helper_funcs hdmi_connector_helper_funcs = { | 422 | static const struct drm_connector_helper_funcs msm_hdmi_connector_helper_funcs = { |
| 423 | .get_modes = hdmi_connector_get_modes, | 423 | .get_modes = msm_hdmi_connector_get_modes, |
| 424 | .mode_valid = hdmi_connector_mode_valid, | 424 | .mode_valid = msm_hdmi_connector_mode_valid, |
| 425 | .best_encoder = hdmi_connector_best_encoder, | 425 | .best_encoder = msm_hdmi_connector_best_encoder, |
| 426 | }; | 426 | }; |
| 427 | 427 | ||
| 428 | /* initialize connector */ | 428 | /* initialize connector */ |
| 429 | struct drm_connector *hdmi_connector_init(struct hdmi *hdmi) | 429 | struct drm_connector *msm_hdmi_connector_init(struct hdmi *hdmi) |
| 430 | { | 430 | { |
| 431 | struct drm_connector *connector = NULL; | 431 | struct drm_connector *connector = NULL; |
| 432 | struct hdmi_connector *hdmi_connector; | 432 | struct hdmi_connector *hdmi_connector; |
| @@ -439,13 +439,13 @@ struct drm_connector *hdmi_connector_init(struct hdmi *hdmi) · 6 unmodified lines | |||
| 439 | } | 439 | } |
| 440 | 440 | ||
| 441 | hdmi_connector->hdmi = hdmi; | 441 | hdmi_connector->hdmi = hdmi; |
| 442 | INIT_WORK(&hdmi_connector->hpd_work, hotplug_work); | 442 | INIT_WORK(&hdmi_connector->hpd_work, msm_hdmi_hotplug_work); |
| 443 | 443 | ||
| 444 | connector = &hdmi_connector->base; | 444 | connector = &hdmi_connector->base; |
| 445 | 445 | ||
| 446 | drm_connector_init(hdmi->dev, connector, &hdmi_connector_funcs, | 446 | drm_connector_init(hdmi->dev, connector, &hdmi_connector_funcs, |
| 447 | DRM_MODE_CONNECTOR_HDMIA); | 447 | DRM_MODE_CONNECTOR_HDMIA); |
| 448 | drm_connector_helper_add(connector, &hdmi_connector_helper_funcs); | 448 | drm_connector_helper_add(connector, &msm_hdmi_connector_helper_funcs); |
| 449 | 449 | ||
| 450 | connector->polled = DRM_CONNECTOR_POLL_CONNECT | | 450 | connector->polled = DRM_CONNECTOR_POLL_CONNECT | |
| 451 | DRM_CONNECTOR_POLL_DISCONNECT; | 451 | DRM_CONNECTOR_POLL_DISCONNECT; |
| @@ -84,7 +84,7 @@ struct hdmi_hdcp_ctrl { · 83 unmodified lines | |||
| 84 | bool max_dev_exceeded; | 84 | bool max_dev_exceeded; |
| 85 | }; | 85 | }; |
| 86 | 86 | ||
| 87 | static int hdmi_ddc_read(struct hdmi *hdmi, u16 addr, u8 offset, | 87 | static int msm_hdmi_ddc_read(struct hdmi *hdmi, u16 addr, u8 offset, |
| 88 | u8 *data, u16 data_len) | 88 | u8 *data, u16 data_len) |
| 89 | { | 89 | { |
| 90 | int rc; | 90 | int rc; |
| @@ -122,7 +122,7 @@ retry: · 31 unmodified lines | |||
| 122 | 122 | ||
| 123 | #define HDCP_DDC_WRITE_MAX_BYTE_NUM 32 | 123 | #define HDCP_DDC_WRITE_MAX_BYTE_NUM 32 |
| 124 | 124 | ||
| 125 | static int hdmi_ddc_write(struct hdmi *hdmi, u16 addr, u8 offset, | 125 | static int msm_hdmi_ddc_write(struct hdmi *hdmi, u16 addr, u8 offset, |
| 126 | u8 *data, u16 data_len) | 126 | u8 *data, u16 data_len) |
| 127 | { | 127 | { |
| 128 | int rc; | 128 | int rc; |
| @@ -162,7 +162,7 @@ retry: · 33 unmodified lines | |||
| 162 | return rc; | 162 | return rc; |
| 163 | } | 163 | } |
| 164 | 164 | ||
| 165 | static int hdmi_hdcp_scm_wr(struct hdmi_hdcp_ctrl *hdcp_ctrl, u32 *preg, | 165 | static int msm_hdmi_hdcp_scm_wr(struct hdmi_hdcp_ctrl *hdcp_ctrl, u32 *preg, |
| 166 | u32 *pdata, u32 count) | 166 | u32 *pdata, u32 count) |
| 167 | { | 167 | { |
| 168 | struct hdmi *hdmi = hdcp_ctrl->hdmi; | 168 | struct hdmi *hdmi = hdcp_ctrl->hdmi; |
| @@ -202,7 +202,7 @@ static int hdmi_hdcp_scm_wr(struct hdmi_hdcp_ctrl *hdcp_ctrl, u32 *preg, · 33 unmodified lines | |||
| 202 | return ret; | 202 | return ret; |
| 203 | } | 203 | } |
| 204 | 204 | ||
| 205 | void hdmi_hdcp_irq(struct hdmi_hdcp_ctrl *hdcp_ctrl) | 205 | void msm_hdmi_hdcp_irq(struct hdmi_hdcp_ctrl *hdcp_ctrl) |
| 206 | { | 206 | { |
| 207 | struct hdmi *hdmi = hdcp_ctrl->hdmi; | 207 | struct hdmi *hdmi = hdcp_ctrl->hdmi; |
| 208 | u32 reg_val, hdcp_int_status; | 208 | u32 reg_val, hdcp_int_status; |
| @@ -247,7 +247,7 @@ void hdmi_hdcp_irq(struct hdmi_hdcp_ctrl *hdcp_ctrl) · 38 unmodified lines | |||
| 247 | } | 247 | } |
| 248 | } | 248 | } |
| 249 | 249 | ||
| 250 | static int hdmi_hdcp_msleep(struct hdmi_hdcp_ctrl *hdcp_ctrl, u32 ms, u32 ev) | 250 | static int msm_hdmi_hdcp_msleep(struct hdmi_hdcp_ctrl *hdcp_ctrl, u32 ms, u32 ev) |
| 251 | { | 251 | { |
| 252 | int rc; | 252 | int rc; |
| 253 | 253 | ||
| @@ -264,7 +264,7 @@ static int hdmi_hdcp_msleep(struct hdmi_hdcp_ctrl *hdcp_ctrl, u32 ms, u32 ev) · 10 unmodified lines | |||
| 264 | return 0; | 264 | return 0; |
| 265 | } | 265 | } |
| 266 | 266 | ||
| 267 | static int hdmi_hdcp_read_validate_aksv(struct hdmi_hdcp_ctrl *hdcp_ctrl) | 267 | static int msm_hdmi_hdcp_read_validate_aksv(struct hdmi_hdcp_ctrl *hdcp_ctrl) |
| 268 | { | 268 | { |
| 269 | struct hdmi *hdmi = hdcp_ctrl->hdmi; | 269 | struct hdmi *hdmi = hdcp_ctrl->hdmi; |
| 270 | 270 | ||
| @@ -287,7 +287,7 @@ static int hdmi_hdcp_read_validate_aksv(struct hdmi_hdcp_ctrl *hdcp_ctrl) · 16 unmodified lines | |||
| 287 | return 0; | 287 | return 0; |
| 288 | } | 288 | } |
| 289 | 289 | ||
| 290 | static int reset_hdcp_ddc_failures(struct hdmi_hdcp_ctrl *hdcp_ctrl) | 290 | static int msm_reset_hdcp_ddc_failures(struct hdmi_hdcp_ctrl *hdcp_ctrl) |
| 291 | { | 291 | { |
| 292 | struct hdmi *hdmi = hdcp_ctrl->hdmi; | 292 | struct hdmi *hdmi = hdcp_ctrl->hdmi; |
| 293 | u32 reg_val, failure, nack0; | 293 | u32 reg_val, failure, nack0; |
| @@ -337,7 +337,7 @@ static int reset_hdcp_ddc_failures(struct hdmi_hdcp_ctrl *hdcp_ctrl) · 43 unmodified lines | |||
| 337 | reg_val |= HDMI_DDC_CTRL_SW_STATUS_RESET; | 337 | reg_val |= HDMI_DDC_CTRL_SW_STATUS_RESET; |
| 338 | hdmi_write(hdmi, REG_HDMI_DDC_CTRL, reg_val); | 338 | hdmi_write(hdmi, REG_HDMI_DDC_CTRL, reg_val); |
| 339 | 339 | ||
| 340 | rc = hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV); | 340 | rc = msm_hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV); |
| 341 | 341 | ||
| 342 | reg_val = hdmi_read(hdmi, REG_HDMI_DDC_CTRL); | 342 | reg_val = hdmi_read(hdmi, REG_HDMI_DDC_CTRL); |
| 343 | reg_val &= ~HDMI_DDC_CTRL_SW_STATUS_RESET; | 343 | reg_val &= ~HDMI_DDC_CTRL_SW_STATUS_RESET; |
| @@ -350,7 +350,7 @@ static int reset_hdcp_ddc_failures(struct hdmi_hdcp_ctrl *hdcp_ctrl) · 6 unmodified lines | |||
| 350 | 350 | ||
| 351 | /* If previous msleep is aborted, skip this msleep */ | 351 | /* If previous msleep is aborted, skip this msleep */ |
| 352 | if (!rc) | 352 | if (!rc) |
| 353 | rc = hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV); | 353 | rc = msm_hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV); |
| 354 | 354 | ||
| 355 | reg_val = hdmi_read(hdmi, REG_HDMI_DDC_CTRL); | 355 | reg_val = hdmi_read(hdmi, REG_HDMI_DDC_CTRL); |
| 356 | reg_val &= ~HDMI_DDC_CTRL_SOFT_RESET; | 356 | reg_val &= ~HDMI_DDC_CTRL_SOFT_RESET; |
| @@ -362,7 +362,7 @@ static int reset_hdcp_ddc_failures(struct hdmi_hdcp_ctrl *hdcp_ctrl) · 5 unmodified lines | |||
| 362 | return rc; | 362 | return rc; |
| 363 | } | 363 | } |
| 364 | 364 | ||
| 365 | static int hdmi_hdcp_hw_ddc_clean(struct hdmi_hdcp_ctrl *hdcp_ctrl) | 365 | static int msm_hdmi_hdcp_hw_ddc_clean(struct hdmi_hdcp_ctrl *hdcp_ctrl) |
| 366 | { | 366 | { |
| 367 | int rc; | 367 | int rc; |
| 368 | u32 hdcp_ddc_status, ddc_hw_status; | 368 | u32 hdcp_ddc_status, ddc_hw_status; |
| @@ -394,7 +394,7 @@ static int hdmi_hdcp_hw_ddc_clean(struct hdmi_hdcp_ctrl *hdcp_ctrl) · 25 unmodified lines | |||
| 394 | return -ETIMEDOUT; | 394 | return -ETIMEDOUT; |
| 395 | } | 395 | } |
| 396 | 396 | ||
| 397 | rc = hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV); | 397 | rc = msm_hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV); |
| 398 | if (rc) | 398 | if (rc) |
| 399 | return rc; | 399 | return rc; |
| 400 | } while (1); | 400 | } while (1); |
| @@ -402,7 +402,7 @@ static int hdmi_hdcp_hw_ddc_clean(struct hdmi_hdcp_ctrl *hdcp_ctrl) · 1 unmodified line | |||
| 402 | return 0; | 402 | return 0; |
| 403 | } | 403 | } |
| 404 | 404 | ||
| 405 | static void hdmi_hdcp_reauth_work(struct work_struct *work) | 405 | static void msm_hdmi_hdcp_reauth_work(struct work_struct *work) |
| 406 | { | 406 | { |
| 407 | struct hdmi_hdcp_ctrl *hdcp_ctrl = container_of(work, | 407 | struct hdmi_hdcp_ctrl *hdcp_ctrl = container_of(work, |
| 408 | struct hdmi_hdcp_ctrl, hdcp_reauth_work); | 408 | struct hdmi_hdcp_ctrl, hdcp_reauth_work); |
| @@ -430,7 +430,7 @@ static void hdmi_hdcp_reauth_work(struct work_struct *work) · 21 unmodified lines | |||
| 430 | HDMI_HDCP_RESET_LINK0_DEAUTHENTICATE); | 430 | HDMI_HDCP_RESET_LINK0_DEAUTHENTICATE); |
| 431 | 431 | ||
| 432 | /* Wait to be clean on DDC HW engine */ | 432 | /* Wait to be clean on DDC HW engine */ |
| 433 | if (hdmi_hdcp_hw_ddc_clean(hdcp_ctrl)) { | 433 | if (msm_hdmi_hdcp_hw_ddc_clean(hdcp_ctrl)) { |
| 434 | pr_info("%s: reauth work aborted\n", __func__); | 434 | pr_info("%s: reauth work aborted\n", __func__); |
| 435 | return; | 435 | return; |
| 436 | } | 436 | } |
| @@ -461,7 +461,7 @@ static void hdmi_hdcp_reauth_work(struct work_struct *work) · 24 unmodified lines | |||
| 461 | queue_work(hdmi->workq, &hdcp_ctrl->hdcp_auth_work); | 461 | queue_work(hdmi->workq, &hdcp_ctrl->hdcp_auth_work); |
| 462 | } | 462 | } |
| 463 | 463 | ||
| 464 | static int hdmi_hdcp_auth_prepare(struct hdmi_hdcp_ctrl *hdcp_ctrl) | 464 | static int msm_hdmi_hdcp_auth_prepare(struct hdmi_hdcp_ctrl *hdcp_ctrl) |
| 465 | { | 465 | { |
| 466 | struct hdmi *hdmi = hdcp_ctrl->hdmi; | 466 | struct hdmi *hdmi = hdcp_ctrl->hdmi; |
| 467 | u32 link0_status; | 467 | u32 link0_status; |
| @@ -470,7 +470,7 @@ static int hdmi_hdcp_auth_prepare(struct hdmi_hdcp_ctrl *hdcp_ctrl) · 2 unmodified lines | |||
| 470 | int rc; | 470 | int rc; |
| 471 | 471 | ||
| 472 | if (!hdcp_ctrl->aksv_valid) { | 472 | if (!hdcp_ctrl->aksv_valid) { |
| 473 | rc = hdmi_hdcp_read_validate_aksv(hdcp_ctrl); | 473 | rc = msm_hdmi_hdcp_read_validate_aksv(hdcp_ctrl); |
| 474 | if (rc) { | 474 | if (rc) { |
| 475 | pr_err("%s: ASKV validation failed\n", __func__); | 475 | pr_err("%s: ASKV validation failed\n", __func__); |
| 476 | hdcp_ctrl->hdcp_state = HDCP_STATE_NO_AKSV; | 476 | hdcp_ctrl->hdcp_state = HDCP_STATE_NO_AKSV; |
| @@ -538,12 +538,12 @@ static int hdmi_hdcp_auth_prepare(struct hdmi_hdcp_ctrl *hdcp_ctrl) · 61 unmodified lines | |||
| 538 | DBG("An not ready after enabling HDCP"); | 538 | DBG("An not ready after enabling HDCP"); |
| 539 | 539 | ||
| 540 | /* Clear any DDC failures from previous tries before enable HDCP*/ | 540 | /* Clear any DDC failures from previous tries before enable HDCP*/ |
| 541 | rc = reset_hdcp_ddc_failures(hdcp_ctrl); | 541 | rc = msm_reset_hdcp_ddc_failures(hdcp_ctrl); |
| 542 | 542 | ||
| 543 | return rc; | 543 | return rc; |
| 544 | } | 544 | } |
| 545 | 545 | ||
| 546 | static void hdmi_hdcp_auth_fail(struct hdmi_hdcp_ctrl *hdcp_ctrl) | 546 | static void msm_hdmi_hdcp_auth_fail(struct hdmi_hdcp_ctrl *hdcp_ctrl) |
| 547 | { | 547 | { |
| 548 | struct hdmi *hdmi = hdcp_ctrl->hdmi; | 548 | struct hdmi *hdmi = hdcp_ctrl->hdmi; |
| 549 | u32 reg_val; | 549 | u32 reg_val; |
| @@ -561,7 +561,7 @@ static void hdmi_hdcp_auth_fail(struct hdmi_hdcp_ctrl *hdcp_ctrl) · 11 unmodified lines | |||
| 561 | queue_work(hdmi->workq, &hdcp_ctrl->hdcp_reauth_work); | 561 | queue_work(hdmi->workq, &hdcp_ctrl->hdcp_reauth_work); |
| 562 | } | 562 | } |
| 563 | 563 | ||
| 564 | static void hdmi_hdcp_auth_done(struct hdmi_hdcp_ctrl *hdcp_ctrl) | 564 | static void msm_hdmi_hdcp_auth_done(struct hdmi_hdcp_ctrl *hdcp_ctrl) |
| 565 | { | 565 | { |
| 566 | struct hdmi *hdmi = hdcp_ctrl->hdmi; | 566 | struct hdmi *hdmi = hdcp_ctrl->hdmi; |
| 567 | u32 reg_val; | 567 | u32 reg_val; |
| @@ -596,7 +596,7 @@ static void hdmi_hdcp_auth_done(struct hdmi_hdcp_ctrl *hdcp_ctrl) · 28 unmodified lines | |||
| 596 | * Write An and AKSV to sink | 596 | * Write An and AKSV to sink |
| 597 | * Read BKSV from sink and write into HDCP engine | 597 | * Read BKSV from sink and write into HDCP engine |
| 598 | */ | 598 | */ |
| 599 | static int hdmi_hdcp_wait_key_an_ready(struct hdmi_hdcp_ctrl *hdcp_ctrl) | 599 | static int msm_hdmi_hdcp_wait_key_an_ready(struct hdmi_hdcp_ctrl *hdcp_ctrl) |
| 600 | { | 600 | { |
| 601 | int rc; | 601 | int rc; |
| 602 | struct hdmi *hdmi = hdcp_ctrl->hdmi; | 602 | struct hdmi *hdmi = hdcp_ctrl->hdmi; |
| @@ -621,7 +621,7 @@ static int hdmi_hdcp_wait_key_an_ready(struct hdmi_hdcp_ctrl *hdcp_ctrl) · 18 unmodified lines | |||
| 621 | return -ETIMEDOUT; | 621 | return -ETIMEDOUT; |
| 622 | } | 622 | } |
| 623 | 623 | ||
| 624 | rc = hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV); | 624 | rc = msm_hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV); |
| 625 | if (rc) | 625 | if (rc) |
| 626 | return rc; | 626 | return rc; |
| 627 | } while (1); | 627 | } while (1); |
| @@ -643,7 +643,7 @@ static int hdmi_hdcp_wait_key_an_ready(struct hdmi_hdcp_ctrl *hdcp_ctrl) · 15 unmodified lines | |||
| 643 | return -ETIMEDOUT; | 643 | return -ETIMEDOUT; |
| 644 | } | 644 | } |
| 645 | 645 | ||
| 646 | rc = hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV); | 646 | rc = msm_hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV); |
| 647 | if (rc) | 647 | if (rc) |
| 648 | return rc; | 648 | return rc; |
| 649 | } while (1); | 649 | } while (1); |
| @@ -651,7 +651,7 @@ static int hdmi_hdcp_wait_key_an_ready(struct hdmi_hdcp_ctrl *hdcp_ctrl) · 1 unmodified line | |||
| 651 | return 0; | 651 | return 0; |
| 652 | } | 652 | } |
| 653 | 653 | ||
| 654 | static int hdmi_hdcp_send_aksv_an(struct hdmi_hdcp_ctrl *hdcp_ctrl) | 654 | static int msm_hdmi_hdcp_send_aksv_an(struct hdmi_hdcp_ctrl *hdcp_ctrl) |
| 655 | { | 655 | { |
| 656 | int rc = 0; | 656 | int rc = 0; |
| 657 | struct hdmi *hdmi = hdcp_ctrl->hdmi; | 657 | struct hdmi *hdmi = hdcp_ctrl->hdmi; |
| @@ -676,7 +676,7 @@ static int hdmi_hdcp_send_aksv_an(struct hdmi_hdcp_ctrl *hdcp_ctrl) · 18 unmodified lines | |||
| 676 | aksv[4] = link0_aksv_1 & 0xFF; | 676 | aksv[4] = link0_aksv_1 & 0xFF; |
| 677 | 677 | ||
| 678 | /* Write An to offset 0x18 */ | 678 | /* Write An to offset 0x18 */ |
| 679 | rc = hdmi_ddc_write(hdmi, HDCP_PORT_ADDR, 0x18, (u8 *)link0_an, | 679 | rc = msm_hdmi_ddc_write(hdmi, HDCP_PORT_ADDR, 0x18, (u8 *)link0_an, |
| 680 | (u16)sizeof(link0_an)); | 680 | (u16)sizeof(link0_an)); |
| 681 | if (rc) { | 681 | if (rc) { |
| 682 | pr_err("%s:An write failed\n", __func__); | 682 | pr_err("%s:An write failed\n", __func__); |
| @@ -685,7 +685,7 @@ static int hdmi_hdcp_send_aksv_an(struct hdmi_hdcp_ctrl *hdcp_ctrl) · 2 unmodified lines | |||
| 685 | DBG("Link0-An=%08x%08x", link0_an[0], link0_an[1]); | 685 | DBG("Link0-An=%08x%08x", link0_an[0], link0_an[1]); |
| 686 | 686 | ||
| 687 | /* Write AKSV to offset 0x10 */ | 687 | /* Write AKSV to offset 0x10 */ |
| 688 | rc = hdmi_ddc_write(hdmi, HDCP_PORT_ADDR, 0x10, aksv, 5); | 688 | rc = msm_hdmi_ddc_write(hdmi, HDCP_PORT_ADDR, 0x10, aksv, 5); |
| 689 | if (rc) { | 689 | if (rc) { |
| 690 | pr_err("%s:AKSV write failed\n", __func__); | 690 | pr_err("%s:AKSV write failed\n", __func__); |
| 691 | return rc; | 691 | return rc; |
| @@ -695,7 +695,7 @@ static int hdmi_hdcp_send_aksv_an(struct hdmi_hdcp_ctrl *hdcp_ctrl) · 3 unmodified lines | |||
| 695 | return 0; | 695 | return 0; |
| 696 | } | 696 | } |
| 697 | 697 | ||
| 698 | static int hdmi_hdcp_recv_bksv(struct hdmi_hdcp_ctrl *hdcp_ctrl) | 698 | static int msm_hdmi_hdcp_recv_bksv(struct hdmi_hdcp_ctrl *hdcp_ctrl) |
| 699 | { | 699 | { |
| 700 | int rc = 0; | 700 | int rc = 0; |
| 701 | struct hdmi *hdmi = hdcp_ctrl->hdmi; | 701 | struct hdmi *hdmi = hdcp_ctrl->hdmi; |
| @@ -703,7 +703,7 @@ static int hdmi_hdcp_recv_bksv(struct hdmi_hdcp_ctrl *hdcp_ctrl) · 1 unmodified line | |||
| 703 | u32 reg[2], data[2]; | 703 | u32 reg[2], data[2]; |
| 704 | 704 | ||
| 705 | /* Read BKSV at offset 0x00 */ | 705 | /* Read BKSV at offset 0x00 */ |
| 706 | rc = hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, 0x00, bksv, 5); | 706 | rc = msm_hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, 0x00, bksv, 5); |
| 707 | if (rc) { | 707 | if (rc) { |
| 708 | pr_err("%s:BKSV read failed\n", __func__); | 708 | pr_err("%s:BKSV read failed\n", __func__); |
| 709 | return rc; | 709 | return rc; |
| @@ -728,19 +728,19 @@ static int hdmi_hdcp_recv_bksv(struct hdmi_hdcp_ctrl *hdcp_ctrl) · 18 unmodified lines | |||
| 728 | data[0] = hdcp_ctrl->bksv_lsb; | 728 | data[0] = hdcp_ctrl->bksv_lsb; |
| 729 | reg[1] = REG_HDMI_HDCP_RCVPORT_DATA1; | 729 | reg[1] = REG_HDMI_HDCP_RCVPORT_DATA1; |
| 730 | data[1] = hdcp_ctrl->bksv_msb; | 730 | data[1] = hdcp_ctrl->bksv_msb; |
| 731 | rc = hdmi_hdcp_scm_wr(hdcp_ctrl, reg, data, 2); | 731 | rc = msm_hdmi_hdcp_scm_wr(hdcp_ctrl, reg, data, 2); |
| 732 | 732 | ||
| 733 | return rc; | 733 | return rc; |
| 734 | } | 734 | } |
| 735 | 735 | ||
| 736 | static int hdmi_hdcp_recv_bcaps(struct hdmi_hdcp_ctrl *hdcp_ctrl) | 736 | static int msm_hdmi_hdcp_recv_bcaps(struct hdmi_hdcp_ctrl *hdcp_ctrl) |
| 737 | { | 737 | { |
| 738 | int rc = 0; | 738 | int rc = 0; |
| 739 | struct hdmi *hdmi = hdcp_ctrl->hdmi; | 739 | struct hdmi *hdmi = hdcp_ctrl->hdmi; |
| 740 | u32 reg, data; | 740 | u32 reg, data; |
| 741 | u8 bcaps; | 741 | u8 bcaps; |
| 742 | 742 | ||
| 743 | rc = hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, 0x40, &bcaps, 1); | 743 | rc = msm_hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, 0x40, &bcaps, 1); |
| 744 | if (rc) { | 744 | if (rc) { |
| 745 | pr_err("%s:BCAPS read failed\n", __func__); | 745 | pr_err("%s:BCAPS read failed\n", __func__); |
| 746 | return rc; | 746 | return rc; |
| @@ -753,26 +753,26 @@ static int hdmi_hdcp_recv_bcaps(struct hdmi_hdcp_ctrl *hdcp_ctrl) · 6 unmodified lines | |||
| 753 | /* Write BCAPS to the hardware */ | 753 | /* Write BCAPS to the hardware */ |
| 754 | reg = REG_HDMI_HDCP_RCVPORT_DATA12; | 754 | reg = REG_HDMI_HDCP_RCVPORT_DATA12; |
| 755 | data = (u32)bcaps; | 755 | data = (u32)bcaps; |
| 756 | rc = hdmi_hdcp_scm_wr(hdcp_ctrl, ®, &data, 1); | 756 | rc = msm_hdmi_hdcp_scm_wr(hdcp_ctrl, ®, &data, 1); |
| 757 | 757 | ||
| 758 | return rc; | 758 | return rc; |
| 759 | } | 759 | } |
| 760 | 760 | ||
| 761 | static int hdmi_hdcp_auth_part1_key_exchange(struct hdmi_hdcp_ctrl *hdcp_ctrl) | 761 | static int msm_hdmi_hdcp_auth_part1_key_exchange(struct hdmi_hdcp_ctrl *hdcp_ctrl) |
| 762 | { | 762 | { |
| 763 | struct hdmi *hdmi = hdcp_ctrl->hdmi; | 763 | struct hdmi *hdmi = hdcp_ctrl->hdmi; |
| 764 | unsigned long flags; | 764 | unsigned long flags; |
| 765 | int rc; | 765 | int rc; |
| 766 | 766 | ||
| 767 | /* Wait for AKSV key and An ready */ | 767 | /* Wait for AKSV key and An ready */ |
| 768 | rc = hdmi_hdcp_wait_key_an_ready(hdcp_ctrl); | 768 | rc = msm_hdmi_hdcp_wait_key_an_ready(hdcp_ctrl); |
| 769 | if (rc) { | 769 | if (rc) { |
| 770 | pr_err("%s: wait key and an ready failed\n", __func__); | 770 | pr_err("%s: wait key and an ready failed\n", __func__); |
| 771 | return rc; | 771 | return rc; |
| 772 | }; | 772 | }; |
| 773 | 773 | ||
| 774 | /* Read BCAPS and send to HDCP engine */ | 774 | /* Read BCAPS and send to HDCP engine */ |
| 775 | rc = hdmi_hdcp_recv_bcaps(hdcp_ctrl); | 775 | rc = msm_hdmi_hdcp_recv_bcaps(hdcp_ctrl); |
| 776 | if (rc) { | 776 | if (rc) { |
| 777 | pr_err("%s: read bcaps error, abort\n", __func__); | 777 | pr_err("%s: read bcaps error, abort\n", __func__); |
| 778 | return rc; | 778 | return rc; |
| @@ -785,14 +785,14 @@ static int hdmi_hdcp_auth_part1_key_exchange(struct hdmi_hdcp_ctrl *hdcp_ctrl) · 6 unmodified lines | |||
| 785 | hdmi_write(hdmi, REG_HDMI_HDCP_RCVPORT_DATA4, 0); | 785 | hdmi_write(hdmi, REG_HDMI_HDCP_RCVPORT_DATA4, 0); |
| 786 | 786 | ||
| 787 | /* Send AKSV and An to sink */ | 787 | /* Send AKSV and An to sink */ |
| 788 | rc = hdmi_hdcp_send_aksv_an(hdcp_ctrl); | 788 | rc = msm_hdmi_hdcp_send_aksv_an(hdcp_ctrl); |
| 789 | if (rc) { | 789 | if (rc) { |
| 790 | pr_err("%s:An/Aksv write failed\n", __func__); | 790 | pr_err("%s:An/Aksv write failed\n", __func__); |
| 791 | return rc; | 791 | return rc; |
| 792 | } | 792 | } |
| 793 | 793 | ||
| 794 | /* Read BKSV and send to HDCP engine*/ | 794 | /* Read BKSV and send to HDCP engine*/ |
| 795 | rc = hdmi_hdcp_recv_bksv(hdcp_ctrl); | 795 | rc = msm_hdmi_hdcp_recv_bksv(hdcp_ctrl); |
| 796 | if (rc) { | 796 | if (rc) { |
| 797 | pr_err("%s:BKSV Process failed\n", __func__); | 797 | pr_err("%s:BKSV Process failed\n", __func__); |
| 798 | return rc; | 798 | return rc; |
| @@ -812,7 +812,7 @@ static int hdmi_hdcp_auth_part1_key_exchange(struct hdmi_hdcp_ctrl *hdcp_ctrl) · 13 unmodified lines | |||
| 812 | } | 812 | } |
| 813 | 813 | ||
| 814 | /* read R0' from sink and pass it to HDCP engine */ | 814 | /* read R0' from sink and pass it to HDCP engine */ |
| 815 | static int hdmi_hdcp_auth_part1_recv_r0(struct hdmi_hdcp_ctrl *hdcp_ctrl) | 815 | static int msm_hdmi_hdcp_auth_part1_recv_r0(struct hdmi_hdcp_ctrl *hdcp_ctrl) |
| 816 | { | 816 | { |
| 817 | struct hdmi *hdmi = hdcp_ctrl->hdmi; | 817 | struct hdmi *hdmi = hdcp_ctrl->hdmi; |
| 818 | int rc = 0; | 818 | int rc = 0; |
| @@ -822,12 +822,12 @@ static int hdmi_hdcp_auth_part1_recv_r0(struct hdmi_hdcp_ctrl *hdcp_ctrl) · 3 unmodified lines | |||
| 822 | * HDCP Compliance Test case 1A-01: | 822 | * HDCP Compliance Test case 1A-01: |
| 823 | * Wait here at least 100ms before reading R0' | 823 | * Wait here at least 100ms before reading R0' |
| 824 | */ | 824 | */ |
| 825 | rc = hdmi_hdcp_msleep(hdcp_ctrl, 125, AUTH_ABORT_EV); | 825 | rc = msm_hdmi_hdcp_msleep(hdcp_ctrl, 125, AUTH_ABORT_EV); |
| 826 | if (rc) | 826 | if (rc) |
| 827 | return rc; | 827 | return rc; |
| 828 | 828 | ||
| 829 | /* Read R0' at offset 0x08 */ | 829 | /* Read R0' at offset 0x08 */ |
| 830 | rc = hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, 0x08, buf, 2); | 830 | rc = msm_hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, 0x08, buf, 2); |
| 831 | if (rc) { | 831 | if (rc) { |
| 832 | pr_err("%s:R0' read failed\n", __func__); | 832 | pr_err("%s:R0' read failed\n", __func__); |
| 833 | return rc; | 833 | return rc; |
| @@ -842,14 +842,14 @@ static int hdmi_hdcp_auth_part1_recv_r0(struct hdmi_hdcp_ctrl *hdcp_ctrl) · 8 unmodified lines | |||
| 842 | } | 842 | } |
| 843 | 843 | ||
| 844 | /* Wait for authenticating result: R0/R0' are matched or not */ | 844 | /* Wait for authenticating result: R0/R0' are matched or not */ |
| 845 | static int hdmi_hdcp_auth_part1_verify_r0(struct hdmi_hdcp_ctrl *hdcp_ctrl) | 845 | static int msm_hdmi_hdcp_auth_part1_verify_r0(struct hdmi_hdcp_ctrl *hdcp_ctrl) |
| 846 | { | 846 | { |
| 847 | struct hdmi *hdmi = hdcp_ctrl->hdmi; | 847 | struct hdmi *hdmi = hdcp_ctrl->hdmi; |
| 848 | u32 link0_status; | 848 | u32 link0_status; |
| 849 | int rc; | 849 | int rc; |
| 850 | 850 | ||
| 851 | /* wait for hdcp irq, 10 sec should be long enough */ | 851 | /* wait for hdcp irq, 10 sec should be long enough */ |
| 852 | rc = hdmi_hdcp_msleep(hdcp_ctrl, 10000, AUTH_RESULT_RDY_EV); | 852 | rc = msm_hdmi_hdcp_msleep(hdcp_ctrl, 10000, AUTH_RESULT_RDY_EV); |
| 853 | if (!rc) { | 853 | if (!rc) { |
| 854 | pr_err("%s: Wait Auth IRQ timeout\n", __func__); | 854 | pr_err("%s: Wait Auth IRQ timeout\n", __func__); |
| 855 | return -ETIMEDOUT; | 855 | return -ETIMEDOUT; |
| @@ -869,7 +869,7 @@ static int hdmi_hdcp_auth_part1_verify_r0(struct hdmi_hdcp_ctrl *hdcp_ctrl) · 13 unmodified lines | |||
| 869 | return 0; | 869 | return 0; |
| 870 | } | 870 | } |
| 871 | 871 | ||
| 872 | static int hdmi_hdcp_recv_check_bstatus(struct hdmi_hdcp_ctrl *hdcp_ctrl, | 872 | static int msm_hdmi_hdcp_recv_check_bstatus(struct hdmi_hdcp_ctrl *hdcp_ctrl, |
| 873 | u16 *pbstatus) | 873 | u16 *pbstatus) |
| 874 | { | 874 | { |
| 875 | int rc; | 875 | int rc; |
| @@ -880,7 +880,7 @@ static int hdmi_hdcp_recv_check_bstatus(struct hdmi_hdcp_ctrl *hdcp_ctrl, · 4 unmodified lines | |||
| 880 | u8 buf[2]; | 880 | u8 buf[2]; |
| 881 | 881 | ||
| 882 | /* Read BSTATUS at offset 0x41 */ | 882 | /* Read BSTATUS at offset 0x41 */ |
| 883 | rc = hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, 0x41, buf, 2); | 883 | rc = msm_hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, 0x41, buf, 2); |
| 884 | if (rc) { | 884 | if (rc) { |
| 885 | pr_err("%s: BSTATUS read failed\n", __func__); | 885 | pr_err("%s: BSTATUS read failed\n", __func__); |
| 886 | goto error; | 886 | goto error; |
| @@ -936,7 +936,7 @@ error: · 49 unmodified lines | |||
| 936 | return rc; | 936 | return rc; |
| 937 | } | 937 | } |
| 938 | 938 | ||
| 939 | static int hdmi_hdcp_auth_part2_wait_ksv_fifo_ready( | 939 | static int msm_hdmi_hdcp_auth_part2_wait_ksv_fifo_ready( |
| 940 | struct hdmi_hdcp_ctrl *hdcp_ctrl) | 940 | struct hdmi_hdcp_ctrl *hdcp_ctrl) |
| 941 | { | 941 | { |
| 942 | int rc; | 942 | int rc; |
| @@ -953,7 +953,7 @@ static int hdmi_hdcp_auth_part2_wait_ksv_fifo_ready( · 10 unmodified lines | |||
| 953 | timeout_count = 100; | 953 | timeout_count = 100; |
| 954 | do { | 954 | do { |
| 955 | /* Read BCAPS at offset 0x40 */ | 955 | /* Read BCAPS at offset 0x40 */ |
| 956 | rc = hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, 0x40, &bcaps, 1); | 956 | rc = msm_hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, 0x40, &bcaps, 1); |
| 957 | if (rc) { | 957 | if (rc) { |
| 958 | pr_err("%s: BCAPS read failed\n", __func__); | 958 | pr_err("%s: BCAPS read failed\n", __func__); |
| 959 | return rc; | 959 | return rc; |
| @@ -968,12 +968,12 @@ static int hdmi_hdcp_auth_part2_wait_ksv_fifo_ready( · 8 unmodified lines | |||
| 968 | return -ETIMEDOUT; | 968 | return -ETIMEDOUT; |
| 969 | } | 969 | } |
| 970 | 970 | ||
| 971 | rc = hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV); | 971 | rc = msm_hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV); |
| 972 | if (rc) | 972 | if (rc) |
| 973 | return rc; | 973 | return rc; |
| 974 | } while (1); | 974 | } while (1); |
| 975 | 975 | ||
| 976 | rc = hdmi_hdcp_recv_check_bstatus(hdcp_ctrl, &bstatus); | 976 | rc = msm_hdmi_hdcp_recv_check_bstatus(hdcp_ctrl, &bstatus); |
| 977 | if (rc) { | 977 | if (rc) { |
| 978 | pr_err("%s: bstatus error\n", __func__); | 978 | pr_err("%s: bstatus error\n", __func__); |
| 979 | return rc; | 979 | return rc; |
| @@ -982,7 +982,7 @@ static int hdmi_hdcp_auth_part2_wait_ksv_fifo_ready( · 2 unmodified lines | |||
| 982 | /* Write BSTATUS and BCAPS to HDCP registers */ | 982 | /* Write BSTATUS and BCAPS to HDCP registers */ |
| 983 | reg = REG_HDMI_HDCP_RCVPORT_DATA12; | 983 | reg = REG_HDMI_HDCP_RCVPORT_DATA12; |
| 984 | data = bcaps | (bstatus << 8); | 984 | data = bcaps | (bstatus << 8); |
| 985 | rc = hdmi_hdcp_scm_wr(hdcp_ctrl, ®, &data, 1); | 985 | rc = msm_hdmi_hdcp_scm_wr(hdcp_ctrl, ®, &data, 1); |
| 986 | if (rc) { | 986 | if (rc) { |
| 987 | pr_err("%s: BSTATUS write failed\n", __func__); | 987 | pr_err("%s: BSTATUS write failed\n", __func__); |
| 988 | return rc; | 988 | return rc; |
| @@ -997,7 +997,7 @@ static int hdmi_hdcp_auth_part2_wait_ksv_fifo_ready( · 8 unmodified lines | |||
| 997 | * transfer V' from sink to HDCP engine | 997 | * transfer V' from sink to HDCP engine |
| 998 | * reset SHA engine | 998 | * reset SHA engine |
| 999 | */ | 999 | */ |
| 1000 | static int hdmi_hdcp_transfer_v_h(struct hdmi_hdcp_ctrl *hdcp_ctrl) | 1000 | static int msm_hdmi_hdcp_transfer_v_h(struct hdmi_hdcp_ctrl *hdcp_ctrl) |
| 1001 | { | 1001 | { |
| 1002 | struct hdmi *hdmi = hdcp_ctrl->hdmi; | 1002 | struct hdmi *hdmi = hdcp_ctrl->hdmi; |
| 1003 | int rc = 0; | 1003 | int rc = 0; |
| @@ -1016,7 +1016,7 @@ static int hdmi_hdcp_transfer_v_h(struct hdmi_hdcp_ctrl *hdcp_ctrl) · 12 unmodified lines | |||
| 1016 | 1016 | ||
| 1017 | for (i = 0; i < size; i++) { | 1017 | for (i = 0; i < size; i++) { |
| 1018 | rd = ®_data[i]; | 1018 | rd = ®_data[i]; |
| 1019 | rc = hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, | 1019 | rc = msm_hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, |
| 1020 | rd->off, (u8 *)&data[i], (u16)sizeof(data[i])); | 1020 | rd->off, (u8 *)&data[i], (u16)sizeof(data[i])); |
| 1021 | if (rc) { | 1021 | if (rc) { |
| 1022 | pr_err("%s: Read %s failed\n", __func__, rd->name); | 1022 | pr_err("%s: Read %s failed\n", __func__, rd->name); |
| @@ -1027,13 +1027,13 @@ static int hdmi_hdcp_transfer_v_h(struct hdmi_hdcp_ctrl *hdcp_ctrl) · 4 unmodified lines | |||
| 1027 | reg[i] = reg_data[i].reg_id; | 1027 | reg[i] = reg_data[i].reg_id; |
| 1028 | } | 1028 | } |
| 1029 | 1029 | ||
| 1030 | rc = hdmi_hdcp_scm_wr(hdcp_ctrl, reg, data, size); | 1030 | rc = msm_hdmi_hdcp_scm_wr(hdcp_ctrl, reg, data, size); |
| 1031 | 1031 | ||
| 1032 | error: | 1032 | error: |
| 1033 | return rc; | 1033 | return rc; |
| 1034 | } | 1034 | } |
| 1035 | 1035 | ||
| 1036 | static int hdmi_hdcp_recv_ksv_fifo(struct hdmi_hdcp_ctrl *hdcp_ctrl) | 1036 | static int msm_hdmi_hdcp_recv_ksv_fifo(struct hdmi_hdcp_ctrl *hdcp_ctrl) |
| 1037 | { | 1037 | { |
| 1038 | int rc; | 1038 | int rc; |
| 1039 | struct hdmi *hdmi = hdcp_ctrl->hdmi; | 1039 | struct hdmi *hdmi = hdcp_ctrl->hdmi; |
| @@ -1041,7 +1041,7 @@ static int hdmi_hdcp_recv_ksv_fifo(struct hdmi_hdcp_ctrl *hdcp_ctrl) · 1 unmodified line | |||
| 1041 | 1041 | ||
| 1042 | ksv_bytes = 5 * hdcp_ctrl->dev_count; | 1042 | ksv_bytes = 5 * hdcp_ctrl->dev_count; |
| 1043 | 1043 | ||
| 1044 | rc = hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, 0x43, | 1044 | rc = msm_hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, 0x43, |
| 1045 | hdcp_ctrl->ksv_list, ksv_bytes); | 1045 | hdcp_ctrl->ksv_list, ksv_bytes); |
| 1046 | if (rc) | 1046 | if (rc) |
| 1047 | pr_err("%s: KSV FIFO read failed\n", __func__); | 1047 | pr_err("%s: KSV FIFO read failed\n", __func__); |
| @@ -1049,7 +1049,7 @@ static int hdmi_hdcp_recv_ksv_fifo(struct hdmi_hdcp_ctrl *hdcp_ctrl) · 1 unmodified line | |||
| 1049 | return rc; | 1049 | return rc; |
| 1050 | } | 1050 | } |
| 1051 | 1051 | ||
| 1052 | static int hdmi_hdcp_reset_sha_engine(struct hdmi_hdcp_ctrl *hdcp_ctrl) | 1052 | static int msm_hdmi_hdcp_reset_sha_engine(struct hdmi_hdcp_ctrl *hdcp_ctrl) |
| 1053 | { | 1053 | { |
| 1054 | u32 reg[2], data[2]; | 1054 | u32 reg[2], data[2]; |
| 1055 | u32 rc = 0; | 1055 | u32 rc = 0; |
| @@ -1059,12 +1059,12 @@ static int hdmi_hdcp_reset_sha_engine(struct hdmi_hdcp_ctrl *hdcp_ctrl) · 3 unmodified lines | |||
| 1059 | reg[1] = REG_HDMI_HDCP_SHA_CTRL; | 1059 | reg[1] = REG_HDMI_HDCP_SHA_CTRL; |
| 1060 | data[1] = HDCP_REG_DISABLE; | 1060 | data[1] = HDCP_REG_DISABLE; |
| 1061 | 1061 | ||
| 1062 | rc = hdmi_hdcp_scm_wr(hdcp_ctrl, reg, data, 2); | 1062 | rc = msm_hdmi_hdcp_scm_wr(hdcp_ctrl, reg, data, 2); |
| 1063 | 1063 | ||
| 1064 | return rc; | 1064 | return rc; |
| 1065 | } | 1065 | } |
| 1066 | 1066 | ||
| 1067 | static int hdmi_hdcp_auth_part2_recv_ksv_fifo( | 1067 | static int msm_hdmi_hdcp_auth_part2_recv_ksv_fifo( |
| 1068 | struct hdmi_hdcp_ctrl *hdcp_ctrl) | 1068 | struct hdmi_hdcp_ctrl *hdcp_ctrl) |
| 1069 | { | 1069 | { |
| 1070 | int rc; | 1070 | int rc; |
| @@ -1081,7 +1081,7 @@ static int hdmi_hdcp_auth_part2_recv_ksv_fifo( · 10 unmodified lines | |||
| 1081 | */ | 1081 | */ |
| 1082 | timeout_count = 100; | 1082 | timeout_count = 100; |
| 1083 | do { | 1083 | do { |
| 1084 | rc = hdmi_hdcp_recv_ksv_fifo(hdcp_ctrl); | 1084 | rc = msm_hdmi_hdcp_recv_ksv_fifo(hdcp_ctrl); |
| 1085 | if (!rc) | 1085 | if (!rc) |
| 1086 | break; | 1086 | break; |
| 1087 | 1087 | ||
| @@ -1091,19 +1091,19 @@ static int hdmi_hdcp_auth_part2_recv_ksv_fifo( · 3 unmodified lines | |||
| 1091 | return -ETIMEDOUT; | 1091 | return -ETIMEDOUT; |
| 1092 | } | 1092 | } |
| 1093 | 1093 | ||
| 1094 | rc = hdmi_hdcp_msleep(hdcp_ctrl, 25, AUTH_ABORT_EV); | 1094 | rc = msm_hdmi_hdcp_msleep(hdcp_ctrl, 25, AUTH_ABORT_EV); |
| 1095 | if (rc) | 1095 | if (rc) |
| 1096 | return rc; | 1096 | return rc; |
| 1097 | } while (1); | 1097 | } while (1); |
| 1098 | 1098 | ||
| 1099 | rc = hdmi_hdcp_transfer_v_h(hdcp_ctrl); | 1099 | rc = msm_hdmi_hdcp_transfer_v_h(hdcp_ctrl); |
| 1100 | if (rc) { | 1100 | if (rc) { |
| 1101 | pr_err("%s: transfer V failed\n", __func__); | 1101 | pr_err("%s: transfer V failed\n", __func__); |
| 1102 | return rc; | 1102 | return rc; |
| 1103 | } | 1103 | } |
| 1104 | 1104 | ||
| 1105 | /* reset SHA engine before write ksv fifo */ | 1105 | /* reset SHA engine before write ksv fifo */ |
| 1106 | rc = hdmi_hdcp_reset_sha_engine(hdcp_ctrl); | 1106 | rc = msm_hdmi_hdcp_reset_sha_engine(hdcp_ctrl); |
| 1107 | if (rc) { | 1107 | if (rc) { |
| 1108 | pr_err("%s: fail to reset sha engine\n", __func__); | 1108 | pr_err("%s: fail to reset sha engine\n", __func__); |
| 1109 | return rc; | 1109 | return rc; |
| @@ -1120,7 +1120,7 @@ static int hdmi_hdcp_auth_part2_recv_ksv_fifo( · 10 unmodified lines | |||
| 1120 | * If the last byte is written, we need to poll for | 1120 | * If the last byte is written, we need to poll for |
| 1121 | * HDCP_SHA_COMP_DONE to wait until HW finish | 1121 | * HDCP_SHA_COMP_DONE to wait until HW finish |
| 1122 | */ | 1122 | */ |
| 1123 | static int hdmi_hdcp_write_ksv_fifo(struct hdmi_hdcp_ctrl *hdcp_ctrl) | 1123 | static int msm_hdmi_hdcp_write_ksv_fifo(struct hdmi_hdcp_ctrl *hdcp_ctrl) |
| 1124 | { | 1124 | { |
| 1125 | int i; | 1125 | int i; |
| 1126 | struct hdmi *hdmi = hdcp_ctrl->hdmi; | 1126 | struct hdmi *hdmi = hdcp_ctrl->hdmi; |
| @@ -1169,7 +1169,7 @@ static int hdmi_hdcp_write_ksv_fifo(struct hdmi_hdcp_ctrl *hdcp_ctrl) · 42 unmodified lines | |||
| 1169 | 1169 | ||
| 1170 | reg = REG_HDMI_HDCP_SHA_DATA; | 1170 | reg = REG_HDMI_HDCP_SHA_DATA; |
| 1171 | data = reg_val; | 1171 | data = reg_val; |
| 1172 | rc = hdmi_hdcp_scm_wr(hdcp_ctrl, ®, &data, 1); | 1172 | rc = msm_hdmi_hdcp_scm_wr(hdcp_ctrl, ®, &data, 1); |
| 1173 | 1173 | ||
| 1174 | if (rc) | 1174 | if (rc) |
| 1175 | return rc; | 1175 | return rc; |
| @@ -1184,7 +1184,7 @@ static int hdmi_hdcp_write_ksv_fifo(struct hdmi_hdcp_ctrl *hdcp_ctrl) · 8 unmodified lines | |||
| 1184 | } | 1184 | } |
| 1185 | 1185 | ||
| 1186 | /* write ksv fifo into HDCP engine */ | 1186 | /* write ksv fifo into HDCP engine */ |
| 1187 | static int hdmi_hdcp_auth_part2_write_ksv_fifo( | 1187 | static int msm_hdmi_hdcp_auth_part2_write_ksv_fifo( |
| 1188 | struct hdmi_hdcp_ctrl *hdcp_ctrl) | 1188 | struct hdmi_hdcp_ctrl *hdcp_ctrl) |
| 1189 | { | 1189 | { |
| 1190 | int rc; | 1190 | int rc; |
| @@ -1193,7 +1193,7 @@ static int hdmi_hdcp_auth_part2_write_ksv_fifo( · 2 unmodified lines | |||
| 1193 | hdcp_ctrl->ksv_fifo_w_index = 0; | 1193 | hdcp_ctrl->ksv_fifo_w_index = 0; |
| 1194 | timeout_count = 100; | 1194 | timeout_count = 100; |
| 1195 | do { | 1195 | do { |
| 1196 | rc = hdmi_hdcp_write_ksv_fifo(hdcp_ctrl); | 1196 | rc = msm_hdmi_hdcp_write_ksv_fifo(hdcp_ctrl); |
| 1197 | if (!rc) | 1197 | if (!rc) |
| 1198 | break; | 1198 | break; |
| 1199 | 1199 | ||
| @@ -1206,7 +1206,7 @@ static int hdmi_hdcp_auth_part2_write_ksv_fifo( · 6 unmodified lines | |||
| 1206 | return -ETIMEDOUT; | 1206 | return -ETIMEDOUT; |
| 1207 | } | 1207 | } |
| 1208 | 1208 | ||
| 1209 | rc = hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV); | 1209 | rc = msm_hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV); |
| 1210 | if (rc) | 1210 | if (rc) |
| 1211 | return rc; | 1211 | return rc; |
| 1212 | } while (1); | 1212 | } while (1); |
| @@ -1214,7 +1214,7 @@ static int hdmi_hdcp_auth_part2_write_ksv_fifo( · 1 unmodified line | |||
| 1214 | return 0; | 1214 | return 0; |
| 1215 | } | 1215 | } |
| 1216 | 1216 | ||
| 1217 | static int hdmi_hdcp_auth_part2_check_v_match(struct hdmi_hdcp_ctrl *hdcp_ctrl) | 1217 | static int msm_hdmi_hdcp_auth_part2_check_v_match(struct hdmi_hdcp_ctrl *hdcp_ctrl) |
| 1218 | { | 1218 | { |
| 1219 | int rc = 0; | 1219 | int rc = 0; |
| 1220 | struct hdmi *hdmi = hdcp_ctrl->hdmi; | 1220 | struct hdmi *hdmi = hdcp_ctrl->hdmi; |
| @@ -1232,7 +1232,7 @@ static int hdmi_hdcp_auth_part2_check_v_match(struct hdmi_hdcp_ctrl *hdcp_ctrl) · 11 unmodified lines | |||
| 1232 | return -ETIMEDOUT; | 1232 | return -ETIMEDOUT; |
| 1233 | } | 1233 | } |
| 1234 | 1234 | ||
| 1235 | rc = hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV); | 1235 | rc = msm_hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV); |
| 1236 | if (rc) | 1236 | if (rc) |
| 1237 | return rc; | 1237 | return rc; |
| 1238 | } while (1); | 1238 | } while (1); |
| @@ -1240,32 +1240,32 @@ static int hdmi_hdcp_auth_part2_check_v_match(struct hdmi_hdcp_ctrl *hdcp_ctrl) · 1 unmodified line | |||
| 1240 | return 0; | 1240 | return 0; |
| 1241 | } | 1241 | } |
| 1242 | 1242 | ||
| 1243 | static void hdmi_hdcp_auth_work(struct work_struct *work) | 1243 | static void msm_hdmi_hdcp_auth_work(struct work_struct *work) |
| 1244 | { | 1244 | { |
| 1245 | struct hdmi_hdcp_ctrl *hdcp_ctrl = container_of(work, | 1245 | struct hdmi_hdcp_ctrl *hdcp_ctrl = container_of(work, |
| 1246 | struct hdmi_hdcp_ctrl, hdcp_auth_work); | 1246 | struct hdmi_hdcp_ctrl, hdcp_auth_work); |
| 1247 | int rc; | 1247 | int rc; |
| 1248 | 1248 | ||
| 1249 | rc = hdmi_hdcp_auth_prepare(hdcp_ctrl); | 1249 | rc = msm_hdmi_hdcp_auth_prepare(hdcp_ctrl); |
| 1250 | if (rc) { | 1250 | if (rc) { |
| 1251 | pr_err("%s: auth prepare failed %d\n", __func__, rc); | 1251 | pr_err("%s: auth prepare failed %d\n", __func__, rc); |
| 1252 | goto end; | 1252 | goto end; |
| 1253 | } | 1253 | } |
| 1254 | 1254 | ||
| 1255 | /* HDCP PartI */ | 1255 | /* HDCP PartI */ |
| 1256 | rc = hdmi_hdcp_auth_part1_key_exchange(hdcp_ctrl); | 1256 | rc = msm_hdmi_hdcp_auth_part1_key_exchange(hdcp_ctrl); |
| 1257 | if (rc) { | 1257 | if (rc) { |
| 1258 | pr_err("%s: key exchange failed %d\n", __func__, rc); | 1258 | pr_err("%s: key exchange failed %d\n", __func__, rc); |
| 1259 | goto end; | 1259 | goto end; |
| 1260 | } | 1260 | } |
| 1261 | 1261 | ||
| 1262 | rc = hdmi_hdcp_auth_part1_recv_r0(hdcp_ctrl); | 1262 | rc = msm_hdmi_hdcp_auth_part1_recv_r0(hdcp_ctrl); |
| 1263 | if (rc) { | 1263 | if (rc) { |
| 1264 | pr_err("%s: receive r0 failed %d\n", __func__, rc); | 1264 | pr_err("%s: receive r0 failed %d\n", __func__, rc); |
| 1265 | goto end; | 1265 | goto end; |
| 1266 | } | 1266 | } |
| 1267 | 1267 | ||
| 1268 | rc = hdmi_hdcp_auth_part1_verify_r0(hdcp_ctrl); | 1268 | rc = msm_hdmi_hdcp_auth_part1_verify_r0(hdcp_ctrl); |
| 1269 | if (rc) { | 1269 | if (rc) { |
| 1270 | pr_err("%s: verify r0 failed %d\n", __func__, rc); | 1270 | pr_err("%s: verify r0 failed %d\n", __func__, rc); |
| 1271 | goto end; | 1271 | goto end; |
| @@ -1275,25 +1275,25 @@ static void hdmi_hdcp_auth_work(struct work_struct *work) · 3 unmodified lines | |||
| 1275 | goto end; | 1275 | goto end; |
| 1276 | 1276 | ||
| 1277 | /* HDCP PartII */ | 1277 | /* HDCP PartII */ |
| 1278 | rc = hdmi_hdcp_auth_part2_wait_ksv_fifo_ready(hdcp_ctrl); | 1278 | rc = msm_hdmi_hdcp_auth_part2_wait_ksv_fifo_ready(hdcp_ctrl); |
| 1279 | if (rc) { | 1279 | if (rc) { |
| 1280 | pr_err("%s: wait ksv fifo ready failed %d\n", __func__, rc); | 1280 | pr_err("%s: wait ksv fifo ready failed %d\n", __func__, rc); |
| 1281 | goto end; | 1281 | goto end; |
| 1282 | } | 1282 | } |
| 1283 | 1283 | ||
| 1284 | rc = hdmi_hdcp_auth_part2_recv_ksv_fifo(hdcp_ctrl); | 1284 | rc = msm_hdmi_hdcp_auth_part2_recv_ksv_fifo(hdcp_ctrl); |
| 1285 | if (rc) { | 1285 | if (rc) { |
| 1286 | pr_err("%s: recv ksv fifo failed %d\n", __func__, rc); | 1286 | pr_err("%s: recv ksv fifo failed %d\n", __func__, rc); |
| 1287 | goto end; | 1287 | goto end; |
| 1288 | } | 1288 | } |
| 1289 | 1289 | ||
| 1290 | rc = hdmi_hdcp_auth_part2_write_ksv_fifo(hdcp_ctrl); | 1290 | rc = msm_hdmi_hdcp_auth_part2_write_ksv_fifo(hdcp_ctrl); |
| 1291 | if (rc) { | 1291 | if (rc) { |
| 1292 | pr_err("%s: write ksv fifo failed %d\n", __func__, rc); | 1292 | pr_err("%s: write ksv fifo failed %d\n", __func__, rc); |
| 1293 | goto end; | 1293 | goto end; |
| 1294 | } | 1294 | } |
| 1295 | 1295 | ||
| 1296 | rc = hdmi_hdcp_auth_part2_check_v_match(hdcp_ctrl); | 1296 | rc = msm_hdmi_hdcp_auth_part2_check_v_match(hdcp_ctrl); |
| 1297 | if (rc) | 1297 | if (rc) |
| 1298 | pr_err("%s: check v match failed %d\n", __func__, rc); | 1298 | pr_err("%s: check v match failed %d\n", __func__, rc); |
| 1299 | 1299 | ||
| @@ -1304,13 +1304,13 @@ end: · 4 unmodified lines | |||
| 1304 | pr_info("%s: hdcp is not supported\n", __func__); | 1304 | pr_info("%s: hdcp is not supported\n", __func__); |
| 1305 | } else if (rc) { | 1305 | } else if (rc) { |
| 1306 | pr_err("%s: hdcp authentication failed\n", __func__); | 1306 | pr_err("%s: hdcp authentication failed\n", __func__); |
| 1307 | hdmi_hdcp_auth_fail(hdcp_ctrl); | 1307 | msm_hdmi_hdcp_auth_fail(hdcp_ctrl); |
| 1308 | } else { | 1308 | } else { |
| 1309 | hdmi_hdcp_auth_done(hdcp_ctrl); | 1309 | msm_hdmi_hdcp_auth_done(hdcp_ctrl); |
| 1310 | } | 1310 | } |
| 1311 | } | 1311 | } |
| 1312 | 1312 | ||
| 1313 | void hdmi_hdcp_on(struct hdmi_hdcp_ctrl *hdcp_ctrl) | 1313 | void msm_hdmi_hdcp_on(struct hdmi_hdcp_ctrl *hdcp_ctrl) |
| 1314 | { | 1314 | { |
| 1315 | struct hdmi *hdmi = hdcp_ctrl->hdmi; | 1315 | struct hdmi *hdmi = hdcp_ctrl->hdmi; |
| 1316 | u32 reg_val; | 1316 | u32 reg_val; |
| @@ -1335,7 +1335,7 @@ void hdmi_hdcp_on(struct hdmi_hdcp_ctrl *hdcp_ctrl) · 18 unmodified lines | |||
| 1335 | queue_work(hdmi->workq, &hdcp_ctrl->hdcp_auth_work); | 1335 | queue_work(hdmi->workq, &hdcp_ctrl->hdcp_auth_work); |
| 1336 | } | 1336 | } |
| 1337 | 1337 | ||
| 1338 | void hdmi_hdcp_off(struct hdmi_hdcp_ctrl *hdcp_ctrl) | 1338 | void msm_hdmi_hdcp_off(struct hdmi_hdcp_ctrl *hdcp_ctrl) |
| 1339 | { | 1339 | { |
| 1340 | struct hdmi *hdmi = hdcp_ctrl->hdmi; | 1340 | struct hdmi *hdmi = hdcp_ctrl->hdmi; |
| 1341 | unsigned long flags; | 1341 | unsigned long flags; |
| @@ -1399,7 +1399,7 @@ void hdmi_hdcp_off(struct hdmi_hdcp_ctrl *hdcp_ctrl) · 57 unmodified lines | |||
| 1399 | DBG("HDCP: Off"); | 1399 | DBG("HDCP: Off"); |
| 1400 | } | 1400 | } |
| 1401 | 1401 | ||
| 1402 | struct hdmi_hdcp_ctrl *hdmi_hdcp_init(struct hdmi *hdmi) | 1402 | struct hdmi_hdcp_ctrl *msm_hdmi_hdcp_init(struct hdmi *hdmi) |
| 1403 | { | 1403 | { |
| 1404 | struct hdmi_hdcp_ctrl *hdcp_ctrl = NULL; | 1404 | struct hdmi_hdcp_ctrl *hdcp_ctrl = NULL; |
| 1405 | 1405 | ||
| @@ -1413,8 +1413,8 @@ struct hdmi_hdcp_ctrl *hdmi_hdcp_init(struct hdmi *hdmi) · 7 unmodified lines | |||
| 1413 | if (!hdcp_ctrl) | 1413 | if (!hdcp_ctrl) |
| 1414 | return ERR_PTR(-ENOMEM); | 1414 | return ERR_PTR(-ENOMEM); |
| 1415 | 1415 | ||
| 1416 | INIT_WORK(&hdcp_ctrl->hdcp_auth_work, hdmi_hdcp_auth_work); | 1416 | INIT_WORK(&hdcp_ctrl->hdcp_auth_work, msm_hdmi_hdcp_auth_work); |
| 1417 | INIT_WORK(&hdcp_ctrl->hdcp_reauth_work, hdmi_hdcp_reauth_work); | 1417 | INIT_WORK(&hdcp_ctrl->hdcp_reauth_work, msm_hdmi_hdcp_reauth_work); |
| 1418 | init_waitqueue_head(&hdcp_ctrl->auth_event_queue); | 1418 | init_waitqueue_head(&hdcp_ctrl->auth_event_queue); |
| 1419 | hdcp_ctrl->hdmi = hdmi; | 1419 | hdcp_ctrl->hdmi = hdmi; |
| 1420 | hdcp_ctrl->hdcp_state = HDCP_STATE_INACTIVE; | 1420 | hdcp_ctrl->hdcp_state = HDCP_STATE_INACTIVE; |
| @@ -1428,7 +1428,7 @@ struct hdmi_hdcp_ctrl *hdmi_hdcp_init(struct hdmi *hdmi) · 7 unmodified lines | |||
| 1428 | return hdcp_ctrl; | 1428 | return hdcp_ctrl; |
| 1429 | } | 1429 | } |
| 1430 | 1430 | ||
| 1431 | void hdmi_hdcp_destroy(struct hdmi *hdmi) | 1431 | void msm_hdmi_hdcp_destroy(struct hdmi *hdmi) |
| 1432 | { | 1432 | { |
| 1433 | if (hdmi && hdmi->hdcp_ctrl) { | 1433 | if (hdmi && hdmi->hdcp_ctrl) { |
| 1434 | kfree(hdmi->hdcp_ctrl); | 1434 | kfree(hdmi->hdcp_ctrl); |
| @@ -97,7 +97,7 @@ static bool sw_done(struct hdmi_i2c_adapter *hdmi_i2c) · 96 unmodified lines | |||
| 97 | return hdmi_i2c->sw_done; | 97 | return hdmi_i2c->sw_done; |
| 98 | } | 98 | } |
| 99 | 99 | ||
| 100 | static int hdmi_i2c_xfer(struct i2c_adapter *i2c, | 100 | static int msm_hdmi_i2c_xfer(struct i2c_adapter *i2c, |
| 101 | struct i2c_msg *msgs, int num) | 101 | struct i2c_msg *msgs, int num) |
| 102 | { | 102 | { |
| 103 | struct hdmi_i2c_adapter *hdmi_i2c = to_hdmi_i2c_adapter(i2c); | 103 | struct hdmi_i2c_adapter *hdmi_i2c = to_hdmi_i2c_adapter(i2c); |
| @@ -216,17 +216,17 @@ static int hdmi_i2c_xfer(struct i2c_adapter *i2c, · 112 unmodified lines | |||
| 216 | return i; | 216 | return i; |
| 217 | } | 217 | } |
| 218 | 218 | ||
| 219 | static u32 hdmi_i2c_func(struct i2c_adapter *adapter) | 219 | static u32 msm_hdmi_i2c_func(struct i2c_adapter *adapter) |
| 220 | { | 220 | { |
| 221 | return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL; | 221 | return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL; |
| 222 | } | 222 | } |
| 223 | 223 | ||
| 224 | static const struct i2c_algorithm hdmi_i2c_algorithm = { | 224 | static const struct i2c_algorithm msm_hdmi_i2c_algorithm = { |
| 225 | .master_xfer = hdmi_i2c_xfer, | 225 | .master_xfer = msm_hdmi_i2c_xfer, |
| 226 | .functionality = hdmi_i2c_func, | 226 | .functionality = msm_hdmi_i2c_func, |
| 227 | }; | 227 | }; |
| 228 | 228 | ||
| 229 | void hdmi_i2c_irq(struct i2c_adapter *i2c) | 229 | void msm_hdmi_i2c_irq(struct i2c_adapter *i2c) |
| 230 | { | 230 | { |
| 231 | struct hdmi_i2c_adapter *hdmi_i2c = to_hdmi_i2c_adapter(i2c); | 231 | struct hdmi_i2c_adapter *hdmi_i2c = to_hdmi_i2c_adapter(i2c); |
| 232 | 232 | ||
| @@ -234,14 +234,14 @@ void hdmi_i2c_irq(struct i2c_adapter *i2c) · 1 unmodified line | |||
| 234 | wake_up_all(&hdmi_i2c->ddc_event); | 234 | wake_up_all(&hdmi_i2c->ddc_event); |
| 235 | } | 235 | } |
| 236 | 236 | ||
| 237 | void hdmi_i2c_destroy(struct i2c_adapter *i2c) | 237 | void msm_hdmi_i2c_destroy(struct i2c_adapter *i2c) |
| 238 | { | 238 | { |
| 239 | struct hdmi_i2c_adapter *hdmi_i2c = to_hdmi_i2c_adapter(i2c); | 239 | struct hdmi_i2c_adapter *hdmi_i2c = to_hdmi_i2c_adapter(i2c); |
| 240 | i2c_del_adapter(i2c); | 240 | i2c_del_adapter(i2c); |
| 241 | kfree(hdmi_i2c); | 241 | kfree(hdmi_i2c); |
| 242 | } | 242 | } |
| 243 | 243 | ||
| 244 | struct i2c_adapter *hdmi_i2c_init(struct hdmi *hdmi) | 244 | struct i2c_adapter *msm_hdmi_i2c_init(struct hdmi *hdmi) |
| 245 | { | 245 | { |
| 246 | struct drm_device *dev = hdmi->dev; | 246 | struct drm_device *dev = hdmi->dev; |
| 247 | struct hdmi_i2c_adapter *hdmi_i2c; | 247 | struct hdmi_i2c_adapter *hdmi_i2c; |
| @@ -264,7 +264,7 @@ struct i2c_adapter *hdmi_i2c_init(struct hdmi *hdmi) · 16 unmodified lines | |||
| 264 | i2c->class = I2C_CLASS_DDC; | 264 | i2c->class = I2C_CLASS_DDC; |
| 265 | snprintf(i2c->name, sizeof(i2c->name), "msm hdmi i2c"); | 265 | snprintf(i2c->name, sizeof(i2c->name), "msm hdmi i2c"); |
| 266 | i2c->dev.parent = &hdmi->pdev->dev; | 266 | i2c->dev.parent = &hdmi->pdev->dev; |
| 267 | i2c->algo = &hdmi_i2c_algorithm; | 267 | i2c->algo = &msm_hdmi_i2c_algorithm; |
| 268 | 268 | ||
| 269 | ret = i2c_add_adapter(i2c); | 269 | ret = i2c_add_adapter(i2c); |
| 270 | if (ret) { | 270 | if (ret) { |
| @@ -276,6 +276,6 @@ struct i2c_adapter *hdmi_i2c_init(struct hdmi *hdmi) · 5 unmodified lines | |||
| 276 | 276 | ||
| 277 | fail: | 277 | fail: |
| 278 | if (i2c) | 278 | if (i2c) |
| 279 | hdmi_i2c_destroy(i2c); | 279 | msm_hdmi_i2c_destroy(i2c); |
| 280 | return ERR_PTR(ret); | 280 | return ERR_PTR(ret); |
| 281 | } | 281 | } |
| @@ -15,7 +15,7 @@ · 14 unmodified lines | |||
| 15 | 15 | ||
| 16 | #include "hdmi.h" | 16 | #include "hdmi.h" |
| 17 | 17 | ||
| 18 | static int hdmi_phy_resource_init(struct hdmi_phy *phy) | 18 | static int msm_hdmi_phy_resource_init(struct hdmi_phy *phy) |
| 19 | { | 19 | { |
| 20 | struct hdmi_phy_cfg *cfg = phy->cfg; | 20 | struct hdmi_phy_cfg *cfg = phy->cfg; |
| 21 | struct device *dev = &phy->pdev->dev; | 21 | struct device *dev = &phy->pdev->dev; |
| @@ -62,7 +62,7 @@ static int hdmi_phy_resource_init(struct hdmi_phy *phy) · 40 unmodified lines | |||
| 62 | return 0; | 62 | return 0; |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | int hdmi_phy_resource_enable(struct hdmi_phy *phy) | 65 | int msm_hdmi_phy_resource_enable(struct hdmi_phy *phy) |
| 66 | { | 66 | { |
| 67 | struct hdmi_phy_cfg *cfg = phy->cfg; | 67 | struct hdmi_phy_cfg *cfg = phy->cfg; |
| 68 | struct device *dev = &phy->pdev->dev; | 68 | struct device *dev = &phy->pdev->dev; |
| @@ -87,7 +87,7 @@ int hdmi_phy_resource_enable(struct hdmi_phy *phy) · 18 unmodified lines | |||
| 87 | return ret; | 87 | return ret; |
| 88 | } | 88 | } |
| 89 | 89 | ||
| 90 | void hdmi_phy_resource_disable(struct hdmi_phy *phy) | 90 | void msm_hdmi_phy_resource_disable(struct hdmi_phy *phy) |
| 91 | { | 91 | { |
| 92 | struct hdmi_phy_cfg *cfg = phy->cfg; | 92 | struct hdmi_phy_cfg *cfg = phy->cfg; |
| 93 | struct device *dev = &phy->pdev->dev; | 93 | struct device *dev = &phy->pdev->dev; |
| @@ -102,7 +102,7 @@ void hdmi_phy_resource_disable(struct hdmi_phy *phy) · 8 unmodified lines | |||
| 102 | pm_runtime_put_sync(dev); | 102 | pm_runtime_put_sync(dev); |
| 103 | } | 103 | } |
| 104 | 104 | ||
| 105 | void hdmi_phy_powerup(struct hdmi_phy *phy, unsigned long int pixclock) | 105 | void msm_hdmi_phy_powerup(struct hdmi_phy *phy, unsigned long int pixclock) |
| 106 | { | 106 | { |
| 107 | if (!phy || !phy->cfg->powerup) | 107 | if (!phy || !phy->cfg->powerup) |
| 108 | return; | 108 | return; |
| @@ -110,7 +110,7 @@ void hdmi_phy_powerup(struct hdmi_phy *phy, unsigned long int pixclock) · 1 unmodified line | |||
| 110 | phy->cfg->powerup(phy, pixclock); | 110 | phy->cfg->powerup(phy, pixclock); |
| 111 | } | 111 | } |
| 112 | 112 | ||
| 113 | void hdmi_phy_powerdown(struct hdmi_phy *phy) | 113 | void msm_hdmi_phy_powerdown(struct hdmi_phy *phy) |
| 114 | { | 114 | { |
| 115 | if (!phy || !phy->cfg->powerdown) | 115 | if (!phy || !phy->cfg->powerdown) |
| 116 | return; | 116 | return; |
| @@ -118,17 +118,17 @@ void hdmi_phy_powerdown(struct hdmi_phy *phy) · 1 unmodified line | |||
| 118 | phy->cfg->powerdown(phy); | 118 | phy->cfg->powerdown(phy); |
| 119 | } | 119 | } |
| 120 | 120 | ||
| 121 | static int hdmi_phy_pll_init(struct platform_device *pdev, | 121 | static int msm_hdmi_phy_pll_init(struct platform_device *pdev, |
| 122 | enum hdmi_phy_type type) | 122 | enum hdmi_phy_type type) |
| 123 | { | 123 | { |
| 124 | int ret; | 124 | int ret; |
| 125 | 125 | ||
| 126 | switch (type) { | 126 | switch (type) { |
| 127 | case MSM_HDMI_PHY_8960: | 127 | case MSM_HDMI_PHY_8960: |
| 128 | ret = hdmi_pll_8960_init(pdev); | 128 | ret = msm_hdmi_pll_8960_init(pdev); |
| 129 | break; | 129 | break; |
| 130 | case MSM_HDMI_PHY_8996: | 130 | case MSM_HDMI_PHY_8996: |
| 131 | ret = hdmi_pll_8996_init(pdev); | 131 | ret = msm_hdmi_pll_8996_init(pdev); |
| 132 | break; | 132 | break; |
| 133 | /* | 133 | /* |
| 134 | * we don't have PLL support for these, don't report an error for now | 134 | * we don't have PLL support for these, don't report an error for now |
| @@ -143,7 +143,7 @@ static int hdmi_phy_pll_init(struct platform_device *pdev, · 8 unmodified lines | |||
| 143 | return ret; | 143 | return ret; |
| 144 | } | 144 | } |
| 145 | 145 | ||
| 146 | static int hdmi_phy_probe(struct platform_device *pdev) | 146 | static int msm_hdmi_phy_probe(struct platform_device *pdev) |
| 147 | { | 147 | { |
| 148 | struct device *dev = &pdev->dev; | 148 | struct device *dev = &pdev->dev; |
| 149 | struct hdmi_phy *phy; | 149 | struct hdmi_phy *phy; |
| @@ -165,66 +165,66 @@ static int hdmi_phy_probe(struct platform_device *pdev) · 15 unmodified lines | |||
| 165 | 165 | ||
| 166 | phy->pdev = pdev; | 166 | phy->pdev = pdev; |
| 167 | 167 | ||
| 168 | ret = hdmi_phy_resource_init(phy); | 168 | ret = msm_hdmi_phy_resource_init(phy); |
| 169 | if (ret) | 169 | if (ret) |
| 170 | return ret; | 170 | return ret; |
| 171 | 171 | ||
| 172 | pm_runtime_enable(&pdev->dev); | 172 | pm_runtime_enable(&pdev->dev); |
| 173 | 173 | ||
| 174 | ret = hdmi_phy_resource_enable(phy); | 174 | ret = msm_hdmi_phy_resource_enable(phy); |
| 175 | if (ret) | 175 | if (ret) |
| 176 | return ret; | 176 | return ret; |
| 177 | 177 | ||
| 178 | ret = hdmi_phy_pll_init(pdev, phy->cfg->type); | 178 | ret = msm_hdmi_phy_pll_init(pdev, phy->cfg->type); |
| 179 | if (ret) { | 179 | if (ret) { |
| 180 | dev_err(dev, "couldn't init PLL\n"); | 180 | dev_err(dev, "couldn't init PLL\n"); |
| 181 | hdmi_phy_resource_disable(phy); | 181 | msm_hdmi_phy_resource_disable(phy); |
| 182 | return ret; | 182 | return ret; |
| 183 | } | 183 | } |
| 184 | 184 | ||
| 185 | hdmi_phy_resource_disable(phy); | 185 | msm_hdmi_phy_resource_disable(phy); |
| 186 | 186 | ||
| 187 | platform_set_drvdata(pdev, phy); | 187 | platform_set_drvdata(pdev, phy); |
| 188 | 188 | ||
| 189 | return 0; | 189 | return 0; |
| 190 | } | 190 | } |
| 191 | 191 | ||
| 192 | static int hdmi_phy_remove(struct platform_device *pdev) | 192 | static int msm_hdmi_phy_remove(struct platform_device *pdev) |
| 193 | { | 193 | { |
| 194 | pm_runtime_disable(&pdev->dev); | 194 | pm_runtime_disable(&pdev->dev); |
| 195 | 195 | ||
| 196 | return 0; | 196 | return 0; |
| 197 | } | 197 | } |
| 198 | 198 | ||
| 199 | static const struct of_device_id hdmi_phy_dt_match[] = { | 199 | static const struct of_device_id msm_hdmi_phy_dt_match[] = { |
| 200 | { .compatible = "qcom,hdmi-phy-8660", | 200 | { .compatible = "qcom,hdmi-phy-8660", |
| 201 | .data = &hdmi_phy_8x60_cfg }, | 201 | .data = &msm_hdmi_phy_8x60_cfg }, |
| 202 | { .compatible = "qcom,hdmi-phy-8960", | 202 | { .compatible = "qcom,hdmi-phy-8960", |
| 203 | .data = &hdmi_phy_8960_cfg }, | 203 | .data = &msm_hdmi_phy_8960_cfg }, |
| 204 | { .compatible = "qcom,hdmi-phy-8974", | 204 | { .compatible = "qcom,hdmi-phy-8974", |
| 205 | .data = &hdmi_phy_8x74_cfg }, | 205 | .data = &msm_hdmi_phy_8x74_cfg }, |
| 206 | { .compatible = "qcom,hdmi-phy-8084", | 206 | { .compatible = "qcom,hdmi-phy-8084", |
| 207 | .data = &hdmi_phy_8x74_cfg }, | 207 | .data = &msm_hdmi_phy_8x74_cfg }, |
| 208 | { .compatible = "qcom,hdmi-phy-8996", | 208 | { .compatible = "qcom,hdmi-phy-8996", |
| 209 | .data = &hdmi_phy_8996_cfg }, | 209 | .data = &msm_hdmi_phy_8996_cfg }, |
| 210 | {} | 210 | {} |
| 211 | }; | 211 | }; |
| 212 | 212 | ||
| 213 | static struct platform_driver hdmi_phy_platform_driver = { | 213 | static struct platform_driver msm_hdmi_phy_platform_driver = { |
| 214 | .probe = hdmi_phy_probe, | 214 | .probe = msm_hdmi_phy_probe, |
| 215 | .remove = hdmi_phy_remove, | 215 | .remove = msm_hdmi_phy_remove, |
| 216 | .driver = { | 216 | .driver = { |
| 217 | .name = "msm_hdmi_phy", | 217 | .name = "msm_hdmi_phy", |
| 218 | .of_match_table = hdmi_phy_dt_match, | 218 | .of_match_table = msm_hdmi_phy_dt_match, |
| 219 | }, | 219 | }, |
| 220 | }; | 220 | }; |
| 221 | 221 | ||
| 222 | void __init hdmi_phy_driver_register(void) | 222 | void __init msm_hdmi_phy_driver_register(void) |
| 223 | { | 223 | { |
| 224 | platform_driver_register(&hdmi_phy_platform_driver); | 224 | platform_driver_register(&msm_hdmi_phy_platform_driver); |
| 225 | } | 225 | } |
| 226 | 226 | ||
| 227 | void __exit hdmi_phy_driver_unregister(void) | 227 | void __exit msm_hdmi_phy_driver_unregister(void) |
| 228 | { | 228 | { |
| 229 | platform_driver_unregister(&hdmi_phy_platform_driver); | 229 | platform_driver_unregister(&msm_hdmi_phy_platform_driver); |
| 230 | } | 230 | } |
| @@ -51,7 +51,7 @@ static const char * const hdmi_phy_8960_clk_names[] = { · 50 unmodified lines | |||
| 51 | "slave_iface_clk", | 51 | "slave_iface_clk", |
| 52 | }; | 52 | }; |
| 53 | 53 | ||
| 54 | const struct hdmi_phy_cfg hdmi_phy_8960_cfg = { | 54 | const struct hdmi_phy_cfg msm_hdmi_phy_8960_cfg = { |
| 55 | .type = MSM_HDMI_PHY_8960, | 55 | .type = MSM_HDMI_PHY_8960, |
| 56 | .powerup = hdmi_phy_8960_powerup, | 56 | .powerup = hdmi_phy_8960_powerup, |
| 57 | .powerdown = hdmi_phy_8960_powerdown, | 57 | .powerdown = hdmi_phy_8960_powerdown, |
| @@ -704,7 +704,7 @@ static struct clk_init_data pll_init = { · 703 unmodified lines | |||
| 704 | .num_parents = ARRAY_SIZE(hdmi_pll_parents), | 704 | .num_parents = ARRAY_SIZE(hdmi_pll_parents), |
| 705 | }; | 705 | }; |
| 706 | 706 | ||
| 707 | int hdmi_pll_8996_init(struct platform_device *pdev) | 707 | int msm_hdmi_pll_8996_init(struct platform_device *pdev) |
| 708 | { | 708 | { |
| 709 | struct device *dev = &pdev->dev; | 709 | struct device *dev = &pdev->dev; |
| 710 | struct hdmi_pll_8996 *pll; | 710 | struct hdmi_pll_8996 *pll; |
| @@ -757,7 +757,7 @@ static const char * const hdmi_phy_8996_clk_names[] = { · 46 unmodified lines | |||
| 757 | "ref_clk", | 757 | "ref_clk", |
| 758 | }; | 758 | }; |
| 759 | 759 | ||
| 760 | const struct hdmi_phy_cfg hdmi_phy_8996_cfg = { | 760 | const struct hdmi_phy_cfg msm_hdmi_phy_8996_cfg = { |
| 761 | .type = MSM_HDMI_PHY_8996, | 761 | .type = MSM_HDMI_PHY_8996, |
| 762 | .reg_names = hdmi_phy_8996_reg_names, | 762 | .reg_names = hdmi_phy_8996_reg_names, |
| 763 | .num_regs = ARRAY_SIZE(hdmi_phy_8996_reg_names), | 763 | .num_regs = ARRAY_SIZE(hdmi_phy_8996_reg_names), |
| @@ -131,7 +131,7 @@ static void hdmi_phy_8x60_powerdown(struct hdmi_phy *phy) · 130 unmodified lines | |||
| 131 | HDMI_8x60_PHY_REG2_PD_DESER); | 131 | HDMI_8x60_PHY_REG2_PD_DESER); |
| 132 | } | 132 | } |
| 133 | 133 | ||
| 134 | const struct hdmi_phy_cfg hdmi_phy_8x60_cfg = { | 134 | const struct hdmi_phy_cfg msm_hdmi_phy_8x60_cfg = { |
| 135 | .type = MSM_HDMI_PHY_8x60, | 135 | .type = MSM_HDMI_PHY_8x60, |
| 136 | .powerup = hdmi_phy_8x60_powerup, | 136 | .powerup = hdmi_phy_8x60_powerup, |
| 137 | .powerdown = hdmi_phy_8x60_powerdown, | 137 | .powerdown = hdmi_phy_8x60_powerdown, |
| @@ -45,7 +45,7 @@ static const char * const hdmi_phy_8x74_clk_names[] = { · 44 unmodified lines | |||
| 45 | "alt_iface_clk" | 45 | "alt_iface_clk" |
| 46 | }; | 46 | }; |
| 47 | 47 | ||
| 48 | const struct hdmi_phy_cfg hdmi_phy_8x74_cfg = { | 48 | const struct hdmi_phy_cfg msm_hdmi_phy_8x74_cfg = { |
| 49 | .type = MSM_HDMI_PHY_8x74, | 49 | .type = MSM_HDMI_PHY_8x74, |
| 50 | .powerup = hdmi_phy_8x74_powerup, | 50 | .powerup = hdmi_phy_8x74_powerup, |
| 51 | .powerdown = hdmi_phy_8x74_powerdown, | 51 | .powerdown = hdmi_phy_8x74_powerdown, |
| @@ -426,7 +426,7 @@ static struct clk_init_data pll_init = { · 425 unmodified lines | |||
| 426 | .num_parents = ARRAY_SIZE(hdmi_pll_parents), | 426 | .num_parents = ARRAY_SIZE(hdmi_pll_parents), |
| 427 | }; | 427 | }; |
| 428 | 428 | ||
| 429 | int hdmi_pll_8960_init(struct platform_device *pdev) | 429 | int msm_hdmi_pll_8960_init(struct platform_device *pdev) |
| 430 | { | 430 | { |
| 431 | struct device *dev = &pdev->dev; | 431 | struct device *dev = &pdev->dev; |
| 432 | struct hdmi_pll_8960 *pll; | 432 | struct hdmi_pll_8960 *pll; |
| @@ -326,7 +326,7 @@ static int mdp4_modeset_init_intf(struct mdp4_kms *mdp4_kms, · 325 unmodified lines | |||
| 326 | 326 | ||
| 327 | if (priv->hdmi) { | 327 | if (priv->hdmi) { |
| 328 | /* Construct bridge/connector for HDMI: */ | 328 | /* Construct bridge/connector for HDMI: */ |
| 329 | ret = hdmi_modeset_init(priv->hdmi, dev, encoder); | 329 | ret = msm_hdmi_modeset_init(priv->hdmi, dev, encoder); |
| 330 | if (ret) { | 330 | if (ret) { |
| 331 | dev_err(dev->dev, "failed to initialize HDMI: %d\n", ret); | 331 | dev_err(dev->dev, "failed to initialize HDMI: %d\n", ret); |
| 332 | return ret; | 332 | return ret; |
| @@ -284,7 +284,7 @@ static int modeset_init_intf(struct mdp5_kms *mdp5_kms, int intf_num) · 283 unmodified lines | |||
| 284 | break; | 284 | break; |
| 285 | } | 285 | } |
| 286 | 286 | ||
| 287 | ret = hdmi_modeset_init(priv->hdmi, dev, encoder); | 287 | ret = msm_hdmi_modeset_init(priv->hdmi, dev, encoder); |
| 288 | break; | 288 | break; |
| 289 | case INTF_DSI: | 289 | case INTF_DSI: |
| 290 | { | 290 | { |
| @@ -1121,7 +1121,7 @@ static int __init msm_drm_register(void) · 1120 unmodified lines | |||
| 1121 | DBG("init"); | 1121 | DBG("init"); |
| 1122 | msm_dsi_register(); | 1122 | msm_dsi_register(); |
| 1123 | msm_edp_register(); | 1123 | msm_edp_register(); |
| 1124 | hdmi_register(); | 1124 | msm_hdmi_register(); |
| 1125 | adreno_register(); | 1125 | adreno_register(); |
| 1126 | return platform_driver_register(&msm_platform_driver); | 1126 | return platform_driver_register(&msm_platform_driver); |
| 1127 | } | 1127 | } |
| @@ -1130,7 +1130,7 @@ static void __exit msm_drm_unregister(void) · 2 unmodified lines | |||
| 1130 | { | 1130 | { |
| 1131 | DBG("fini"); | 1131 | DBG("fini"); |
| 1132 | platform_driver_unregister(&msm_platform_driver); | 1132 | platform_driver_unregister(&msm_platform_driver); |
| 1133 | hdmi_unregister(); | 1133 | msm_hdmi_unregister(); |
| 1134 | adreno_unregister(); | 1134 | adreno_unregister(); |
| 1135 | msm_edp_unregister(); | 1135 | msm_edp_unregister(); |
| 1136 | msm_dsi_unregister(); | 1136 | msm_dsi_unregister(); |
| @@ -243,10 +243,10 @@ struct drm_fb_helper *msm_fbdev_init(struct drm_device *dev); · 242 unmodified lines | |||
| 243 | void msm_fbdev_free(struct drm_device *dev); | 243 | void msm_fbdev_free(struct drm_device *dev); |
| 244 | 244 | ||
| 245 | struct hdmi; | 245 | struct hdmi; |
| 246 | int hdmi_modeset_init(struct hdmi *hdmi, struct drm_device *dev, | 246 | int msm_hdmi_modeset_init(struct hdmi *hdmi, struct drm_device *dev, |
| 247 | struct drm_encoder *encoder); | 247 | struct drm_encoder *encoder); |
| 248 | void __init hdmi_register(void); | 248 | void __init msm_hdmi_register(void); |
| 249 | void __exit hdmi_unregister(void); | 249 | void __exit msm_hdmi_unregister(void); |
| 250 | 250 | ||
| 251 | struct msm_edp; | 251 | struct msm_edp; |
| 252 | void __init msm_edp_register(void); | 252 | void __init msm_edp_register(void); |