[Intel-gfx] [PATCH 06/12] drm/i915: Add new lspcon file

Ville Syrjälä ville.syrjala at linux.intel.com
Mon May 2 13:37:13 UTC 2016


On Mon, Apr 04, 2016 at 05:31:42PM +0530, Shashank Sharma wrote:
> This patch adds a new file for lspcon with
> some basic stuff like:
> - Some read/wrire addresses for lspcon device
> - Basic read/write functions, using i2c over aux channel
> - Utility functions to get lspcon/encoder/connector
> 
> Signed-off-by: Shashank Sharma <shashank.sharma at intel.com>
> Signed-off-by: Akashdeep Sharma <akashdeep.sharma at intel.com>
> ---
>  drivers/gpu/drm/i915/Makefile       |  3 +-
>  drivers/gpu/drm/i915/intel_lspcon.c | 56 +++++++++++++++++++++++++++++++++++++
>  2 files changed, 58 insertions(+), 1 deletion(-)
>  create mode 100644 drivers/gpu/drm/i915/intel_lspcon.c
> 
> diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
> index 5558a03..00a531a 100644
> --- a/drivers/gpu/drm/i915/Makefile
> +++ b/drivers/gpu/drm/i915/Makefile
> @@ -90,7 +90,8 @@ i915-y += dvo_ch7017.o \
>  	  intel_lvds.o \
>  	  intel_panel.o \
>  	  intel_sdvo.o \
> -	  intel_tv.o
> +	  intel_tv.o \
> +	  intel_lspcon.o
>  
>  # virtual gpu code
>  i915-y += i915_vgpu.o
> diff --git a/drivers/gpu/drm/i915/intel_lspcon.c b/drivers/gpu/drm/i915/intel_lspcon.c
> new file mode 100644
> index 0000000..5a1993b
> --- /dev/null
> +++ b/drivers/gpu/drm/i915/intel_lspcon.c
> @@ -0,0 +1,56 @@
> +/*
> + * Copyright © 2016 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
> + * DEALINGS IN THE SOFTWARE.
> + *
> + * Authors:
> + * Shashank Sharma <shashank.sharma at intel.com>
> + * Akashdeep Sharma <akashdeep.sharma at intel.com>
> + *
> + */
> +#include <drm/drm_edid.h>
> +#include <drm/drm_atomic_helper.h>
> +#include <drm/drm_dp_dual_mode_helper.h>
> +#include "intel_drv.h"
> +
> +#define LSPCON_I2C_ADDRESS			0x80
> +#define LSPCON_MODE_CHANGE_OFFSET		0x40
> +#define LSPCON_MODE_CHECK_OFFSET		0x41
> +#define LSPCON_ADAPTER_SIGN_OFFSET		0x00
> +#define LSPCON_IDENTIFIER_OFFSET		0x10
> +#define LSPCON_IDENTIFIER_LENGTH		0x10
> +#define LSPCON_MODE_MASK			0x1

Bunch of these seem like duplicates of the dp++ stuff.

> +
> +struct intel_digital_port *lspcon_to_dig_port(struct intel_lspcon *lspcon)
> +{
> +	return container_of(lspcon, struct intel_digital_port, lspcon);
> +}
> +
> +struct intel_hdmi *lspcon_to_hdmi(struct intel_lspcon *lspcon)
> +{
> +	return &lspcon_to_dig_port(lspcon)->hdmi;
> +}
> +
> +struct intel_lspcon *enc_to_lspcon(struct drm_encoder *encoder)
> +{
> +	struct intel_digital_port *intel_dig_port =
> +		container_of(encoder, struct intel_digital_port, base.base);
> +	return &intel_dig_port->lspcon;
> +}
> -- 
> 1.9.1

-- 
Ville Syrjälä
Intel OTC


More information about the Intel-gfx mailing list