linux/drivers/gpu/drm/gma500/psb_intel_lvds.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright © 2006-2007 Intel Corporation
 *
 * Authors:
 *	Eric Anholt <[email protected]>
 *	Dave Airlie <[email protected]>
 *	Jesse Barnes <[email protected]>
 */

#include <linux/i2c.h>
#include <linux/pm_runtime.h>

#include <drm/drm_crtc_helper.h>
#include <drm/drm_modeset_helper_vtables.h>
#include <drm/drm_simple_kms_helper.h>

#include "intel_bios.h"
#include "power.h"
#include "psb_drv.h"
#include "psb_intel_drv.h"
#include "psb_intel_reg.h"

/*
 * LVDS I2C backlight control macros
 */
#define BRIGHTNESS_MAX_LEVEL
#define BRIGHTNESS_MASK
#define BLC_I2C_TYPE
#define BLC_PWM_TYPT

#define BLC_POLARITY_NORMAL
#define BLC_POLARITY_INVERSE

#define PSB_BLC_MAX_PWM_REG_FREQ
#define PSB_BLC_MIN_PWM_REG_FREQ
#define PSB_BLC_PWM_PRECISION_FACTOR
#define PSB_BACKLIGHT_PWM_CTL_SHIFT
#define PSB_BACKLIGHT_PWM_POLARITY_BIT_CLEAR

struct psb_intel_lvds_priv {};


/*
 * Returns the maximum level of the backlight duty cycle field.
 */
static u32 psb_intel_lvds_get_max_backlight(struct drm_device *dev)
{}

/*
 * Set LVDS backlight level by I2C command
 *
 * FIXME: at some point we need to both track this for PM and also
 * disable runtime pm on MRST if the brightness is nil (ie blanked)
 */
static int psb_lvds_i2c_set_brightness(struct drm_device *dev,
					unsigned int level)
{}


static int psb_lvds_pwm_set_brightness(struct drm_device *dev, int level)
{}

/*
 * Set LVDS backlight level either by I2C or PWM
 */
void psb_intel_lvds_set_brightness(struct drm_device *dev, int level)
{}

/*
 * Sets the backlight level.
 *
 * level: backlight level, from 0 to psb_intel_lvds_get_max_backlight().
 */
static void psb_intel_lvds_set_backlight(struct drm_device *dev, int level)
{}

/*
 * Sets the power state for the panel.
 */
static void psb_intel_lvds_set_power(struct drm_device *dev, bool on)
{}

static void psb_intel_lvds_encoder_dpms(struct drm_encoder *encoder, int mode)
{}

static void psb_intel_lvds_save(struct drm_connector *connector)
{}

static void psb_intel_lvds_restore(struct drm_connector *connector)
{}

enum drm_mode_status psb_intel_lvds_mode_valid(struct drm_connector *connector,
				 struct drm_display_mode *mode)
{}

bool psb_intel_lvds_mode_fixup(struct drm_encoder *encoder,
				  const struct drm_display_mode *mode,
				  struct drm_display_mode *adjusted_mode)
{}

static void psb_intel_lvds_prepare(struct drm_encoder *encoder)
{}

static void psb_intel_lvds_commit(struct drm_encoder *encoder)
{}

static void psb_intel_lvds_mode_set(struct drm_encoder *encoder,
				struct drm_display_mode *mode,
				struct drm_display_mode *adjusted_mode)
{}

/*
 * Return the list of DDC modes if available, or the BIOS fixed mode otherwise.
 */
static int psb_intel_lvds_get_modes(struct drm_connector *connector)
{}

void psb_intel_lvds_destroy(struct drm_connector *connector)
{}

int psb_intel_lvds_set_property(struct drm_connector *connector,
				       struct drm_property *property,
				       uint64_t value)
{}

static const struct drm_encoder_helper_funcs psb_intel_lvds_helper_funcs =;

const struct drm_connector_helper_funcs
				psb_intel_lvds_connector_helper_funcs =;

const struct drm_connector_funcs psb_intel_lvds_connector_funcs =;

/**
 * psb_intel_lvds_init - setup LVDS connectors on this device
 * @dev: drm device
 * @mode_dev: mode device
 *
 * Create the connector, register the LVDS DDC bus, and try to figure out what
 * modes we can display on the LVDS panel (if present).
 */
void psb_intel_lvds_init(struct drm_device *dev,
			 struct psb_intel_mode_device *mode_dev)
{}