-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The SH Mobile LCD controller (LCDC) DRM driver supports the main graphics plane in RGB and YUV formats, as well as the overlay planes (in alpha-blending mode only). Only flat panel outputs using the parallel interface are supported. Support for SYS panels, HDMI and DSI is currently not implemented. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sascha Hauer <s.hauer@pengutronix.de>
- Loading branch information
Laurent Pinchart
committed
Sep 18, 2012
1 parent
ba623f6
commit 51c1327
Showing
16 changed files
with
2,258 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
config DRM_SHMOBILE | ||
tristate "DRM Support for SH Mobile" | ||
depends on DRM && (SUPERH || ARCH_SHMOBILE) | ||
select DRM_KMS_HELPER | ||
select DRM_KMS_CMA_HELPER | ||
select DRM_GEM_CMA_HELPER | ||
help | ||
Choose this option if you have an SH Mobile chipset. | ||
If M is selected the module will be called shmob-drm. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
shmob-drm-y := shmob_drm_backlight.o \ | ||
shmob_drm_crtc.o \ | ||
shmob_drm_drv.o \ | ||
shmob_drm_kms.o \ | ||
shmob_drm_plane.o | ||
|
||
obj-$(CONFIG_DRM_SHMOBILE) += shmob-drm.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
/* | ||
* shmob_drm_backlight.c -- SH Mobile DRM Backlight | ||
* | ||
* Copyright (C) 2012 Renesas Corporation | ||
* | ||
* Laurent Pinchart (laurent.pinchart@ideasonboard.com) | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
*/ | ||
|
||
#include <linux/backlight.h> | ||
|
||
#include "shmob_drm_backlight.h" | ||
#include "shmob_drm_crtc.h" | ||
#include "shmob_drm_drv.h" | ||
|
||
static int shmob_drm_backlight_update(struct backlight_device *bdev) | ||
{ | ||
struct shmob_drm_connector *scon = bl_get_data(bdev); | ||
struct shmob_drm_device *sdev = scon->connector.dev->dev_private; | ||
const struct shmob_drm_backlight_data *bdata = &sdev->pdata->backlight; | ||
int brightness = bdev->props.brightness; | ||
|
||
if (bdev->props.power != FB_BLANK_UNBLANK || | ||
bdev->props.state & BL_CORE_SUSPENDED) | ||
brightness = 0; | ||
|
||
return bdata->set_brightness(brightness); | ||
} | ||
|
||
static int shmob_drm_backlight_get_brightness(struct backlight_device *bdev) | ||
{ | ||
struct shmob_drm_connector *scon = bl_get_data(bdev); | ||
struct shmob_drm_device *sdev = scon->connector.dev->dev_private; | ||
const struct shmob_drm_backlight_data *bdata = &sdev->pdata->backlight; | ||
|
||
return bdata->get_brightness(); | ||
} | ||
|
||
static const struct backlight_ops shmob_drm_backlight_ops = { | ||
.options = BL_CORE_SUSPENDRESUME, | ||
.update_status = shmob_drm_backlight_update, | ||
.get_brightness = shmob_drm_backlight_get_brightness, | ||
}; | ||
|
||
void shmob_drm_backlight_dpms(struct shmob_drm_connector *scon, int mode) | ||
{ | ||
if (scon->backlight == NULL) | ||
return; | ||
|
||
scon->backlight->props.power = mode == DRM_MODE_DPMS_ON | ||
? FB_BLANK_UNBLANK : FB_BLANK_POWERDOWN; | ||
backlight_update_status(scon->backlight); | ||
} | ||
|
||
int shmob_drm_backlight_init(struct shmob_drm_connector *scon) | ||
{ | ||
struct shmob_drm_device *sdev = scon->connector.dev->dev_private; | ||
const struct shmob_drm_backlight_data *bdata = &sdev->pdata->backlight; | ||
struct drm_connector *connector = &scon->connector; | ||
struct drm_device *dev = connector->dev; | ||
struct backlight_device *backlight; | ||
|
||
if (!bdata->max_brightness) | ||
return 0; | ||
|
||
backlight = backlight_device_register(bdata->name, dev->dev, scon, | ||
&shmob_drm_backlight_ops, NULL); | ||
if (IS_ERR(backlight)) { | ||
dev_err(dev->dev, "unable to register backlight device: %ld\n", | ||
PTR_ERR(backlight)); | ||
return PTR_ERR(backlight); | ||
} | ||
|
||
backlight->props.max_brightness = bdata->max_brightness; | ||
backlight->props.brightness = bdata->max_brightness; | ||
backlight->props.power = FB_BLANK_POWERDOWN; | ||
backlight_update_status(backlight); | ||
|
||
scon->backlight = backlight; | ||
return 0; | ||
} | ||
|
||
void shmob_drm_backlight_exit(struct shmob_drm_connector *scon) | ||
{ | ||
backlight_device_unregister(scon->backlight); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* shmob_drm_backlight.h -- SH Mobile DRM Backlight | ||
* | ||
* Copyright (C) 2012 Renesas Corporation | ||
* | ||
* Laurent Pinchart (laurent.pinchart@ideasonboard.com) | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
*/ | ||
|
||
#ifndef __SHMOB_DRM_BACKLIGHT_H__ | ||
#define __SHMOB_DRM_BACKLIGHT_H__ | ||
|
||
struct shmob_drm_connector; | ||
|
||
void shmob_drm_backlight_dpms(struct shmob_drm_connector *scon, int mode); | ||
int shmob_drm_backlight_init(struct shmob_drm_connector *scon); | ||
void shmob_drm_backlight_exit(struct shmob_drm_connector *scon); | ||
|
||
#endif /* __SHMOB_DRM_BACKLIGHT_H__ */ |
Oops, something went wrong.