diff options
| author | Thomas Wood <thomas.wood@intel.com> | 2014-05-29 11:57:41 -0400 |
|---|---|---|
| committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-06-19 02:55:28 -0400 |
| commit | 34ea3d386347cd6de4c2fa2491dd85c9e753e7e4 (patch) | |
| tree | 8f8f3af34e12d01b95ad15b7f0d065fe17cbd504 | |
| parent | c3e25ae34fab3557b17a585446b5576e49d2f203 (diff) | |
drm: add register and unregister functions for connectors
Introduce generic functions to register and unregister connectors. This
provides a common place to add and remove associated user space
interfaces.
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
49 files changed, 110 insertions, 82 deletions
diff --git a/Documentation/DocBook/drm.tmpl b/Documentation/DocBook/drm.tmpl index 7df3134ebc0e..b314a42bb18c 100644 --- a/Documentation/DocBook/drm.tmpl +++ b/Documentation/DocBook/drm.tmpl | |||
| @@ -1610,7 +1610,7 @@ int max_width, max_height;</synopsis> | |||
| 1610 | The connector is then registered with a call to | 1610 | The connector is then registered with a call to |
| 1611 | <function>drm_connector_init</function> with a pointer to the connector | 1611 | <function>drm_connector_init</function> with a pointer to the connector |
| 1612 | functions and a connector type, and exposed through sysfs with a call to | 1612 | functions and a connector type, and exposed through sysfs with a call to |
| 1613 | <function>drm_sysfs_connector_add</function>. | 1613 | <function>drm_connector_register</function>. |
| 1614 | </para> | 1614 | </para> |
| 1615 | <para> | 1615 | <para> |
| 1616 | Supported connector types are | 1616 | Supported connector types are |
| @@ -1768,7 +1768,7 @@ int max_width, max_height;</synopsis> | |||
| 1768 | (<function>drm_encoder_cleanup</function>) and connectors | 1768 | (<function>drm_encoder_cleanup</function>) and connectors |
| 1769 | (<function>drm_connector_cleanup</function>). Furthermore, connectors | 1769 | (<function>drm_connector_cleanup</function>). Furthermore, connectors |
| 1770 | that have been added to sysfs must be removed by a call to | 1770 | that have been added to sysfs must be removed by a call to |
| 1771 | <function>drm_sysfs_connector_remove</function> before calling | 1771 | <function>drm_connector_unregister</function> before calling |
| 1772 | <function>drm_connector_cleanup</function>. | 1772 | <function>drm_connector_cleanup</function>. |
| 1773 | </para> | 1773 | </para> |
| 1774 | <para> | 1774 | <para> |
| @@ -1813,7 +1813,7 @@ void intel_crt_init(struct drm_device *dev) | |||
| 1813 | drm_encoder_helper_add(&intel_output->enc, &intel_crt_helper_funcs); | 1813 | drm_encoder_helper_add(&intel_output->enc, &intel_crt_helper_funcs); |
| 1814 | drm_connector_helper_add(connector, &intel_crt_connector_helper_funcs); | 1814 | drm_connector_helper_add(connector, &intel_crt_connector_helper_funcs); |
| 1815 | 1815 | ||
| 1816 | drm_sysfs_connector_add(connector); | 1816 | drm_connector_register(connector); |
| 1817 | }]]></programlisting> | 1817 | }]]></programlisting> |
| 1818 | <para> | 1818 | <para> |
| 1819 | In the example above (taken from the i915 driver), a CRTC, connector and | 1819 | In the example above (taken from the i915 driver), a CRTC, connector and |
diff --git a/drivers/gpu/drm/armada/armada_output.c b/drivers/gpu/drm/armada/armada_output.c index d685a5421485..abbc309fe539 100644 --- a/drivers/gpu/drm/armada/armada_output.c +++ b/drivers/gpu/drm/armada/armada_output.c | |||
| @@ -48,7 +48,7 @@ static void armada_drm_connector_destroy(struct drm_connector *conn) | |||
| 48 | { | 48 | { |
| 49 | struct armada_connector *dconn = drm_to_armada_conn(conn); | 49 | struct armada_connector *dconn = drm_to_armada_conn(conn); |
| 50 | 50 | ||
| 51 | drm_sysfs_connector_remove(conn); | 51 | drm_connector_unregister(conn); |
| 52 | drm_connector_cleanup(conn); | 52 | drm_connector_cleanup(conn); |
| 53 | kfree(dconn); | 53 | kfree(dconn); |
| 54 | } | 54 | } |
| @@ -141,7 +141,7 @@ int armada_output_create(struct drm_device *dev, | |||
| 141 | if (ret) | 141 | if (ret) |
| 142 | goto err_conn; | 142 | goto err_conn; |
| 143 | 143 | ||
| 144 | ret = drm_sysfs_connector_add(&dconn->conn); | 144 | ret = drm_connector_register(&dconn->conn); |
| 145 | if (ret) | 145 | if (ret) |
| 146 | goto err_sysfs; | 146 | goto err_sysfs; |
| 147 | 147 | ||
diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c index 114aee941d46..9896286ed262 100644 --- a/drivers/gpu/drm/ast/ast_mode.c +++ b/drivers/gpu/drm/ast/ast_mode.c | |||
| @@ -829,7 +829,7 @@ static void ast_connector_destroy(struct drm_connector *connector) | |||
| 829 | { | 829 | { |
| 830 | struct ast_connector *ast_connector = to_ast_connector(connector); | 830 | struct ast_connector *ast_connector = to_ast_connector(connector); |
| 831 | ast_i2c_destroy(ast_connector->i2c); | 831 | ast_i2c_destroy(ast_connector->i2c); |
| 832 | drm_sysfs_connector_remove(connector); | 832 | drm_connector_unregister(connector); |
| 833 | drm_connector_cleanup(connector); | 833 | drm_connector_cleanup(connector); |
| 834 | kfree(connector); | 834 | kfree(connector); |
| 835 | } | 835 | } |
| @@ -871,7 +871,7 @@ static int ast_connector_init(struct drm_device *dev) | |||
| 871 | connector->interlace_allowed = 0; | 871 | connector->interlace_allowed = 0; |
| 872 | connector->doublescan_allowed = 0; | 872 | connector->doublescan_allowed = 0; |
| 873 | 873 | ||
| 874 | drm_sysfs_connector_add(connector); | 874 | drm_connector_register(connector); |
| 875 | 875 | ||
| 876 | connector->polled = DRM_CONNECTOR_POLL_CONNECT; | 876 | connector->polled = DRM_CONNECTOR_POLL_CONNECT; |
| 877 | 877 | ||
diff --git a/drivers/gpu/drm/bridge/ptn3460.c b/drivers/gpu/drm/bridge/ptn3460.c index 98fd17ae4916..d466696ed5e8 100644 --- a/drivers/gpu/drm/bridge/ptn3460.c +++ b/drivers/gpu/drm/bridge/ptn3460.c | |||
| @@ -328,7 +328,7 @@ int ptn3460_init(struct drm_device *dev, struct drm_encoder *encoder, | |||
| 328 | } | 328 | } |
| 329 | drm_connector_helper_add(&ptn_bridge->connector, | 329 | drm_connector_helper_add(&ptn_bridge->connector, |
| 330 | &ptn3460_connector_helper_funcs); | 330 | &ptn3460_connector_helper_funcs); |
| 331 | drm_sysfs_connector_add(&ptn_bridge->connector); | 331 | drm_connector_register(&ptn_bridge->connector); |
| 332 | drm_mode_connector_attach_encoder(&ptn_bridge->connector, encoder); | 332 | drm_mode_connector_attach_encoder(&ptn_bridge->connector, encoder); |
| 333 | 333 | ||
| 334 | return 0; | 334 | return 0; |
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index fe94cc10cd35..c50c827cefb6 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c | |||
| @@ -921,6 +921,34 @@ void drm_connector_cleanup(struct drm_connector *connector) | |||
| 921 | EXPORT_SYMBOL(drm_connector_cleanup); | 921 | EXPORT_SYMBOL(drm_connector_cleanup); |
| 922 | 922 | ||
| 923 | /** | 923 | /** |
| 924 | * drm_connector_register - register a connector | ||
