From 1899fde42e7fa23160289178c82751b3b94d86de Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Sun, 3 Feb 2013 00:59:00 +0000 Subject: [PATCH] --- yaml --- r: 354476 b: refs/heads/master c: 7c3e8675f37503337d901dc254cba253326b572a h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/iio/adc/max1363.c | 29 +- trunk/drivers/staging/comedi/comedi_fops.c | 4 +- .../staging/comedi/drivers/ni_daq_dio24.c | 1 - .../staging/comedi/drivers/quatech_daqp_cs.c | 2 +- trunk/drivers/staging/dgrp/dgrp_specproc.c | 68 ++-- trunk/drivers/staging/goldfish/Kconfig | 1 - .../drivers/staging/goldfish/goldfish_nand.c | 8 +- trunk/drivers/staging/xgifb/XGI_main_26.c | 1 - trunk/drivers/staging/xgifb/vb_setmode.c | 305 +++++++++++------- trunk/drivers/staging/zram/zram_drv.c | 2 +- 11 files changed, 239 insertions(+), 184 deletions(-) diff --git a/[refs] b/[refs] index 4984c484ae4b..528698f6615f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5305d746054d1c73e7e9263b25189dedefb2dc01 +refs/heads/master: 7c3e8675f37503337d901dc254cba253326b572a diff --git a/trunk/drivers/iio/adc/max1363.c b/trunk/drivers/iio/adc/max1363.c index 08e4feb4f6ee..c5e46c62ffbb 100644 --- a/trunk/drivers/iio/adc/max1363.c +++ b/trunk/drivers/iio/adc/max1363.c @@ -1410,8 +1410,9 @@ static int max1363_alloc_scan_masks(struct iio_dev *indio_dev) unsigned long *masks; int i; - masks = kzalloc(BITS_TO_LONGS(MAX1363_MAX_CHANNELS)*sizeof(long)* - (st->chip_info->num_modes + 1), GFP_KERNEL); + masks = devm_kzalloc(&indio_dev->dev, + BITS_TO_LONGS(MAX1363_MAX_CHANNELS) * sizeof(long) * + (st->chip_info->num_modes + 1), GFP_KERNEL); if (!masks) return -ENOMEM; @@ -1504,7 +1505,7 @@ static int max1363_probe(struct i2c_client *client, st = iio_priv(indio_dev); - st->reg = regulator_get(&client->dev, "vcc"); + st->reg = devm_regulator_get(&client->dev, "vcc"); if (IS_ERR(st->reg)) { ret = PTR_ERR(st->reg); goto error_unregister_map; @@ -1512,7 +1513,7 @@ static int max1363_probe(struct i2c_client *client, ret = regulator_enable(st->reg); if (ret) - goto error_put_reg; + goto error_unregister_map; /* this is only used for device removal purposes */ i2c_set_clientdata(client, indio_dev); @@ -1533,15 +1534,15 @@ static int max1363_probe(struct i2c_client *client, indio_dev->modes = INDIO_DIRECT_MODE; ret = max1363_initial_setup(st); if (ret < 0) - goto error_free_available_scan_masks; + goto error_disable_reg; ret = iio_triggered_buffer_setup(indio_dev, NULL, &max1363_trigger_handler, &max1363_buffered_setup_ops); if (ret) - goto error_free_available_scan_masks; + goto error_disable_reg; if (client->irq) { - ret = request_threaded_irq(st->client->irq, + ret = devm_request_threaded_irq(&client->dev, st->client->irq, NULL, &max1363_event_handler, IRQF_TRIGGER_RISING | IRQF_ONESHOT, @@ -1554,20 +1555,14 @@ static int max1363_probe(struct i2c_client *client, ret = iio_device_register(indio_dev); if (ret < 0) - goto error_free_irq; + goto error_uninit_buffer; return 0; -error_free_irq: - if (client->irq) - free_irq(st->client->irq, indio_dev); + error_uninit_buffer: iio_triggered_buffer_cleanup(indio_dev); -error_free_available_scan_masks: - kfree(indio_dev->available_scan_masks); error_disable_reg: regulator_disable(st->reg); -error_put_reg: - regulator_put(st->reg); error_unregister_map: iio_map_array_unregister(indio_dev); error_free_device: @@ -1582,12 +1577,8 @@ static int max1363_remove(struct i2c_client *client) struct max1363_state *st = iio_priv(indio_dev); iio_device_unregister(indio_dev); - if (client->irq) - free_irq(st->client->irq, indio_dev); iio_triggered_buffer_cleanup(indio_dev); - kfree(indio_dev->available_scan_masks); regulator_disable(st->reg); - regulator_put(st->reg); iio_map_array_unregister(indio_dev); iio_device_free(indio_dev); diff --git a/trunk/drivers/staging/comedi/comedi_fops.c b/trunk/drivers/staging/comedi/comedi_fops.c index 195d56d8a1ee..b1e8cdbd1ce7 100644 --- a/trunk/drivers/staging/comedi/comedi_fops.c +++ b/trunk/drivers/staging/comedi/comedi_fops.c @@ -2372,7 +2372,7 @@ int comedi_alloc_subdevice_minor(struct comedi_subdevice *s) spin_unlock(&comedi_file_info_table_lock); if (i == COMEDI_NUM_MINORS) { kfree(info); - pr_err("comedi: error: ran out of minor numbers for subdevice files.\n"); + pr_err("comedi: error: ran out of minor numbers for board device files.\n"); return -EBUSY; } s->minor = i; @@ -2383,7 +2383,7 @@ int comedi_alloc_subdevice_minor(struct comedi_subdevice *s) s->class_dev = csdev; dev_set_drvdata(csdev, info); - return 0; + return i; } void comedi_free_subdevice_minor(struct comedi_subdevice *s) diff --git a/trunk/drivers/staging/comedi/drivers/ni_daq_dio24.c b/trunk/drivers/staging/comedi/drivers/ni_daq_dio24.c index e1cc9d01f200..32ee22dbb858 100644 --- a/trunk/drivers/staging/comedi/drivers/ni_daq_dio24.c +++ b/trunk/drivers/staging/comedi/drivers/ni_daq_dio24.c @@ -56,7 +56,6 @@ static int dio24_auto_attach(struct comedi_device *dev, link->config_flags |= CONF_AUTO_SET_IO; ret = comedi_pcmcia_enable(dev, NULL); - if (ret) return ret; dev->iobase = link->resource[0]->start; diff --git a/trunk/drivers/staging/comedi/drivers/quatech_daqp_cs.c b/trunk/drivers/staging/comedi/drivers/quatech_daqp_cs.c index 911eb6b32296..6ab9083a032f 100644 --- a/trunk/drivers/staging/comedi/drivers/quatech_daqp_cs.c +++ b/trunk/drivers/staging/comedi/drivers/quatech_daqp_cs.c @@ -723,7 +723,7 @@ static int daqp_auto_attach(struct comedi_device *dev, dev->private = devpriv; link->config_flags |= CONF_AUTO_SET_IO | CONF_ENABLE_IRQ; - ret = comedi_pcmcia_enable(dev, NULL); + ret = comedi_pcmcia_enable(dev); if (ret) return ret; dev->iobase = link->resource[0]->start; diff --git a/trunk/drivers/staging/dgrp/dgrp_specproc.c b/trunk/drivers/staging/dgrp/dgrp_specproc.c index dfdaede71ff4..e09fc9cf318b 100644 --- a/trunk/drivers/staging/dgrp/dgrp_specproc.c +++ b/trunk/drivers/staging/dgrp/dgrp_specproc.c @@ -81,34 +81,33 @@ static struct dgrp_proc_entry dgrp_mon_table[]; static struct dgrp_proc_entry dgrp_ports_table[]; static struct dgrp_proc_entry dgrp_dpa_table[]; -static ssize_t dgrp_config_proc_write(struct file *file, - const char __user *buffer, - size_t count, loff_t *pos); +static ssize_t config_proc_write(struct file *file, const char __user *buffer, + size_t count, loff_t *pos); -static int dgrp_nodeinfo_proc_open(struct inode *inode, struct file *file); -static int dgrp_info_proc_open(struct inode *inode, struct file *file); -static int dgrp_config_proc_open(struct inode *inode, struct file *file); +static int nodeinfo_proc_open(struct inode *inode, struct file *file); +static int info_proc_open(struct inode *inode, struct file *file); +static int config_proc_open(struct inode *inode, struct file *file); static struct file_operations config_proc_file_ops = { .owner = THIS_MODULE, - .open = dgrp_config_proc_open, + .open = config_proc_open, .read = seq_read, .llseek = seq_lseek, .release = seq_release, - .write = dgrp_config_proc_write, + .write = config_proc_write }; static struct file_operations info_proc_file_ops = { .owner = THIS_MODULE, - .open = dgrp_info_proc_open, + .open = info_proc_open, .read = seq_read, .llseek = seq_lseek, - .release = single_release, + .release = seq_release, }; static struct file_operations nodeinfo_proc_file_ops = { .owner = THIS_MODULE, - .open = dgrp_nodeinfo_proc_open, + .open = nodeinfo_proc_open, .read = seq_read, .llseek = seq_lseek, .release = seq_release, @@ -406,21 +405,21 @@ static int dgrp_gen_proc_close(struct inode *inode, struct file *file) return 0; } -static void *dgrp_config_proc_start(struct seq_file *m, loff_t *pos) +static void *config_proc_start(struct seq_file *m, loff_t *pos) { return seq_list_start_head(&nd_struct_list, *pos); } -static void *dgrp_config_proc_next(struct seq_file *p, void *v, loff_t *pos) +static void *config_proc_next(struct seq_file *p, void *v, loff_t *pos) { return seq_list_next(v, &nd_struct_list, pos); } -static void dgrp_config_proc_stop(struct seq_file *m, void *v) +static void config_proc_stop(struct seq_file *m, void *v) { } -static int dgrp_config_proc_show(struct seq_file *m, void *v) +static int config_proc_show(struct seq_file *m, void *v) { struct nd_struct *nd; char tmp_id[4]; @@ -446,13 +445,13 @@ static int dgrp_config_proc_show(struct seq_file *m, void *v) } static const struct seq_operations proc_config_ops = { - .start = dgrp_config_proc_start, - .next = dgrp_config_proc_next, - .stop = dgrp_config_proc_stop, - .show = dgrp_config_proc_show, + .start = config_proc_start, + .next = config_proc_next, + .stop = config_proc_stop, + .show = config_proc_show }; -static int dgrp_config_proc_open(struct inode *inode, struct file *file) +static int config_proc_open(struct inode *inode, struct file *file) { return seq_open(file, &proc_config_ops); } @@ -463,9 +462,8 @@ static int dgrp_config_proc_open(struct inode *inode, struct file *file) * write) is treated as an independent request. See the "parse" * description for more details. */ -static ssize_t dgrp_config_proc_write(struct file *file, - const char __user *buffer, - size_t count, loff_t *pos) +static ssize_t config_proc_write(struct file *file, const char __user *buffer, + size_t count, loff_t *pos) { ssize_t retval; char *inbuf, *sp; @@ -629,7 +627,7 @@ static int parse_write_config(char *buf) return retval; } -static int dgrp_info_proc_show(struct seq_file *m, void *v) +static int info_proc_show(struct seq_file *m, void *v) { seq_printf(m, "version: %s\n", DIGI_VERSION); seq_puts(m, "register_with_sysfs: 1\n"); @@ -639,27 +637,27 @@ static int dgrp_info_proc_show(struct seq_file *m, void *v) return 0; } -static int dgrp_info_proc_open(struct inode *inode, struct file *file) +static int info_proc_open(struct inode *inode, struct file *file) { - return single_open(file, dgrp_info_proc_show, NULL); + return single_open(file, info_proc_show, NULL); } -static void *dgrp_nodeinfo_start(struct seq_file *m, loff_t *pos) +static void *nodeinfo_start(struct seq_file *m, loff_t *pos) { return seq_list_start_head(&nd_struct_list, *pos); } -static void *dgrp_nodeinfo_next(struct seq_file *p, void *v, loff_t *pos) +static void *nodeinfo_next(struct seq_file *p, void *v, loff_t *pos) { return seq_list_next(v, &nd_struct_list, pos); } -static void dgrp_nodeinfo_stop(struct seq_file *m, void *v) +static void nodeinfo_stop(struct seq_file *m, void *v) { } -static int dgrp_nodeinfo_show(struct seq_file *m, void *v) +static int nodeinfo_show(struct seq_file *m, void *v) { struct nd_struct *nd; char hwver[8]; @@ -701,13 +699,13 @@ static int dgrp_nodeinfo_show(struct seq_file *m, void *v) static const struct seq_operations nodeinfo_ops = { - .start = dgrp_nodeinfo_start, - .next = dgrp_nodeinfo_next, - .stop = dgrp_nodeinfo_stop, - .show = dgrp_nodeinfo_show, + .start = nodeinfo_start, + .next = nodeinfo_next, + .stop = nodeinfo_stop, + .show = nodeinfo_show }; -static int dgrp_nodeinfo_proc_open(struct inode *inode, struct file *file) +static int nodeinfo_proc_open(struct inode *inode, struct file *file) { return seq_open(file, &nodeinfo_ops); } diff --git a/trunk/drivers/staging/goldfish/Kconfig b/trunk/drivers/staging/goldfish/Kconfig index 4e094602437c..d6c98d0d81e7 100644 --- a/trunk/drivers/staging/goldfish/Kconfig +++ b/trunk/drivers/staging/goldfish/Kconfig @@ -7,7 +7,6 @@ config GOLDFISH_AUDIO config MTD_GOLDFISH_NAND tristate "Goldfish NAND device" depends on GOLDFISH - depends on MTD help Drives the emulated NAND flash device on the Google Goldfish Android virtual device. diff --git a/trunk/drivers/staging/goldfish/goldfish_nand.c b/trunk/drivers/staging/goldfish/goldfish_nand.c index ab1f01952b48..1891d89630dc 100644 --- a/trunk/drivers/staging/goldfish/goldfish_nand.c +++ b/trunk/drivers/staging/goldfish/goldfish_nand.c @@ -156,7 +156,7 @@ static int goldfish_nand_read_oob(struct mtd_info *mtd, loff_t ofs, return 0; invalid_arg: - pr_err("goldfish_nand_read_oob: invalid read, start %llx, len %zx, ooblen %zx, dev_size %llx, write_size %x\n", + pr_err("goldfish_nand_read_oob: invalid read, start %llx, len %x, ooblen %x, dev_size %llx, write_size %x\n", ofs, ops->len, ops->ooblen, mtd->size, mtd->writesize); return -EINVAL; } @@ -188,7 +188,7 @@ static int goldfish_nand_write_oob(struct mtd_info *mtd, loff_t ofs, return 0; invalid_arg: - pr_err("goldfish_nand_write_oob: invalid write, start %llx, len %zx, ooblen %zx, dev_size %llx, write_size %x\n", + pr_err("goldfish_nand_write_oob: invalid write, start %llx, len %x, ooblen %x, dev_size %llx, write_size %x\n", ofs, ops->len, ops->ooblen, mtd->size, mtd->writesize); return -EINVAL; } @@ -212,7 +212,7 @@ static int goldfish_nand_read(struct mtd_info *mtd, loff_t from, size_t len, return 0; invalid_arg: - pr_err("goldfish_nand_read: invalid read, start %llx, len %zx, dev_size %llx, write_size %x\n", + pr_err("goldfish_nand_read: invalid read, start %llx, len %x, dev_size %llx, write_size %x\n", from, len, mtd->size, mtd->writesize); return -EINVAL; } @@ -236,7 +236,7 @@ static int goldfish_nand_write(struct mtd_info *mtd, loff_t to, size_t len, return 0; invalid_arg: - pr_err("goldfish_nand_write: invalid write, start %llx, len %zx, dev_size %llx, write_size %x\n", + pr_err("goldfish_nand_write: invalid write, start %llx, len %x, dev_size %llx, write_size %x\n", to, len, mtd->size, mtd->writesize); return -EINVAL; } diff --git a/trunk/drivers/staging/xgifb/XGI_main_26.c b/trunk/drivers/staging/xgifb/XGI_main_26.c index 801ac4053a7a..387d1bd0c418 100644 --- a/trunk/drivers/staging/xgifb/XGI_main_26.c +++ b/trunk/drivers/staging/xgifb/XGI_main_26.c @@ -209,7 +209,6 @@ void XGIRegInit(struct vb_device_info *XGI_Pr, unsigned long BaseAddr) XGI_Pr->P3c0 = BaseAddr + 0x10; XGI_Pr->P3ce = BaseAddr + 0x1e; XGI_Pr->P3c2 = BaseAddr + 0x12; - XGI_Pr->P3cc = BaseAddr + 0x1c; XGI_Pr->P3ca = BaseAddr + 0x1a; XGI_Pr->P3c6 = BaseAddr + 0x16; XGI_Pr->P3c7 = BaseAddr + 0x17; diff --git a/trunk/drivers/staging/xgifb/vb_setmode.c b/trunk/drivers/staging/xgifb/vb_setmode.c index 3d5c4244c809..bd816567ab2a 100644 --- a/trunk/drivers/staging/xgifb/vb_setmode.c +++ b/trunk/drivers/staging/xgifb/vb_setmode.c @@ -865,42 +865,53 @@ static unsigned short XGI_GetVCLK2Ptr(unsigned short ModeNo, /* si+Ext_ResInfo */ modeflag = XGI330_EModeIDTable[ModeIdIndex].Ext_ModeFlag; - if (pVBInfo->VBInfo & (SetCRT2ToLCD | XGI_SetCRT2ToLCDA)) { /*301b*/ - if (pVBInfo->LCDResInfo != Panel_1024x768) - /* LCDXlat2VCLK */ - VCLKIndex = VCLK108_2_315 + 5; - else - VCLKIndex = VCLK65_315 + 2; /* LCDXlat1VCLK */ - } else if (pVBInfo->VBInfo & SetCRT2ToHiVision) { - if (pVBInfo->SetFlag & RPLLDIV2XO) - VCLKIndex = TVCLKBASE_315_25 + HiTVVCLKDIV2; - else - VCLKIndex = TVCLKBASE_315_25 + HiTVVCLK; + if (pVBInfo->IF_DEF_LVDS == 0) { + if (pVBInfo->VBInfo & + (SetCRT2ToLCD | XGI_SetCRT2ToLCDA)) { /*301b*/ + if (pVBInfo->LCDResInfo != Panel_1024x768) + /* LCDXlat2VCLK */ + VCLKIndex = VCLK108_2_315 + 5; + else + VCLKIndex = VCLK65_315 + 2; /* LCDXlat1VCLK */ + } else if (pVBInfo->VBInfo & SetCRT2ToHiVision) { + if (pVBInfo->SetFlag & RPLLDIV2XO) + VCLKIndex = TVCLKBASE_315_25 + HiTVVCLKDIV2; + else + VCLKIndex = TVCLKBASE_315_25 + HiTVVCLK; - if (pVBInfo->SetFlag & TVSimuMode) { - if (modeflag & Charx8Dot) { - VCLKIndex = TVCLKBASE_315_25 + HiTVSimuVCLK; - } else { - VCLKIndex = TVCLKBASE_315_25 + HiTVTextVCLK; + if (pVBInfo->SetFlag & TVSimuMode) { + if (modeflag & Charx8Dot) { + VCLKIndex = TVCLKBASE_315_25 + + HiTVSimuVCLK; + } else { + VCLKIndex = TVCLKBASE_315_25 + + HiTVTextVCLK; + } } - } - /* 301lv */ - if (pVBInfo->VBType & VB_SIS301LV) { + /* 301lv */ + if (pVBInfo->VBType & VB_SIS301LV) { + if (pVBInfo->SetFlag & RPLLDIV2XO) + VCLKIndex = YPbPr525iVCLK_2; + else + VCLKIndex = YPbPr525iVCLK; + } + } else if (pVBInfo->VBInfo & SetCRT2ToTV) { if (pVBInfo->SetFlag & RPLLDIV2XO) - VCLKIndex = YPbPr525iVCLK_2; + VCLKIndex = TVCLKBASE_315_25 + TVVCLKDIV2; else - VCLKIndex = YPbPr525iVCLK; + VCLKIndex = TVCLKBASE_315_25 + TVVCLK; + } else { /* for CRT2 */ + /* di+Ext_CRTVCLK */ + VCLKIndex = XGI330_RefIndex[RefreshRateTableIndex]. + Ext_CRTVCLK; + VCLKIndex &= IndexMask; } - } else if (pVBInfo->VBInfo & SetCRT2ToTV) { - if (pVBInfo->SetFlag & RPLLDIV2XO) - VCLKIndex = TVCLKBASE_315_25 + TVVCLKDIV2; - else - VCLKIndex = TVCLKBASE_315_25 + TVVCLK; - } else { /* for CRT2 */ - /* di+Ext_CRTVCLK */ - VCLKIndex = XGI330_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK; - VCLKIndex &= IndexMask; + } else if ((pVBInfo->LCDResInfo == Panel_800x600) || + (pVBInfo->LCDResInfo == Panel_320x480)) { /* LVDS */ + VCLKIndex = VCLK40; /* LVDSXlat1VCLK */ + } else { + VCLKIndex = VCLK65_315 + 2; /* LVDSXlat2VCLK, LVDSXlat3VCLK */ } return VCLKIndex; @@ -1994,28 +2005,40 @@ static void XGI_GetVBInfo(unsigned short ModeNo, unsigned short ModeIdIndex, temp = xgifb_reg_get(pVBInfo->P3d4, 0x38); - if (pVBInfo->VBType & (VB_SIS302B | VB_SIS301LV | VB_SIS302LV | - VB_XGI301C)) { - if (temp & EnableDualEdge) { - tempbx |= SetCRT2ToDualEdge; - if (temp & SetToLCDA) - tempbx |= XGI_SetCRT2ToLCDA; + if (pVBInfo->IF_DEF_LVDS == 0) { + if (pVBInfo->VBType & + (VB_SIS302B | + VB_SIS301LV | + VB_SIS302LV | + VB_XGI301C)) { + if (temp & EnableDualEdge) { + tempbx |= SetCRT2ToDualEdge; + if (temp & SetToLCDA) + tempbx |= XGI_SetCRT2ToLCDA; + } } } if (pVBInfo->IF_DEF_YPbPr == 1) { - if (pVBInfo->VBType & (VB_SIS301LV|VB_SIS302LV|VB_XGI301C)) { + if (((pVBInfo->IF_DEF_LVDS == 0) && + ((pVBInfo->VBType & VB_SIS301LV) || + (pVBInfo->VBType & VB_SIS302LV) || + (pVBInfo->VBType & VB_XGI301C)))) { if (temp & SetYPbPr) { if (pVBInfo->IF_DEF_HiVision == 1) { - /* shampoo add for new scratch */ - temp = xgifb_reg_get(pVBInfo->P3d4, - 0x35); + /* shampoo add for new + * scratch */ + temp = xgifb_reg_get( + pVBInfo->P3d4, + 0x35); temp &= YPbPrMode; tempbx |= SetCRT2ToHiVision; if (temp != YPbPrMode1080i) { - tempbx &= (~SetCRT2ToHiVision); - tempbx |= SetCRT2ToYPbPr525750; + tempbx &= + (~SetCRT2ToHiVision); + tempbx |= + SetCRT2ToYPbPr525750; } } } @@ -2024,15 +2047,19 @@ static void XGI_GetVBInfo(unsigned short ModeNo, unsigned short ModeIdIndex, tempax = push; /* restore CR31 */ - if (pVBInfo->IF_DEF_YPbPr == 1) { - if (pVBInfo->IF_DEF_HiVision == 1) - temp = 0x09FC; - else - temp = 0x097C; - } else if (pVBInfo->IF_DEF_HiVision == 1) { - temp = 0x01FC; - } else { - temp = 0x017C; + if (pVBInfo->IF_DEF_LVDS == 0) { + if (pVBInfo->IF_DEF_YPbPr == 1) { + if (pVBInfo->IF_DEF_HiVision == 1) + temp = 0x09FC; + else + temp = 0x097C; + } else if (pVBInfo->IF_DEF_HiVision == 1) { + temp = 0x01FC; + } else { + temp = 0x017C; + } + } else { /* 3rd party chip */ + temp = SetCRT2ToLCD; } if (!(tempbx & temp)) { @@ -2043,11 +2070,14 @@ static void XGI_GetVBInfo(unsigned short ModeNo, unsigned short ModeIdIndex, if (!(pVBInfo->VBType & VB_NoLCD)) { if (tempbx & XGI_SetCRT2ToLCDA) { if (tempbx & SetSimuScanMode) - tempbx &= (~(SetCRT2ToLCD | SetCRT2ToRAMDAC | + tempbx &= (~(SetCRT2ToLCD | + SetCRT2ToRAMDAC | SwitchCRT2)); else - tempbx &= (~(SetCRT2ToLCD | SetCRT2ToRAMDAC | - SetCRT2ToTV | SwitchCRT2)); + tempbx &= (~(SetCRT2ToLCD | + SetCRT2ToRAMDAC | + SetCRT2ToTV | + SwitchCRT2)); } } @@ -2056,38 +2086,49 @@ static void XGI_GetVBInfo(unsigned short ModeNo, unsigned short ModeIdIndex, if (!(tempbx & (SwitchCRT2 | SetSimuScanMode))) { if (pVBInfo->IF_DEF_CRT2Monitor == 1) { if (tempbx & SetCRT2ToRAMDAC) { - tempbx &= (0xFF00 | SetCRT2ToRAMDAC | - SwitchCRT2 | SetSimuScanMode); + tempbx &= (0xFF00 | + SetCRT2ToRAMDAC | + SwitchCRT2 | + SetSimuScanMode); tempbx &= (0x00FF | (~SetCRT2ToYPbPr525750)); } } else { - tempbx &= (~(SetCRT2ToRAMDAC | SetCRT2ToLCD | + tempbx &= (~(SetCRT2ToRAMDAC | + SetCRT2ToLCD | SetCRT2ToTV)); } } if (!(pVBInfo->VBType & VB_NoLCD)) { if (tempbx & SetCRT2ToLCD) { - tempbx &= (0xFF00 | SetCRT2ToLCD | SwitchCRT2 | + tempbx &= (0xFF00 | + SetCRT2ToLCD | + SwitchCRT2 | SetSimuScanMode); tempbx &= (0x00FF | (~SetCRT2ToYPbPr525750)); } } if (tempbx & SetCRT2ToSCART) { - tempbx &= (0xFF00 | SetCRT2ToSCART | SwitchCRT2 | + tempbx &= (0xFF00 | + SetCRT2ToSCART | + SwitchCRT2 | SetSimuScanMode); tempbx &= (0x00FF | (~SetCRT2ToYPbPr525750)); } if (pVBInfo->IF_DEF_YPbPr == 1) { if (tempbx & SetCRT2ToYPbPr525750) - tempbx &= (0xFF00 | SwitchCRT2 | SetSimuScanMode); + tempbx &= (0xFF00 | + SwitchCRT2 | + SetSimuScanMode); } if (pVBInfo->IF_DEF_HiVision == 1) { if (tempbx & SetCRT2ToHiVision) - tempbx &= (0xFF00 | SetCRT2ToHiVision | SwitchCRT2 | + tempbx &= (0xFF00 | + SetCRT2ToHiVision | + SwitchCRT2 | SetSimuScanMode); } @@ -2097,15 +2138,19 @@ static void XGI_GetVBInfo(unsigned short ModeNo, unsigned short ModeIdIndex, } if (!(tempbx & DisableCRT2Display)) { - if ((!(tempbx & DriverMode)) || (!(modeflag & CRT2Mode))) { + if ((!(tempbx & DriverMode)) || + (!(modeflag & CRT2Mode))) { if (!(tempbx & XGI_SetCRT2ToLCDA)) - tempbx |= (SetInSlaveMode | SetSimuScanMode); + tempbx |= (SetInSlaveMode | + SetSimuScanMode); } /* LCD+TV can't support in slave mode * (Force LCDA+TV->LCDB) */ - if ((tempbx & SetInSlaveMode) && (tempbx & XGI_SetCRT2ToLCDA)) { - tempbx ^= (SetCRT2ToLCD | XGI_SetCRT2ToLCDA | + if ((tempbx & SetInSlaveMode) && + (tempbx & XGI_SetCRT2ToLCDA)) { + tempbx ^= (SetCRT2ToLCD | + XGI_SetCRT2ToLCDA | SetCRT2ToDualEdge); pVBInfo->SetFlag |= ReserveTVOption; } @@ -2137,8 +2182,10 @@ static void XGI_GetTVInfo(unsigned short ModeNo, unsigned short ModeIdIndex, TVSetNTSCJ | TVSetPAL); - if (pVBInfo->VBInfo & SetCRT2ToSCART) - tempbx |= TVSetPAL; + if (pVBInfo->IF_DEF_LVDS == 0) { + if (pVBInfo->VBInfo & SetCRT2ToSCART) + tempbx |= TVSetPAL; + } if (pVBInfo->IF_DEF_YPbPr == 1) { if (pVBInfo->VBInfo & SetCRT2ToYPbPr525750) { @@ -2160,26 +2207,33 @@ static void XGI_GetTVInfo(unsigned short ModeNo, unsigned short ModeIdIndex, tempbx = tempbx | TVSetHiVision | TVSetPAL; } - if ((pVBInfo->VBInfo & SetInSlaveMode) && - (!(pVBInfo->VBInfo & SetNotSimuMode))) - tempbx |= TVSimuMode; + if (pVBInfo->IF_DEF_LVDS == 0) { /* shampoo */ + if ((pVBInfo->VBInfo & SetInSlaveMode) && + (!(pVBInfo->VBInfo & SetNotSimuMode))) + tempbx |= TVSimuMode; - if (!(tempbx & TVSetPAL) && (modeflag > 13) && (resinfo == 8)) - /* NTSC 1024x768, */ - tempbx |= NTSC1024x768; + if (!(tempbx & TVSetPAL) && + (modeflag > 13) && + (resinfo == 8)) /* NTSC 1024x768, */ + tempbx |= NTSC1024x768; - tempbx |= RPLLDIV2XO; + tempbx |= RPLLDIV2XO; - if (pVBInfo->VBInfo & SetCRT2ToHiVision) { - if (pVBInfo->VBInfo & SetInSlaveMode) - tempbx &= (~RPLLDIV2XO); - } else if (tempbx & (TVSetYPbPr525p | TVSetYPbPr750p)) { - tempbx &= (~RPLLDIV2XO); - } else if (!(pVBInfo->VBType & (VB_SIS301B | VB_SIS302B | - VB_SIS301LV | VB_SIS302LV | - VB_XGI301C))) { - if (tempbx & TVSimuMode) - tempbx &= (~RPLLDIV2XO); + if (pVBInfo->VBInfo & SetCRT2ToHiVision) { + if (pVBInfo->VBInfo & SetInSlaveMode) + tempbx &= (~RPLLDIV2XO); + } else if (tempbx & + (TVSetYPbPr525p | TVSetYPbPr750p)) { + tempbx &= (~RPLLDIV2XO); + } else if (!(pVBInfo->VBType & + (VB_SIS301B | + VB_SIS302B | + VB_SIS301LV | + VB_SIS302LV | + VB_XGI301C))) { + if (tempbx & TVSimuMode) + tempbx &= (~RPLLDIV2XO); + } } } pVBInfo->TVInfo = tempbx; @@ -2240,18 +2294,21 @@ static unsigned char XGI_GetLCDInfo(unsigned short ModeNo, tempax = pVBInfo->LCDCapList[LCDIdIndex].LCD_Capability; - if (((pVBInfo->VBType & VB_SIS302LV) || - (pVBInfo->VBType & VB_XGI301C)) && (tempax & XGI_LCDDualLink)) - tempbx |= SetLCDDualLink; + if (pVBInfo->IF_DEF_LVDS == 0) { /* shampoo */ + if (((pVBInfo->VBType & VB_SIS302LV) || (pVBInfo->VBType + & VB_XGI301C)) && (tempax & XGI_LCDDualLink)) { + tempbx |= SetLCDDualLink; + } - if ((pVBInfo->LCDResInfo == Panel_1400x1050) && - (pVBInfo->VBInfo & SetCRT2ToLCD) && (resinfo == 9) && - (!(tempbx & EnableScalingLCD))) - /* - * set to center in 1280x1024 LCDB - * for Panel_1400x1050 - */ - tempbx |= SetLCDtoNonExpanding; + if ((pVBInfo->LCDResInfo == Panel_1400x1050) && (pVBInfo->VBInfo + & SetCRT2ToLCD) && (resinfo == 9) && + (!(tempbx & EnableScalingLCD))) + /* + * set to center in 1280x1024 LCDB + * for Panel_1400x1050 + */ + tempbx |= SetLCDtoNonExpanding; + } if (pVBInfo->VBInfo & SetInSlaveMode) { if (pVBInfo->VBInfo & SetNotSimuMode) @@ -2526,34 +2583,36 @@ static void XGI_GetCRT2ResInfo(unsigned short ModeNo, if (!(pVBInfo->VBInfo & SetCRT2ToLCD)) goto exit; - if (pVBInfo->LCDResInfo == Panel_1600x1200) { - if (!(pVBInfo->LCDInfo & XGI_LCDVESATiming)) { - if (yres == 1024) - yres = 1056; + if (pVBInfo->IF_DEF_LVDS == 0) { + if (pVBInfo->LCDResInfo == Panel_1600x1200) { + if (!(pVBInfo->LCDInfo & XGI_LCDVESATiming)) { + if (yres == 1024) + yres = 1056; + } } - } - if (pVBInfo->LCDResInfo == Panel_1280x1024) { - if (yres == 400) - yres = 405; - else if (yres == 350) - yres = 360; + if (pVBInfo->LCDResInfo == Panel_1280x1024) { + if (yres == 400) + yres = 405; + else if (yres == 350) + yres = 360; - if (pVBInfo->LCDInfo & XGI_LCDVESATiming) { - if (yres == 360) - yres = 375; + if (pVBInfo->LCDInfo & XGI_LCDVESATiming) { + if (yres == 360) + yres = 375; + } } - } - if (pVBInfo->LCDResInfo == Panel_1024x768) { - if (!(pVBInfo->LCDInfo & XGI_LCDVESATiming)) { - if (!(pVBInfo->LCDInfo & LCDNonExpanding)) { - if (yres == 350) - yres = 357; - else if (yres == 400) - yres = 420; - else if (yres == 480) - yres = 525; + if (pVBInfo->LCDResInfo == Panel_1024x768) { + if (!(pVBInfo->LCDInfo & XGI_LCDVESATiming)) { + if (!(pVBInfo->LCDInfo & LCDNonExpanding)) { + if (yres == 350) + yres = 357; + else if (yres == 400) + yres = 420; + else if (yres == 480) + yres = 525; + } } } } @@ -4863,6 +4922,16 @@ static void XGI_SetDelayComp(struct vb_device_info *pVBInfo) } xgifb_reg_set(pVBInfo->Part1Port, 0x2D, tempah); } + } else if (pVBInfo->IF_DEF_LVDS == 1) { + tempbl = 0; + tempbh = 0; + if (pVBInfo->VBInfo & SetCRT2ToLCD) { + tempah = XGI301LCDDelay; + tempah &= 0x0f; + tempah = tempah << 4; + xgifb_reg_and_or(pVBInfo->Part1Port, 0x2D, 0x0f, + tempah); + } } } diff --git a/trunk/drivers/staging/zram/zram_drv.c b/trunk/drivers/staging/zram/zram_drv.c index 6094e80aac10..9ac140bbabc5 100644 --- a/trunk/drivers/staging/zram/zram_drv.c +++ b/trunk/drivers/staging/zram/zram_drv.c @@ -464,7 +464,7 @@ static void zram_make_request(struct request_queue *queue, struct bio *bio) bio_io_error(bio); } -static void __zram_reset_device(struct zram *zram) +void __zram_reset_device(struct zram *zram) { size_t index; struct zram_meta *meta;