Re: [PATCH] gma500:Remove functions that are now deprecated and move to the newer functions in drm_dp_helper.c

From: Patrik Jakobsson
Date: Tue May 05 2015 - 09:06:41 EST


On Tue, May 5, 2015 at 12:29 AM, Nicholas Krause <xerofoify@xxxxxxxxx> wrote:
> This removes the deprecated functions,i2c_dp_aux_add_bus and
> i2c_dp_aux_prepare_bus and the only call in the function,
> cdv_intel_dp_i2c_init to i2c_dp_aux_add_bus respectfully.
> The call and use of these functions is now replaced alongside
> the removal of setting other values in the function,cdv_intel_dp_i2c_init
> to use the helper function, drm_dp_aux_register that can handle all this
> work internally.

You need to fill in the drm_dp_aux structure and implement a proper transfer
function. This patch would only break things. But the cdv dp output is already
broken on my system so it needs fixing first.

-Patrik

> Signed-off-by: Nicholas Krause <xerofoify@xxxxxxxxx>
> ---
> drivers/gpu/drm/gma500/cdv_intel_dp.c | 42 ++---------------------------------
> 1 file changed, 2 insertions(+), 40 deletions(-)
>
> diff --git a/drivers/gpu/drm/gma500/cdv_intel_dp.c b/drivers/gpu/drm/gma500/cdv_intel_dp.c
> index 0fafb8e..c8c20fc 100644
> --- a/drivers/gpu/drm/gma500/cdv_intel_dp.c
> +++ b/drivers/gpu/drm/gma500/cdv_intel_dp.c
> @@ -200,38 +200,6 @@ static const struct i2c_algorithm i2c_dp_aux_algo = {
> .functionality = i2c_algo_dp_aux_functionality,
> };
>
> -static void
> -i2c_dp_aux_reset_bus(struct i2c_adapter *adapter)
> -{
> - (void) i2c_algo_dp_aux_address(adapter, 0, false);
> - (void) i2c_algo_dp_aux_stop(adapter, false);
> -}
> -
> -static int
> -i2c_dp_aux_prepare_bus(struct i2c_adapter *adapter)
> -{
> - adapter->algo = &i2c_dp_aux_algo;
> - adapter->retries = 3;
> - i2c_dp_aux_reset_bus(adapter);
> - return 0;
> -}
> -
> -/*
> - * FIXME: This is the old dp aux helper, gma500 is the last driver that needs to
> - * be ported over to the new helper code in drm_dp_helper.c like i915 or radeon.
> - */
> -static int __deprecated
> -i2c_dp_aux_add_bus(struct i2c_adapter *adapter)
> -{
> - int error;
> -
> - error = i2c_dp_aux_prepare_bus(adapter);
> - if (error)
> - return error;
> - error = i2c_add_adapter(adapter);
> - return error;
> -}
> -
> #define _wait_for(COND, MS, W) ({ \
> unsigned long timeout__ = jiffies + msecs_to_jiffies(MS); \
> int ret__ = 0; \
> @@ -275,6 +243,7 @@ struct cdv_intel_dp {
> int backlight_on_delay;
> int backlight_off_delay;
> struct drm_display_mode *panel_fixed_mode; /* for eDP */
> + struct drm_dp_aux aux;
> bool panel_on;
> };
>
> @@ -855,18 +824,11 @@ cdv_intel_dp_i2c_init(struct gma_connector *connector,
> intel_dp->algo.running = false;
> intel_dp->algo.address = 0;
> intel_dp->algo.aux_ch = cdv_intel_dp_i2c_aux_ch;
> -
> memset(&intel_dp->adapter, '\0', sizeof (intel_dp->adapter));
> - intel_dp->adapter.owner = THIS_MODULE;
> - intel_dp->adapter.class = I2C_CLASS_DDC;
> - strncpy (intel_dp->adapter.name, name, sizeof(intel_dp->adapter.name) - 1);
> - intel_dp->adapter.name[sizeof(intel_dp->adapter.name) - 1] = '\0';
> - intel_dp->adapter.algo_data = &intel_dp->algo;
> - intel_dp->adapter.dev.parent = connector->base.kdev;
>
> if (is_edp(encoder))
> cdv_intel_edp_panel_vdd_on(encoder);
> - ret = i2c_dp_aux_add_bus(&intel_dp->adapter);
> + ret = drm_dp_aux_register(&intel_dp->aux);
> if (is_edp(encoder))
> cdv_intel_edp_panel_vdd_off(encoder);
>
> --
> 2.1.4
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/