linux/drivers/gpu/drm/i915/display/intel_dsi_vbt.c

/*
 * Copyright © 2014 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.
 *
 * Author: Shobhit Kumar <[email protected]>
 *
 */

#include <linux/gpio/consumer.h>
#include <linux/gpio/machine.h>
#include <linux/mfd/intel_soc_pmic.h>
#include <linux/pinctrl/consumer.h>
#include <linux/pinctrl/machine.h>
#include <linux/slab.h>
#include <linux/string_helpers.h>

#include <linux/unaligned.h>

#include <drm/drm_crtc.h>
#include <drm/drm_edid.h>

#include <video/mipi_display.h>

#include "i915_drv.h"
#include "i915_reg.h"
#include "intel_de.h"
#include "intel_display_types.h"
#include "intel_dsi.h"
#include "intel_dsi_vbt.h"
#include "intel_gmbus_regs.h"
#include "intel_pps_regs.h"
#include "vlv_dsi.h"
#include "vlv_dsi_regs.h"
#include "vlv_sideband.h"

#define MIPI_TRANSFER_MODE_SHIFT
#define MIPI_VIRTUAL_CHANNEL_SHIFT
#define MIPI_PORT_SHIFT

struct i2c_adapter_lookup {};

#define CHV_GPIO_IDX_START_N
#define CHV_GPIO_IDX_START_E
#define CHV_GPIO_IDX_START_SW
#define CHV_GPIO_IDX_START_SE

/* ICL DSI Display GPIO Pins */
#define ICL_GPIO_DDSP_HPD_A
#define ICL_GPIO_L_VDDEN_1
#define ICL_GPIO_L_BKLTEN_1
#define ICL_GPIO_DDPA_CTRLCLK_1
#define ICL_GPIO_DDPA_CTRLDATA_1
#define ICL_GPIO_DDSP_HPD_B
#define ICL_GPIO_L_VDDEN_2
#define ICL_GPIO_L_BKLTEN_2
#define ICL_GPIO_DDPA_CTRLCLK_2
#define ICL_GPIO_DDPA_CTRLDATA_2

static enum port intel_dsi_seq_port_to_port(struct intel_dsi *intel_dsi,
					    u8 seq_port)
{}

static const u8 *mipi_exec_send_packet(struct intel_dsi *intel_dsi,
				       const u8 *data)
{}

static const u8 *mipi_exec_delay(struct intel_dsi *intel_dsi, const u8 *data)
{}

static void soc_gpio_set_value(struct intel_connector *connector, u8 gpio_index,
			       const char *con_id, u8 idx, bool value)
{}

static void soc_opaque_gpio_set_value(struct intel_connector *connector,
				      u8 gpio_index, const char *chip,
				      const char *con_id, u8 idx, bool value)
{}

static void vlv_gpio_set_value(struct intel_connector *connector,
			       u8 gpio_source, u8 gpio_index, bool value)
{}

static void chv_gpio_set_value(struct intel_connector *connector,
			       u8 gpio_source, u8 gpio_index, bool value)
{}

static void bxt_gpio_set_value(struct intel_connector *connector,
			       u8 gpio_index, bool value)
{}

enum {};

static void icl_native_gpio_set_value(struct drm_i915_private *dev_priv,
				      int gpio, bool value)
{}

static const u8 *mipi_exec_gpio(struct intel_dsi *intel_dsi, const u8 *data)
{}

#ifdef CONFIG_ACPI
static int i2c_adapter_lookup(struct acpi_resource *ares, void *data)
{}

static void i2c_acpi_find_adapter(struct intel_dsi *intel_dsi,
				  const u16 target_addr)
{}
#else
static inline void i2c_acpi_find_adapter(struct intel_dsi *intel_dsi,
					 const u16 target_addr)
{
}
#endif

static const u8 *mipi_exec_i2c(struct intel_dsi *intel_dsi, const u8 *data)
{}

static const u8 *mipi_exec_spi(struct intel_dsi *intel_dsi, const u8 *data)
{}

static const u8 *mipi_exec_pmic(struct intel_dsi *intel_dsi, const u8 *data)
{}

fn_mipi_elem_exec;
static const fn_mipi_elem_exec exec_elem[] =;

/*
 * MIPI Sequence from VBT #53 parsing logic
 * We have already separated each seqence during bios parsing
 * Following is generic execution function for any sequence
 */

static const char * const seq_name[] =;

static const char *sequence_name(enum mipi_seq seq_id)
{}

static void intel_dsi_vbt_exec(struct intel_dsi *intel_dsi,
			       enum mipi_seq seq_id)
{}

void intel_dsi_vbt_exec_sequence(struct intel_dsi *intel_dsi,
				 enum mipi_seq seq_id)
{}

void intel_dsi_log_params(struct intel_dsi *intel_dsi)
{}

bool intel_dsi_vbt_init(struct intel_dsi *intel_dsi, u16 panel_id)
{}

/*
 * On some BYT/CHT devs some sequences are incomplete and we need to manually
 * control some GPIOs. We need to add a GPIO lookup table before we get these.
 * If the GOP did not initialize the panel (HDMI inserted) we may need to also
 * change the pinmux for the SoC's PWM0 pin from GPIO to PWM.
 */
static struct gpiod_lookup_table pmic_panel_gpio_table =;

static struct gpiod_lookup_table soc_panel_gpio_table =;

static const struct pinctrl_map soc_pwm_pinctrl_map[] =;

void intel_dsi_vbt_gpio_init(struct intel_dsi *intel_dsi, bool panel_is_on)
{}