siihdmi: move some audio muting around based on Silicon Image example code

siihdmi: don't reconfigure the SII9022 just because there was a mode change if the mode is identical
ipuv3fb: default to a real 640x480 mode and not a "dummy" xres/yres
modedb: move cea modes to an extern so it only gets included once in the kernel
also: whitespace police
This commit is contained in:
Matt Sealey
2011-07-12 11:02:58 -05:00
parent 901989541c
commit 39e907d4bc
6 changed files with 1027 additions and 1005 deletions

View File

@@ -8,7 +8,7 @@ obj-$(CONFIG_VGASTATE) += vgastate.o
obj-y += fb_notify.o
obj-$(CONFIG_FB) += fb.o
fb-y := fbmem.o fbmon.o fbcmap.o fbsysfs.o \
modedb.o fbcvt.o
modedb.o cea861_modedb.o fbcvt.o
fb-objs := $(fb-y)
obj-$(CONFIG_VT) += console/

File diff suppressed because it is too large Load Diff

View File

@@ -44,6 +44,7 @@
#include <linux/io.h>
#include <linux/ipu.h>
#include <linux/mxcfb.h>
#include <linux/cea861_modes.h>
#include <asm/mach-types.h>
#include <asm/uaccess.h>
#include <mach/hardware.h>
@@ -1715,15 +1716,16 @@ static int mxcfb_probe(struct platform_device *pdev)
}
ipu_disable_irq(mxcfbi->ipu_ch_irq);
/* Need dummy values until real panel is configured */
fbi->var.xres = 640;
fbi->var.yres = 480;
/* default to 640x480@60 */
fb_videomode_to_var(&fbi->var, &cea_modes[1]);
if (plat_data && !mxcfbi->ipu_di_pix_fmt) {
mxcfbi->ipu_di_pix_fmt = plat_data->interface_pix_fmt;
#if 0
/* try and use a bit depth closest to the bit depth we use for the panel */
// if (!mxcfbi->default_bpp)
// mxcfbi->default_bpp = pixfmt_to_bpp(plat_data->interface_pix_fmt);
if (!mxcfbi->default_bpp)
mxcfbi->default_bpp = pixfmt_to_bpp(plat_data->interface_pix_fmt);
#endif
}
if (!mxcfbi->default_bpp)

View File

@@ -132,6 +132,8 @@ static inline int siihdmi_power_down(struct siihdmi_tx *tx)
int ret;
u8 ctrl;
memset((void *) &tx->sink.current_mode, 0, sizeof(struct fb_videomode));
ctrl = SIIHDMI_SYS_CTRL_TMDS_OUTPUT_POWER_DOWN;
if (tx->sink.type == SINK_TYPE_HDMI)
ctrl |= SIIHDMI_SYS_CTRL_OUTPUT_MODE_SELECT_HDMI;
@@ -411,6 +413,10 @@ static void siihdmi_set_vmode_registers(struct siihdmi_tx *tx,
/* basic video mode data */
vmode[PIXEL_CLOCK] = (u16) (pixclk / 10);
/*
Silicon Image example code implies refresh to be 6000 for 60Hz?
This may work simply because we only test it on little-endian :(
*/
vmode[REFRESH_RATE] = (u16) refresh;
vmode[X_RESOLUTION] = (u16) htotal;
vmode[Y_RESOLUTION] = (u16) vtotal;
@@ -630,8 +636,8 @@ static inline void siihdmi_configure_audio(struct siihdmi_tx *tx)
i2c_smbus_write_byte_data(tx->client, SIIHDMI_TPI_REG_I2S_AUDIO_SAMPLING_HBR, 0);
i2c_smbus_write_byte_data(tx->client, SIIHDMI_TPI_REG_I2S_ORIGINAL_FREQ_SAMPLE_LENGTH, SIIHDMI_AUDIO_HANDLING_DOWN_SAMPLE);
siihdmi_set_audio_info_frame(tx);
siihdmi_audio_unmute(tx);
siihdmi_set_audio_info_frame(tx);
}
static void siihdmi_print_modeline(const struct siihdmi_tx *tx,
@@ -693,6 +699,13 @@ static int siihdmi_set_resolution(struct siihdmi_tx *tx,
u8 ctrl;
int ret;
if (0 == memcmp((void *) &tx->sink.current_mode, (void *) mode, sizeof(struct fb_videomode)))
{
return 0;
}
memset((void *) &tx->sink.current_mode, 0, sizeof(struct fb_videomode));
INFO("selected configuration: \n");
siihdmi_print_modeline(tx, mode, NULL);
@@ -762,6 +775,8 @@ static int siihdmi_set_resolution(struct siihdmi_tx *tx,
/* step 10: (potentially) enable HDCP */
memcpy((void *) &tx->sink.current_mode, mode, sizeof(struct fb_videomode));
return ret;
}
@@ -1089,6 +1104,7 @@ static int siihdmi_fb_event_handler(struct notifier_block *nb,
case FB_EVENT_BLANK:
switch (*((int *) event->data)) {
case FB_BLANK_POWERDOWN:
/* oddly, nobody ever uses this..? */
return siihdmi_power_down(tx);
case FB_BLANK_VSYNC_SUSPEND:
case FB_BLANK_HSYNC_SUSPEND:

View File

@@ -410,6 +410,7 @@ struct siihdmi_tx {
} scanning;
struct fb_videomode preferred_mode;
struct fb_videomode current_mode;
} sink;
};