.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (C) 2015 Free Electrons |
---|
3 | 4 | * Copyright (C) 2015 NextThing Co |
---|
4 | 5 | * |
---|
5 | 6 | * Maxime Ripard <maxime.ripard@free-electrons.com> |
---|
6 | | - * |
---|
7 | | - * This program is free software; you can redistribute it and/or |
---|
8 | | - * modify it under the terms of the GNU General Public License as |
---|
9 | | - * published by the Free Software Foundation; either version 2 of |
---|
10 | | - * the License, or (at your option) any later version. |
---|
11 | 7 | */ |
---|
12 | 8 | |
---|
13 | 9 | #include <linux/clk.h> |
---|
14 | 10 | #include <linux/component.h> |
---|
| 11 | +#include <linux/module.h> |
---|
15 | 12 | #include <linux/of_address.h> |
---|
| 13 | +#include <linux/platform_device.h> |
---|
16 | 14 | #include <linux/regmap.h> |
---|
17 | 15 | #include <linux/reset.h> |
---|
18 | 16 | |
---|
19 | | -#include <drm/drmP.h> |
---|
20 | 17 | #include <drm/drm_atomic_helper.h> |
---|
21 | | -#include <drm/drm_crtc_helper.h> |
---|
22 | 18 | #include <drm/drm_of.h> |
---|
23 | 19 | #include <drm/drm_panel.h> |
---|
| 20 | +#include <drm/drm_print.h> |
---|
| 21 | +#include <drm/drm_probe_helper.h> |
---|
| 22 | +#include <drm/drm_simple_kms_helper.h> |
---|
24 | 23 | |
---|
25 | 24 | #include "sun4i_crtc.h" |
---|
26 | 25 | #include "sun4i_drv.h" |
---|
.. | .. |
---|
469 | 468 | regmap_write(tv->regs, SUN4I_TVE_SLAVE_REG, 0); |
---|
470 | 469 | } |
---|
471 | 470 | |
---|
472 | | -static struct drm_encoder_helper_funcs sun4i_tv_helper_funcs = { |
---|
| 471 | +static const struct drm_encoder_helper_funcs sun4i_tv_helper_funcs = { |
---|
473 | 472 | .disable = sun4i_tv_disable, |
---|
474 | 473 | .enable = sun4i_tv_enable, |
---|
475 | 474 | .mode_set = sun4i_tv_mode_set, |
---|
476 | | -}; |
---|
477 | | - |
---|
478 | | -static void sun4i_tv_destroy(struct drm_encoder *encoder) |
---|
479 | | -{ |
---|
480 | | - drm_encoder_cleanup(encoder); |
---|
481 | | -} |
---|
482 | | - |
---|
483 | | -static struct drm_encoder_funcs sun4i_tv_funcs = { |
---|
484 | | - .destroy = sun4i_tv_destroy, |
---|
485 | 475 | }; |
---|
486 | 476 | |
---|
487 | 477 | static int sun4i_tv_comp_get_modes(struct drm_connector *connector) |
---|
.. | .. |
---|
514 | 504 | return MODE_OK; |
---|
515 | 505 | } |
---|
516 | 506 | |
---|
517 | | -static struct drm_connector_helper_funcs sun4i_tv_comp_connector_helper_funcs = { |
---|
| 507 | +static const struct drm_connector_helper_funcs sun4i_tv_comp_connector_helper_funcs = { |
---|
518 | 508 | .get_modes = sun4i_tv_comp_get_modes, |
---|
519 | 509 | .mode_valid = sun4i_tv_comp_mode_valid, |
---|
520 | 510 | }; |
---|
.. | .. |
---|
533 | 523 | .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, |
---|
534 | 524 | }; |
---|
535 | 525 | |
---|
536 | | -static struct regmap_config sun4i_tv_regmap_config = { |
---|
| 526 | +static const struct regmap_config sun4i_tv_regmap_config = { |
---|
537 | 527 | .reg_bits = 32, |
---|
538 | 528 | .val_bits = 32, |
---|
539 | 529 | .reg_stride = 4, |
---|
.. | .. |
---|
594 | 584 | |
---|
595 | 585 | drm_encoder_helper_add(&tv->encoder, |
---|
596 | 586 | &sun4i_tv_helper_funcs); |
---|
597 | | - ret = drm_encoder_init(drm, |
---|
598 | | - &tv->encoder, |
---|
599 | | - &sun4i_tv_funcs, |
---|
600 | | - DRM_MODE_ENCODER_TVDAC, |
---|
601 | | - NULL); |
---|
| 587 | + ret = drm_simple_encoder_init(drm, &tv->encoder, |
---|
| 588 | + DRM_MODE_ENCODER_TVDAC); |
---|
602 | 589 | if (ret) { |
---|
603 | 590 | dev_err(dev, "Couldn't initialise the TV encoder\n"); |
---|
604 | 591 | goto err_disable_clk; |
---|