mirror of
https://github.com/genesi/linux-legacy.git
synced 2026-09-06 06:47:36 +00:00
remove unnecessary magic number usage
This commit is contained in:
@@ -908,51 +908,28 @@ static int sii9022_init_fb(struct sii9022_tx *tx, struct fb_info *fb)
|
||||
|
||||
static int sii9022_blank(struct sii9022_tx *tx, struct fb_var_screeninfo *var)
|
||||
{
|
||||
u8 ctrl;
|
||||
int ret;
|
||||
u8 data;
|
||||
|
||||
/* cheap blanking: Video Black Mode */
|
||||
ret = i2c_smbus_write_byte_data(tx->client, SII9022_TPI_REG_RQB, 0x20);
|
||||
/* TODO Power down TMDS */
|
||||
|
||||
#if 0
|
||||
ctrl = i2c_smbus_read_byte_data(tx->client, SII9022_TPI_REG_SYS_CTRL);
|
||||
data = i2c_smbus_read_byte_data(tx->client, SII9022_TPI_REG_RQB);
|
||||
|
||||
if (tx->connection_type == CONNECTION_TYPE_HDMI)
|
||||
ctrl |= SII9022_SYS_CTRL_AV_MUTE_HDMI;
|
||||
|
||||
/* step 3: prepare for resolution change */
|
||||
ctrl |= SII9022_SYS_CTRL_TMDS_OUTPUT_POWER_DOWN;
|
||||
ret = i2c_smbus_write_byte_data(tx->client,
|
||||
SII9022_TPI_REG_SYS_CTRL,
|
||||
ctrl);
|
||||
if (ret < 0)
|
||||
DEBUG("unable to prepare blank\n");
|
||||
|
||||
msleep(SII9022_CTRL_INFO_FRAME_DRAIN_TIME);
|
||||
#endif
|
||||
return ret;
|
||||
return i2c_smbus_write_byte_data(tx->client,
|
||||
SII9022_TPI_REG_RQB,
|
||||
data | SII9022_RQB_FORCE_VIDEO_BLANK);
|
||||
}
|
||||
|
||||
static int sii9022_unblank(struct sii9022_tx *tx, struct fb_var_screeninfo *var)
|
||||
{
|
||||
u8 ctrl;
|
||||
int ret;
|
||||
u8 data;
|
||||
|
||||
/* cheap blanking: Video Black Mode */
|
||||
ret = i2c_smbus_write_byte_data(tx->client, SII9022_TPI_REG_RQB, 0x00);
|
||||
/* TODO Power up TMDS */
|
||||
|
||||
#if 0
|
||||
sii9022_set_vmode_registers(tx, var);
|
||||
sii9022_set_avi_info_frame(tx, var);
|
||||
ctrl &= ~SII9022_SYS_CTRL_TMDS_OUTPUT_POWER_DOWN;
|
||||
ctrl &= ~SII9022_SYS_CTRL_AV_MUTE_HDMI;
|
||||
ret = i2c_smbus_write_byte_data(tx->client,
|
||||
SII9022_TPI_REG_SYS_CTRL,
|
||||
ctrl);
|
||||
if (ret < 0)
|
||||
DEBUG("unable to enable the display\n");
|
||||
#endif
|
||||
return ret;
|
||||
data = i2c_smbus_read_byte_data(tx->client, SII9022_TPI_REG_RQB);
|
||||
|
||||
return i2c_smbus_write_byte_data(tx->client,
|
||||
SII9022_TPI_REG_RQB,
|
||||
data & ~SII9022_RQB_FORCE_VIDEO_BLANK);
|
||||
}
|
||||
|
||||
|
||||
@@ -987,10 +964,13 @@ static int sii9022_fb_event_handler(struct notifier_block *nb,
|
||||
struct fb_var_screeninfo var = {0};
|
||||
fb_videomode_to_var(&var, event->info->mode);
|
||||
|
||||
if (*((int *)event->data) == FB_BLANK_UNBLANK)
|
||||
switch (* (int *) event->data)
|
||||
{
|
||||
case FB_BLANK_UNBLANK:
|
||||
return sii9022_unblank(tx, &var);
|
||||
else
|
||||
return sii9022_blank(tx, &var);
|
||||
default:
|
||||
return sii9022_blank(tx, &va);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user