char: Add MSM rotator driver

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
This commit is contained in:
Stephen Boyd 2013-01-10 17:41:52 -08:00
parent 57b74303d6
commit b086211319
6 changed files with 1910 additions and 0 deletions

View file

@ -0,0 +1,28 @@
/* Copyright (c) 2009, Code Aurora Forum. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __MSM_ROTATOR_IMEM_H__
enum {
ROTATOR_REQUEST,
JPEG_REQUEST
};
/* Allocates imem for the requested owner.
Aquires a mutex, so DO NOT call from isr context */
int msm_rotator_imem_allocate(int requestor);
/* Frees imem if currently owned by requestor.
Unlocks a mutex, so DO NOT call from isr context */
void msm_rotator_imem_free(int requestor);
#endif

View file

@ -629,6 +629,24 @@ config TILE_SROM
device appear much like a simple EEPROM, and knows
how to partition a single ROM for multiple purposes.
config MSM_ROTATOR
tristate "MSM Offline Image Rotator Driver"
depends on (ARCH_MSM7X30 || ARCH_MSM8X60 || ARCH_MSM8960) && ANDROID_PMEM
default y
help
This driver provides support for the image rotator HW block in the
MSM 7x30 SoC.
config MSM_ROTATOR_USE_IMEM
bool "Enable rotator driver to use iMem"
depends on ARCH_MSM7X30 && MSM_ROTATOR
default y
help
This option enables the msm_rotator driver to use the move efficient
iMem. Some MSM platforms may not have iMem available for the rotator
block. Or some systems may want the iMem to be dedicated to a
different function.
config MMC_GENERIC_CSDIO
tristate "Generic sdio driver"
default n

View file

@ -65,4 +65,5 @@ obj-$(CONFIG_JS_RTC) += js-rtc.o
js-rtc-y = rtc.o
obj-$(CONFIG_TILE_SROM) += tile-srom.o
obj-$(CONFIG_MSM_ROTATOR) += msm_rotator.o
obj-$(CONFIG_MMC_GENERIC_CSDIO) += csdio.o

1802
drivers/char/msm_rotator.c Normal file

File diff suppressed because it is too large Load diff

View file

@ -412,4 +412,5 @@ header-y += x25.h
header-y += xattr.h
header-y += xfrm.h
header-y += msm_mdp.h
header-y += msm_rotator.h
header-y += genlock.h

View file

@ -0,0 +1,60 @@
#ifndef __MSM_ROTATOR_H__
#define __MSM_ROTATOR_H__
#include <linux/types.h>
#include <linux/msm_mdp.h>
#define MSM_ROTATOR_IOCTL_MAGIC 'R'
#define MSM_ROTATOR_IOCTL_START \
_IOWR(MSM_ROTATOR_IOCTL_MAGIC, 1, struct msm_rotator_img_info)
#define MSM_ROTATOR_IOCTL_ROTATE \
_IOW(MSM_ROTATOR_IOCTL_MAGIC, 2, struct msm_rotator_data_info)
#define MSM_ROTATOR_IOCTL_FINISH \
_IOW(MSM_ROTATOR_IOCTL_MAGIC, 3, int)
#define ROTATOR_VERSION_01 0xA5B4C301
enum rotator_clk_type {
ROTATOR_CORE_CLK,
ROTATOR_PCLK,
ROTATOR_IMEM_CLK
};
struct msm_rotator_img_info {
unsigned int session_id;
struct msmfb_img src;
struct msmfb_img dst;
struct mdp_rect src_rect;
unsigned int dst_x;
unsigned int dst_y;
unsigned char rotations;
int enable;
unsigned int downscale_ratio;
};
struct msm_rotator_data_info {
int session_id;
struct msmfb_data src;
struct msmfb_data dst;
unsigned int version_key;
struct msmfb_data src_chroma;
struct msmfb_data dst_chroma;
};
struct msm_rot_clocks {
const char *clk_name;
enum rotator_clk_type clk_type;
unsigned int clk_rate;
};
struct msm_rotator_platform_data {
unsigned int number_of_clocks;
unsigned int hardware_version_number;
struct msm_rot_clocks *rotator_clks;
#ifdef CONFIG_MSM_BUS_SCALING
struct msm_bus_scale_pdata *bus_scale_table;
#endif
};
#endif