#endif
#define MEM_FB_SIZE (3*SZ_2M)
#ifdef CONFIG_FB_WORK_IPP
-#define MEM_FBIPP_SIZE SZ_8M //1920 x 1080 x 2 x 2 //RGB565 = x2;RGB888 = x4
+#define MEM_FBIPP_SIZE SZ_16M //1920 x 1080 x 2 x 2 //RGB565 = x2;RGB888 = x4
#else
#define MEM_FBIPP_SIZE 0
#endif
#include <linux/hiddev.h>
#include <linux/hid-debug.h>
#include <linux/hidraw.h>
-
+#include <linux/hdmi-new.h>
#include "hid-ids.h"
/*
#define DRIVER_DESC "HID core driver"
#define DRIVER_LICENSE "GPL"
+static unsigned int is_left_down = 0;
int hid_debug = 0;
module_param_named(debug, hid_debug, int, 0600);
MODULE_PARM_DESC(debug, "toggle HID debugging messages");
kfree(buf);
nomem:
+ if(is_left_down == 0 && data[0] == 1){
+ is_left_down = 1;
+ data[1] = 0;
+ data[2] = 0;
+ }
+ if(data[0] == 0)
+ is_left_down = 0;
if (hdrv && hdrv->raw_event && hid_match_report(hid, report)) {
ret = hdrv->raw_event(hid, report, data, size);
if (ret != 0)
}
hid_report_raw_event(hid, type, data, size, interrupt);
-
+//hdmi_set_scale(HDMI_MOUSE_EVENT, data, size); //mod by kfx
return 0;
}
EXPORT_SYMBOL_GPL(hid_input_report);
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_ISO) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_JIS) },
- { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI) },
- { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4_ISO) },
- { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4_JIS) },
- { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4A_ANSI) },
- { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4A_ISO) },
- { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS) },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI) },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO) },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS) },
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_TACTICAL_PAD) },
{ HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_1) },
{ HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_2) },
- { HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_3) },
{ HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_MOUSE) },
{ HID_USB_DEVICE(USB_VENDOR_ID_DRAGONRISE, 0x0006) },
{ HID_USB_DEVICE(USB_VENDOR_ID_EZKEY, USB_DEVICE_ID_BTC_8193) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_ISO) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_JIS) },
- { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI) },
- { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4_ISO) },
- { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4_JIS) },
- { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4A_ANSI) },
- { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4A_ISO) },
- { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) },
{ }
#include <linux/irq.h>
#include <linux/async.h>
#include <mach/board.h>
-
+#include <linux/hdmi-new.h>
//#define DEBUG
#ifdef CONFIG_EETI_EGALAX_DEBUG
#define TS_DEBUG(fmt,args...) printk( KERN_DEBUG "[egalax_i2c]: " fmt, ## args)
{
int i;
short X=0, Y=0, ContactID=0, Status=0;
+ int x, y, scale;
if(buflen!=MAX_I2C_LEN || buf[0]!=0x04) // check buffer len & header
return;
input_report_abs(input_dev, ABS_MT_TRACKING_ID, i);
input_report_abs(input_dev, ABS_MT_TOUCH_MAJOR, PointBuf[i].Status);
input_report_abs(input_dev, ABS_MT_WIDTH_MAJOR, 0);
+#if 1 //mod by kfx
+ scale = hdmi_get_scale();
+ x = PointBuf[i].X * 100 / scale;
+ x -= CONFIG_EETI_EGALAX_MAX_X * (100-scale)/200;
+ x = (x<0)?0:x;
+ y = PointBuf[i].Y * 100 / scale;
+ y -= CONFIG_EETI_EGALAX_MAX_Y * (100-scale)/200;
+ y = (y<0)?0:y;
+ input_report_abs(input_dev, ABS_MT_POSITION_X, x);
+ input_report_abs(input_dev, ABS_MT_POSITION_Y, y);
+#else
input_report_abs(input_dev, ABS_MT_POSITION_X, PointBuf[i].X);
input_report_abs(input_dev, ABS_MT_POSITION_Y, PointBuf[i].Y);
-
+#endif
input_mt_sync(input_dev);
if(PointBuf[i].Status == 0)
if HDMI
-config HDMI_OLD
- default y
- bool "old hdmi support"
- help
- nothing
-if HDMI_OLD
-source "drivers/video/hdmi/hdmi-old/Kconfig"
-endif
+#config HDMI_OLD
+# default y
+# bool "old hdmi support"
+# help
+# nothing
+#if HDMI_OLD
+#source "drivers/video/hdmi/hdmi-old/Kconfig"
+#endif
config HDMI_NEW
bool "new hdmi support"
if HDMI_NEW
source "drivers/video/hdmi/hdmi-new/Kconfig"
endif
-
+config HDMI_DUAL_DISP
+ bool "hdmi support dual display"
+ help
+ nothing
config HDMI_DEBUG
bool "hdmi debug"
\r
#include "anx7150.h"\r
#include "anx7150_hw.h"\r
-\r
int anx7150_i2c_read_p0_reg(struct i2c_client *client, char reg, char *val)\r
{\r
client->addr = ANX7150_I2C_ADDR0;\r
return i2c_master_reg8_send(client, reg, val, 1, ANX7150_SCL_RATE) > 0? 0: -EINVAL;\r
}\r
\r
-static int anx7150_param_chg(struct anx7150_pdata *anx)\r
+static int anx7150_hdmi_precent(struct hdmi *hdmi)\r
{\r
- int resolution_real;\r
+ struct anx7150_pdata *anx = hdmi_priv(hdmi);\r
\r
- hdmi_set_spk(anx->hdmi->display_on);\r
- hdmi_set_backlight(!anx->hdmi->display_on);\r
- hdmi_switch_fb(anx->hdmi, anx->hdmi->display_on);\r
+ return gpio_get_value(anx->client->irq)?0:1;\r
+}\r
+static int anx7150_param_chg(struct anx7150_pdata *anx)\r
+{\r
+ int resolution_real, enable;\r
+ \r
+ if(anx->hdmi->mode == DISP_ON_LCD)\r
+ anx->hdmi->scale = 100;\r
+ enable = ((anx->hdmi->mode!= DISP_ON_LCD) && anx->hdmi->display_on && anx7150_hdmi_precent(anx->hdmi))?1:0;\r
+ hdmi_set_spk(!enable); //if(hdmi mode) turn off spk\r
+ hdmi_set_backlight(!enable); //if(hdmi mode) trun off backlight\r
+ hdmi_switch_fb(anx->hdmi, enable);\r
resolution_real = ANX7150_Get_Optimal_resolution(anx->hdmi->resolution);\r
HDMI_Set_Video_Format(resolution_real);\r
HDMI_Set_Audio_Fs(anx->hdmi->audio_fs);\r
int tmo = 10;\r
struct anx7150_pdata *anx = hdmi_priv(hdmi);\r
\r
- anx7150_plug(anx->client);\r
- if(ANX7150_Parse_EDID(anx->client,&anx->dev) < 0)\r
- {\r
- dev_info(&anx->client->dev, "parse EDID error\n");\r
- anx7150_unplug(anx->client);\r
- return -1;\r
- }\r
+ if(anx->edid_read_ok == 0) {\r
+ anx7150_plug(anx->client);\r
+ if(ANX7150_Parse_EDID(anx->client,&anx->dev) < 0)\r
+ {\r
+ dev_info(&anx->client->dev, "parse EDID error\n");\r
+ anx7150_unplug(anx->client);\r
+ return -1;\r
+ }\r
\r
- while(--tmo && ANX7150_GET_SENSE_STATE(anx->client) != 1)\r
- mdelay(10);\r
- if(tmo <= 0)\r
- {\r
- anx7150_unplug(anx->client);\r
- return -1;\r
+ while(--tmo && ANX7150_GET_SENSE_STATE(anx->client) != 1)\r
+ mdelay(10);\r
+ if(tmo <= 0)\r
+ {\r
+ anx7150_unplug(anx->client);\r
+ return -1;\r
+ }\r
+ anx->edid_read_ok = 1;\r
}\r
- if(!hdmi->display_on)\r
- return 0;\r
anx7150_param_chg(anx);\r
return 0;\r
}\r
struct anx7150_pdata *anx = hdmi_priv(hdmi);\r
\r
anx7150_unplug(anx->client);\r
- hdmi_set_spk(HDMI_DISABLE);\r
- hdmi_set_backlight(HDMI_ENABLE);\r
+ anx->edid_read_ok = 0;\r
+ hdmi->scale = 100;\r
+ hdmi_set_spk(HDMI_ENABLE);\r
hdmi_switch_fb(hdmi, HDMI_DISABLE);\r
+ hdmi_set_backlight(HDMI_ENABLE);\r
\r
return 0;\r
}\r
struct anx7150_pdata *anx = hdmi_priv(hdmi);\r
\r
anx7150_unplug(anx->client);\r
+ anx->edid_read_ok = 0;\r
+ hdmi->scale = 100;\r
\r
return 0;\r
}\r
static int anx7150_display_on(struct hdmi* hdmi)\r
{\r
- struct anx7150_pdata *anx = hdmi_priv(hdmi);\r
-\r
hdmi->display_on = HDMI_ENABLE;\r
hdmi_dbg(hdmi->dev, "hdmi display on\n");\r
- anx7150_param_chg(anx);\r
+ anx7150_insert(hdmi);\r
return 0;\r
}\r
static int anx7150_display_off(struct hdmi* hdmi)\r
{\r
- struct anx7150_pdata *anx = hdmi_priv(hdmi);\r
-\r
hdmi->display_on = HDMI_DISABLE;\r
- anx->dev.hdmi_enable = HDMI_DISABLE;\r
hdmi_dbg(hdmi->dev, "hdmi display off\n");\r
- anx7150_param_chg(anx);\r
+ anx7150_remove(hdmi);\r
return 0;\r
}\r
static int anx7150_set_param(struct hdmi *hdmi)\r
return 0;\r
}\r
\r
-static int anx7150_hdmi_precent(struct hdmi *hdmi)\r
-{\r
- struct anx7150_pdata *anx = hdmi_priv(hdmi);\r
-\r
- return gpio_get_value(anx->client->irq)?0:1;\r
-}\r
static struct hdmi_ops anx7150_ops = {\r
.display_on = anx7150_display_on,\r
.display_off = anx7150_display_off,\r
free_irq(anx->irq, anx);\r
ret = request_irq(anx->irq, anx7150_detect_irq,\r
anx7150_hdmi_precent(anx->hdmi)? IRQF_TRIGGER_RISING : IRQF_TRIGGER_FALLING,NULL,anx);\r
- dev_info(&anx->client->dev, "det = %d,hpd_status = %d\n", \r
+ dev_dbg(&anx->client->dev, "det = %d,hpd_status = %d\n", \r
gpio_get_value(anx->client->irq), anx7150_get_hpd(anx->client));\r
+ if(gpio_get_value(anx->client->irq) == anx7150_get_hpd(anx->client))\r
+ return;\r
anx->is_changed = 1;\r
- if(!anx->is_early_suspend)\r
+ if(!anx->is_early_suspend && anx->hdmi->display_on == HDMI_ENABLE)\r
hdmi_changed(anx->hdmi, 0);\r
}\r
\r
hdmi->hdcp_on = HDMI_DISABLE;\r
hdmi->audio_fs = HDMI_I2S_DEFAULT_Fs;\r
hdmi->resolution = HDMI_DEFAULT_RESOLUTION;\r
+ hdmi->dual_disp = DUAL_DISP_CAP;\r
+ hdmi->mode = HDMI_DEFAULT_MODE;\r
\r
anx = hdmi_priv(hdmi);\r
+ anx->edid_read_ok = 0;\r
anx->hdmi = hdmi;\r
i2c_set_clientdata(client, anx);\r
anx->client = client;\r
#endif\r
anx->is_early_suspend = 0;\r
anx->is_changed = 1;\r
+ anx7150_initial(anx->client);\r
\r
- hdmi_changed(hdmi, 200);\r
+ //hdmi_changed(hdmi, 200);\r
dev_info(&client->dev, "anx7150 i2c probe ok\n");\r
return 0;\r
err_free_irq:\r
int init;\r
int is_early_suspend;\r
int is_changed;\r
+ int edid_read_ok;
struct delayed_work work;\r
struct hdmi *hdmi;\r
struct i2c_client *client;\r
return rc;\r
}\r
\r
+int anx7150_initial(struct i2c_client *client)
+{
+ ANX7150_Variable_Initial(); //simon\r
+ ANX7150_HW_Interface_Variable_Initial(); //simon\r
+ \r
+ anx7150_hardware_initial(client); //simon\r
+ return 0;
+}
int anx7150_unplug(struct i2c_client *client)\r
{\r
int rc = 0;\r
u8 edid_segment,segmentpointer,k;\r
\r
rc = anx7150_rst_ddcchannel(client);\r
- mdelay(1);\r
+ mdelay(5);\r
\r
edid_segment = ANX7150_edid_length / 256;\r
if (edid_segment==0) //update\r
for (k = 0; k <= segmentpointer; k ++)\r
{\r
rc =anx7150_initddc_read(client, 0xa0, k, 0x00, 0x80, 0x00);\r
- mdelay(1);\r
+ mdelay(10);\r
rc = ANX7150_DDC_Mass_Read(client, 128, k);\r
//mdelay(10);\r
rc = anx7150_initddc_read(client, 0xa0, k, 0x80, 0x80, 0x00);\r
- mdelay(1);\r
+ mdelay(10);\r
rc = ANX7150_DDC_Mass_Read(client, 128, k + 1);\r
//mdelay(10);\r
}\r
int ANX7150_PLAYBACK_Process(void);\r
int ANX7150_Blue_Screen(struct anx7150_pdata *anx);\r
int anx7150_set_avmute(struct i2c_client *client);\r
-\r
+int anx7150_initial(struct i2c_client *client);\r
\r
#endif\r
void hdmi_set_backlight(int on)
{
rk29_backlight_set(on);
-}
\ No newline at end of file
+}
#include <linux/hdmi-new.h>
extern void codec_set_spk(bool on);
-int hdmi_codec_set_audio_fs(unsigned char audio_fs)
-{
- return 0;
-}
void hdmi_set_spk(int on)
{
- codec_set_spk(!on);
+ codec_set_spk(on);
}
#include <linux/err.h>\r
\r
#include <linux/hdmi-new.h>\r
+#include <linux/input.h>\r
+\r
\r
struct class *hdmi_class;\r
struct hdmi_id_ref_info {\r
\r
#endif /* CONFIG_SYSFS */\r
\r
-\r
+extern struct input_dev *gsensor_input_dev;\r
void hdmi_changed(struct hdmi *hdmi, int msec)\r
{\r
schedule_delayed_work(&hdmi->changed_work, msecs_to_jiffies(msec));\r
else\r
ret = hdmi->ops->remove(hdmi);\r
if(ret < 0)\r
- dev_dbg(hdmi->dev, "hdmi changed error\n");\r
+ dev_warn(hdmi->dev, "hdmi changed error\n");\r
kobject_uevent(&hdmi->dev->kobj, KOBJ_CHANGE);\r
}\r
\r
kfree(hdmi);\r
return NULL;\r
success:\r
+ hdmi->scale = 100;\r
return hdmi;\r
}\r
void hdmi_unregister(struct hdmi *hdmi)\r
else\r
return 0;\r
}\r
+int hdmi_get_scale(void)\r
+{\r
+ struct hdmi* hdmi = get_hdmi_struct(0);\r
+ if(!hdmi)\r
+ return 100;\r
+ else if(!hdmi->display_on || !hdmi->ops->hdmi_precent(hdmi))\r
+ return 100;\r
+ else\r
+ return hdmi->scale;\r
+}\r
+\r
+int hdmi_set_scale(int event, char *data, int len)\r
+{\r
+ int result;\r
+ struct hdmi* hdmi = get_hdmi_struct(0);\r
+\r
+ if(!hdmi)\r
+ return -1;\r
+ if(len != 4)\r
+ return -1;\r
+ if(fb_get_video_mode() || !hdmi->display_on || !hdmi->ops->hdmi_precent(hdmi))\r
+ return -1;\r
+\r
+ result = data[0] | data[1]<<1 | data[2]<<2;\r
+ if(event != MOUSE_NONE && (result & event) != event)\r
+ return -1;\r
+\r
+ hdmi->scale += data[3];\r
+ \r
+ hdmi->scale = (hdmi->scale>100)?100:hdmi->scale;\r
+ hdmi->scale = (hdmi->scale<MIN_SCALE)?MIN_SCALE:hdmi->scale;\r
+ return 0; \r
+}\r
+\r
static int __init hdmi_class_init(void)\r
{\r
int i;\r
return sprintf(buf, "display_on=%d\n"\r
"plug=%d\n"\r
"auto_switch=%d\n"\r
+ "dual_disp=%d\n"\r
+ "mode=%d\n"\r
"hdcp_on=%d\n"\r
"audio_fs=%d\n"\r
+ "scale=%d\n"\r
"resolution=%d\n"\r
"--------------------------\n"\r
"resolution support:\n"\r
- "HDMI_1280x720p_50Hz 0\n"\r
- "HDMI_1280x720p_60Hz 1\n"\r
- "HDMI_720x576p_50Hz_4x3 2\n"\r
- "HDMI_720x576p_50Hz_16x9 3\n"\r
- "HDMI_720x480p_60Hz_4x3 4\n"\r
- "HDMI_720x480p_60Hz_16x9 5\n"\r
- "HDMI_1920x1080p_50Hz 6\n"\r
- "HDMI_1920x1080p_60Hz 7\n"\r
+ "HDMI_1920x1080p_50Hz 0\n"\r
+ "HDMI_1920x1080p_60Hz 1\n"\r
+ "HDMI_1280x720p_50Hz 2\n"\r
+ "HDMI_1280x720p_60Hz 3\n"\r
+ "HDMI_720x576p_50Hz_4x3 4\n"\r
+ "HDMI_720x576p_50Hz_16x9 5\n"\r
+ "HDMI_720x480p_60Hz_4x3 6\n"\r
+ "HDMI_720x480p_60Hz_16x9 7\n"\r
"--------------------------\n", \r
hdmi->display_on,hdmi->ops->hdmi_precent(hdmi),\r
- hdmi->auto_switch, hdmi->hdcp_on,\r
- hdmi->audio_fs, hdmi->resolution);\r
+ hdmi->auto_switch,hdmi->dual_disp,\r
+ hdmi->mode, \r
+ hdmi->hdcp_on,\r
+ hdmi->audio_fs, (hdmi->ops->hdmi_precent(hdmi) && hdmi->display_on)?hdmi->scale:100, \r
+ hdmi->resolution);\r
}\r
static ssize_t hdmi_restore_state_attrs(struct device *dev, \r
struct device_attribute *attr,\r
struct hdmi *hdmi = dev_get_drvdata(dev);\r
char *p;\r
const char *q;\r
- int auto_switch = -1, hdcp_on = -1, audio_fs = -1, resolution = -1;\r
+ int set_param = 0, tmp = 0;\r
+\r
+ hdmi_dbg(hdmi->dev, "func:%s-->buf = \n%s\n", __func__, buf); \r
\r
+ if(hdmi->display_on == HDMI_DISABLE)\r
+ {\r
+ dev_err(dev, "hdmi is off\n");\r
+ ret = -EINVAL;\r
+ goto exit;\r
+ }\r
+\r
q = buf;\r
do\r
{\r
- if((p = strstr(q, "auto_switch=")) != NULL)\r
+ if((p = strstr(q, "mode=")) != NULL)\r
{\r
- q = p + 12;\r
- if((sscanf(q, "%d", &auto_switch) == 1) &&\r
- (auto_switch == 0 || auto_switch == 1))\r
- hdmi->auto_switch = auto_switch;\r
+ q = p + 5;\r
+\r
+ if((sscanf(q, "%d", &tmp) == 1) && (tmp >= 0 && tmp <= 3))\r
+ {\r
+ if(tmp != hdmi->mode)\r
+ {\r
+ set_param |= 1;\r
+ hdmi->mode = tmp;\r
+ }\r
+ }\r
else\r
{\r
dev_err(dev, "failed to set hdmi configuration\n");\r
goto exit;\r
}\r
}\r
+\r
else if((p = strstr(q, "hdcp_on=")) != NULL)\r
{\r
q = p + 8;\r
- if((sscanf(q, "%d", &hdcp_on) == 1) &&\r
- (hdcp_on == 0 || hdcp_on == 1))\r
- hdmi->hdcp_on = hdcp_on;\r
+#if 0\r
+ if((sscanf(q, "%d", &tmp) == 1) && (tmp == 0 || tmp ==1))\r
+ {\r
+ if(tmp != hdmi->hdcp_on)\r
+ {\r
+ set_param |= 1;\r
+ hdmi->hdcp_on = tmp;\r
+ }\r
+ }\r
else\r
{\r
dev_err(dev, "failed to set hdmi configuration\n");\r
ret = -EINVAL;\r
goto exit;\r
}\r
+#endif\r
}\r
- else if((p = strstr(q, "audio_fs=")) != NULL)\r
+\r
+\r
+ else if((p = strstr(q, "scale=")) != NULL)\r
{\r
- q = p + 9;\r
- if((sscanf(q, "%d", &audio_fs) == 1) &&\r
- (audio_fs >= 0))\r
- hdmi->audio_fs = audio_fs;\r
+ q = p + 6;\r
+#if 1\r
+ if((sscanf(q, "%d", &tmp) == 1) && (tmp >=MIN_SCALE && tmp <= 100))\r
+ {\r
+ hdmi->scale = tmp;\r
+ hdmi->scale = (hdmi->ops->hdmi_precent(hdmi) && hdmi->display_on)?hdmi->scale:100;\r
+ }\r
else\r
{\r
dev_err(dev, "failed to set hdmi configuration\n");\r
ret = -EINVAL;\r
goto exit;\r
}\r
+#endif\r
}\r
else if((p = strstr(q, "resolution=")) != NULL)\r
{\r
q = p + 11;\r
- if((sscanf(q, "%d", &resolution) == 1) &&\r
- (resolution >= 0))\r
- hdmi->resolution = resolution;\r
+ if((sscanf(q, "%d", &tmp) == 1) && (tmp >= 0))\r
+ {\r
+ if(hdmi->resolution != tmp)\r
+ {\r
+ set_param |= 1;\r
+ hdmi->resolution = tmp;\r
+ }\r
+ }\r
else\r
{\r
dev_err(dev, "failed to set hdmi configuration\n");\r
break;\r
\r
}while(*q != 0);\r
- if(auto_switch == -1 &&\r
- hdcp_on == -1 &&\r
- audio_fs == -1 &&\r
- resolution == -1)\r
- {\r
- dev_err(dev, "failed to set hdmi configuration\n");\r
- ret = -EINVAL;\r
- goto exit;\r
- }\r
- if(hdmi->ops->set_param)\r
+ if(hdmi->ops->set_param && set_param != 0)\r
ret = hdmi->ops->set_param(hdmi);\r
- else\r
- {\r
- dev_err(dev, "hdmi device is not exist\n");\r
- return ret = 0;\r
- }\r
exit:\r
if(ret < 0)\r
dev_err(dev, "hdmi_restore_state_attrs err\n");\r
#include <mach/gpio.h>\r
#include <mach/iomux.h>\r
\r
-#include "anx7150.h"\r
+#include "linux/anx7150.h"\r
#include "anx7150_hw.h"\r
\r
int anx7150_i2c_read_p0_reg(struct i2c_client *client, char reg, char *val)\r
\r
return IRQ_HANDLED;\r
}\r
-\r
+#if 1//eboda zlj add for test 110518\r
+struct anx7150_dev_s *anx7150_dev;\r
+int anx7150_get_output_status(void)\r
+{\r
+ return anx7150_dev->rk29_output_status;\r
+}\r
+#endif\r
void anx7150_task(struct anx7150_pdata *anx)\r
{\r
int state;\r
int anx7150_i2c_read_p1_reg(struct i2c_client *client, char reg, char *val);\r
int anx7150_i2c_write_p1_reg(struct i2c_client *client, char reg, char *val);\r
\r
+int anx7150_get_output_status(void);//eboda zlj add for test 110518\r
#endif\r
#include <linux/delay.h>\r
#include <linux/i2c.h>\r
#include <linux/hdmi.h>\r
-\r
-\r
-#include "anx7150.h"\r
+#if 1 // eboda twp\r
+#include <mach/gpio.h>\r
+#include <mach/iomux.h>\r
+#endif\r
+#include "linux/anx7150.h"\r
#include "anx7150_hw.h"\r
//#ifdef ITU656\r
struct ANX7150_video_timingtype ANX7150_video_timingtype_table =\r
//********************end of video config*********\r
\r
//********************for edid parse***********\r
- ANX7150_edid_result.is_HDMI = 0;\r
+ ANX7150_edid_result.is_HDMI = 1;// 0->1,eboda zlj add for test 110413\r
ANX7150_edid_result.ycbcr422_supported = 0;\r
ANX7150_edid_result.ycbcr444_supported = 0;\r
ANX7150_edid_result.supported_720p_60Hz = 0;\r
ANX7150_parse_edid_done = 0;\r
// ANX7150_system_config_done = 0;\r
ANX7150_srm_checked = 0;\r
-\r
+ #if 1 //eboda twp \r
+ // gpio_direction_output(RK29_PIN6_PD1, 0);\r
+ //gpio_set_value(RK29_PIN6_PD1, 1);\r
+ rk29_mux_api_set(GPIO1B5_PWM0_NAME, GPIO1L_PWM0);\r
+ //printk("turn on LCD\n");\r
+ #endif \r
return rc;\r
}\r
int anx7150_plug(struct i2c_client *client)\r
}\r
else\r
{\r
- ANX7150_edid_result.is_HDMI = 0;\r
+ ANX7150_edid_result.is_HDMI = 1;// 0->1,eboda zlj add for test 110413\r
//ANX7150_i2c_read_p0_reg(ANX7150_SYS_CTRL1_REG, &c);\r
//ANX7150_i2c_write_p0_reg(ANX7150_SYS_CTRL1_REG, c & (~ANX7150_SYS_CTRL1_HDMI));\r
}\r
c |= (0x02);\r
rc = anx7150_i2c_write_p0_reg(client, ANX7150_SYS_CTRL1_REG, &c);\r
hdmi_dbg(&client->dev,"ANX7150 is set to HDMI mode\n");\r
+ #if 1 //eboda twp \r
+ //gpio_direction_output(RK29_PIN6_PD1, GPIO1L_GPIO1B5);\r
+ //gpio_set_value(RK29_PIN6_PD1, 0);\r
+ rk29_mux_api_set(GPIO1B5_PWM0_NAME, 0);\r
+ if (gpio_request(RK29_PIN1_PB5, NULL)) {\r
+ printk("func %s, line %d: request gpio fail\n", __FUNCTION__, __LINE__);\r
+ }\r
+ gpio_direction_output(RK29_PIN1_PB5, 0);\r
+ //printk("turn off LCD\n");\r
+ #endif \r
}\r
rc = anx7150_i2c_read_p0_reg(client, ANX7150_SYS_CTRL1_REG, &c);\r
TX_is_HDMI = c & 0x02;\r
else\r
return ref_info[nr].hdmi;\r
}\r
+int hdmi_get_scale(void)\r
+{\r
+ return 100;\r
+}\r
static int __init hdmi_class_init(void)\r
{\r
int i;\r
#ifdef CONFIG_HDMI
#include <linux/completion.h>
-#include <linux/hdmi.h>
+#include <linux/hdmi-new.h>
#endif
#include <mach/iomux.h>
}
#endif
+static void hdmi_set_fbscale(struct fb_info *info)
+{
+ struct rk29fb_inf *inf = dev_get_drvdata(info->device);
+ struct rk29fb_screen *screen = inf->cur_screen;
+ struct win0_par *par = info->par;
+ int scale;
+
+ scale = hdmi_get_scale();
+ if(scale == 100)
+ return;
+ par->xpos += screen->x_res * (100-scale) / 200;
+ par->ypos += screen->y_res * (100-scale) / 200;
+ par->xsize = par->xsize *scale /100;
+ par->ysize = par->ysize *scale /100;
+}
static int win0_blank(int blank_mode, struct fb_info *info)
{
struct rk29fb_inf *inf = dev_get_drvdata(info->device);
struct fb_var_screeninfo *var = &info->var;
struct fb_fix_screeninfo *fix = &info->fix;
struct win0_par *par = info->par;
-
- u32 xact = var->xres; /* visible resolution */
- u32 yact = var->yres;
- u32 xvir = var->xres_virtual; /* virtual resolution */
- u32 yvir = var->yres_virtual;
+ u32 xact, yact, xvir, yvir, xpos, ypos, ScaleYrgbX,ScaleYrgbY, ScaleCbrX, ScaleCbrY, y_addr,uv_addr;
+ hdmi_set_fbscale(info);
+ xact = var->xres; /* visible resolution */
+ yact = var->yres;
+ xvir = var->xres_virtual; /* virtual resolution */
+ yvir = var->yres_virtual;
//u32 xact_st = var->xoffset; /* offset from virtual to visible */
//u32 yact_st = var->yoffset; /* resolution */
- u32 xpos = par->xpos;
- u32 ypos = par->ypos;
+ xpos = par->xpos;
+ ypos = par->ypos;
- u32 ScaleYrgbX=0x1000,ScaleYrgbY=0x1000;
- u32 ScaleCbrX=0x1000, ScaleCbrY=0x1000;
+ ScaleYrgbX=0x1000;
+ ScaleYrgbY=0x1000;
+ ScaleCbrX=0x1000;
+ ScaleCbrY=0x1000;
- u32 y_addr = 0; //user alloc buf addr y
- u32 uv_addr = 0;
+ y_addr = 0; //user alloc buf addr y
+ uv_addr = 0;
fbprintk(">>>>>> %s : %s\n", __FILE__, __FUNCTION__);
struct rk29fb_screen *screen = inf->cur_screen;
struct win0_par *par = info->par;
struct fb_var_screeninfo *var = &info->var;
-
+ u32 addr;
+ u16 xres_virtual,xpos,ypos;
+ u8 trspval,trspmode;
+ hdmi_set_fbscale(info);
//u32 offset=0, addr=0, map_size=0, smem_len=0;
- u32 addr=0;
- u16 xres_virtual = 0; //virtual screen size
+ addr=0;
+ xres_virtual = 0; //virtual screen size
//u16 xpos_virtual = var->xoffset; //visiable offset in virtual screen
//u16 ypos_virtual = var->yoffset;
- u16 xpos = par->xpos; //visiable offset in panel
- u16 ypos = par->ypos;
+ xpos = par->xpos; //visiable offset in panel
+ ypos = par->ypos;
- u8 trspmode = TRSP_CLOSE;
- u8 trspval = 0;
+ trspmode = TRSP_CLOSE;
+ trspval = 0;
//fbprintk(">>>>>> %s : %s\n", __FILE__, __FUNCTION__);
#ifdef CONFIG_FB_SCALING_OSD
if(((screen->x_res != var->xres) || (screen->y_res != var->yres))
- && !((screen->x_res>1280) && (var->bits_per_pixel == 32)))
+ && !((screen->x_res>1920) && (var->bits_per_pixel == 32)))
{
- addr = fix->mmio_start + par->y_offset;
- xres_virtual = screen->x_res; //virtual screen size
+ addr = fix->mmio_start + par->y_offset* hdmi_get_scale()/100;
+ xres_virtual = screen->x_res* hdmi_get_scale()/100; //virtual screen size
}
else
#endif
struct rk29fb_screen *screen = inf->cur_screen;
struct fb_var_screeninfo *var = &info->var;
if(((screen->x_res != var->xres) || (screen->y_res != var->yres))
- && !((screen->x_res>1280) && (var->bits_per_pixel == 32)))
+ && !((screen->x_res>1920) && (var->bits_per_pixel == 32)))
{
- addr = fix1->mmio_start + par->y_offset;
+ addr = fix1->mmio_start + par->y_offset* hdmi_get_scale()/100;
}
else
#endif
{
#ifdef CONFIG_FB_SCALING_OSD
if(((screen->x_res != var->xres) || (screen->y_res != var->yres))
- && !((screen->x_res>1280) && (var->bits_per_pixel == 32)))
+ && !((screen->x_res>1920) && (var->bits_per_pixel == 32)))
{
par->xpos = 0;
par->ypos = 0;
ipp_req.src0.w = var->xres;
ipp_req.src0.h = var->yres;
- ipp_req.dst0.YrgbMst = fix->mmio_start + dstoffset;
- ipp_req.dst0.w = screen->x_res;
- ipp_req.dst0.h = screen->y_res;
+ ipp_req.dst0.YrgbMst = fix->mmio_start + dstoffset* hdmi_get_scale()/100;
+ ipp_req.dst0.w = screen->x_res* hdmi_get_scale()/100;
+ ipp_req.dst0.h = screen->y_res* hdmi_get_scale()/100;
ipp_req.src_vir_w = ipp_req.src0.w;
ipp_req.dst_vir_w = ipp_req.dst0.w;
#ifdef CONFIG_FB_SCALING_OSD
struct fb_fix_screeninfo *fix = &info->fix;
struct rk29_ipp_req ipp_req;
- u32 dstoffset = 0
+ u32 dstoffset = 0;
#endif
//fbprintk(">>>>>> %s : %s \n", __FILE__, __FUNCTION__);
{
#ifdef CONFIG_FB_SCALING_OSD
if(((screen->x_res != var->xres) || (screen->y_res != var->yres))
- && !((screen->x_res>1280) && (var->bits_per_pixel == 32)))
+ && !((screen->x_res>1920) && (var->bits_per_pixel == 32)))
{
par->y_offset = dstoffset;
ipp_req.src0.w = var->xres;
ipp_req.src0.h = var->yres;
- ipp_req.dst0.YrgbMst = fix->mmio_start + dstoffset;
- ipp_req.dst0.w = screen->x_res;
- ipp_req.dst0.h = screen->y_res;
+ ipp_req.dst0.YrgbMst = fix->mmio_start + dstoffset* hdmi_get_scale()/100;
+ ipp_req.dst0.w = screen->x_res* hdmi_get_scale()/100;
+ ipp_req.dst0.h = screen->y_res* hdmi_get_scale()/100;
ipp_req.src_vir_w = ipp_req.src0.w;
ipp_req.dst_vir_w = ipp_req.dst0.w;
u16 xlcd = screen->x_res; //size of panel
u16 ylcd = screen->y_res;
u16 yres = 0;
-#ifdef CONFIG_HDMI
+#if 0
struct hdmi *hdmi = get_hdmi_struct(0);
#endif
{
return -EINVAL; // multiple of scale down or scale up can't exceed 8
}
-#ifdef CONFIG_HDMI
+#if 0
if(inf->video_mode == 1) {
if(hdmi_resolution_changed(hdmi,var->xres,var->yres, 1) == 1)
{
//.fb_cursor = rk29_set_cursor,
};
+int fb_get_video_mode(void)
+{
+ struct rk29fb_inf *inf;
+ if(!g_pdev)
+ return 0;
+ inf = platform_get_drvdata(g_pdev);
+ return inf->video_mode;
+}
/*
enable: 1, switch to tv or hdmi; 0, switch to lcd
*/
#define FALSE 0\r
#define HDMI_DISABLE 0\r
#define HDMI_ENABLE 1\r
+\r
+#define MIN_SCALE 80\r
+/* mouse event */\r
+#define MOUSE_NONE 0x00\r
+#define MOUSE_LEFT_PRESS 0x01\r
+#define MOUSE_RIGHT_PRESS 0x02\r
+#define MOUSE_MIDDLE_PRESS 0x04\r
+#define HDMI_MOUSE_EVENT MOUSE_NONE \r
+/* mode */\r
+#define DISP_ON_LCD 0\r
+#define DISP_ON_HDMI 1\r
+#define DISP_ON_LCD_AND_HDMI 2\r
+/* dual display */\r
+#ifdef CONFIG_HDMI_DUAL_DISP\r
+#define DUAL_DISP_CAP HDMI_ENABLE \r
+#define HDMI_DEFAULT_MODE DISP_ON_LCD_AND_HDMI\r
+#else\r
+#define DUAL_DISP_CAP HDMI_DISABLE \r
+#define HDMI_DEFAULT_MODE DISP_ON_HDMI\r
+#endif\r
/* resolution */\r
-#define HDMI_1280x720p_50Hz 0\r
-#define HDMI_1280x720p_60Hz 1\r
-#define HDMI_720x576p_50Hz_4x3 2\r
-#define HDMI_720x576p_50Hz_16x9 3\r
-#define HDMI_720x480p_60Hz_4x3 4\r
-#define HDMI_720x480p_60Hz_16x9 5\r
-#define HDMI_1920x1080p_50Hz 6\r
-#define HDMI_1920x1080p_60Hz 7\r
+#define HDMI_1920x1080p_50Hz 0\r
+#define HDMI_1920x1080p_60Hz 1\r
+#define HDMI_1280x720p_50Hz 2\r
+#define HDMI_1280x720p_60Hz 3\r
+#define HDMI_720x576p_50Hz_4x3 4\r
+#define HDMI_720x576p_50Hz_16x9 5\r
+#define HDMI_720x480p_60Hz_4x3 6\r
+#define HDMI_720x480p_60Hz_16x9 7\r
\r
/* HDMI default resolution */\r
#define HDMI_DEFAULT_RESOLUTION HDMI_1280x720p_50Hz\r
BOOL param_conf;\r
\r
u8 resolution;\r
+ u8 scale;\r
u8 audio_fs;\r
+ int mode;\r
+ int dual_disp;\r
\r
int hdmi_stay_awake;\r
\r
extern int hdmi_get_default_resolution(void *screen);\r
extern void hdmi_set_spk(int on);\r
extern void hdmi_set_backlight(int on);\r
-\r
+extern int hdmi_get_scale(void);\r
+extern int hdmi_set_scale(int event, char *data, int len);\r
+extern int fb_get_video_mode(void);\r
#endif\r