* Re: [PATCHv2 07/10] fbdev: ssd1307fb: Add module parameter to set refresh rate of the display
From: Maxime Ripard @ 2015-03-05 22:12 UTC (permalink / raw)
To: Thomas Niederprüm
Cc: plagnioj, tomi.valkeinen, linux-fbdev, linux-kernel
In-Reply-To: <1425248883-25367-8-git-send-email-niederp@physik.uni-kl.de>
[-- Attachment #1: Type: text/plain, Size: 2374 bytes --]
On Sun, Mar 01, 2015 at 11:28:00PM +0100, Thomas Niederprüm wrote:
> This patch adds the module parameter "refreshrate" to set delay for the
> deferred io. The refresh rate is given in units of Hertz. The default
> refresh rate is 1 Hz.
>
> Signed-off-by: Thomas Niederprüm <niederp@physik.uni-kl.de>
> ---
> drivers/video/fbdev/ssd1307fb.c | 23 +++++++++++++++++------
> 1 file changed, 17 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c
> index c7ed287..ea58e87 100644
> --- a/drivers/video/fbdev/ssd1307fb.c
> +++ b/drivers/video/fbdev/ssd1307fb.c
> @@ -43,6 +43,11 @@
> #define SSD1307FB_SET_COM_PINS_CONFIG 0xda
> #define SSD1307FB_SET_VCOMH 0xdb
>
> +#define REFRASHRATE 1
> +
> +static u_int refreshrate = REFRASHRATE;
> +module_param(refreshrate, uint, 0);
> +
> static u_int contrast = 128;
> module_param(contrast, uint, S_IRUGO);
>
> @@ -270,11 +275,6 @@ static void ssd1307fb_deferred_io(struct fb_info *info,
> ssd1307fb_update_display(info->par);
> }
>
> -static struct fb_deferred_io ssd1307fb_defio = {
> - .delay = HZ,
> - .deferred_io = ssd1307fb_deferred_io,
> -};
> -
> static int ssd1307fb_init(struct ssd1307fb_par *par)
> {
> int ret;
> @@ -475,6 +475,7 @@ static int ssd1307fb_probe(struct i2c_client *client,
> {
> struct fb_info *info;
> struct device_node *node = client->dev.of_node;
> + struct fb_deferred_io *ssd1307fb_defio;
> u32 vmem_size;
> struct ssd1307fb_par *par;
> u8 *vmem;
> @@ -544,10 +545,20 @@ static int ssd1307fb_probe(struct i2c_client *client,
> goto fb_alloc_error;
> }
>
> + ssd1307fb_defio = devm_kzalloc(&client->dev, sizeof(struct fb_deferred_io), GFP_KERNEL);
> + if (!ssd1307fb_defio) {
> + dev_err(&client->dev, "Couldn't allocate deferred io.\n");
> + ret = -ENOMEM;
> + goto fb_alloc_error;
> + }
> +
> + ssd1307fb_defio->delay = HZ/refreshrate;
a space around the operator.
I'm not so sure this is a good solution, since you might perfectly
want to have an SSD1305 with a refreshrate of 1Hz, and an SSD1306 with
a refreshrate of 20Hz.
Unfortunately, beside sysfs, I don't really have a better suggestion.
Thanks!
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH] staging/sm7xxfb: Make 'struct vgamode' static
From: Greg KH @ 2015-03-07 0:36 UTC (permalink / raw)
To: Peter Senna Tschudin
Cc: sudipm.mukherjee, teddy.wang, linux-fbdev, devel, linux-kernel
In-Reply-To: <1424690176-7966-1-git-send-email-peter.senna@gmail.com>
On Mon, Feb 23, 2015 at 12:16:16PM +0100, Peter Senna Tschudin wrote:
> sparse was complaining that symbol 'vgamode' was not declared.
>
> Declaring vgamode as static.
>
> Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
> ---
> Tested by compilation only
>
> drivers/staging/sm7xxfb/sm7xx.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
As was mentioned, someone sent this before you did, sorry.
^ permalink raw reply
* Re: [PATCH 1/2] staging: sm750fb: add sm750 to staging
From: Greg Kroah-Hartman @ 2015-03-07 0:38 UTC (permalink / raw)
To: Sudip Mukherjee; +Cc: linux-kernel, devel, linux-fbdev
In-Reply-To: <1425379867-2176-2-git-send-email-sudipm.mukherjee@gmail.com>
On Tue, Mar 03, 2015 at 04:21:06PM +0530, Sudip Mukherjee wrote:
> sm750 of Silicon Motion is pci-e display controller device and has
> features like dual display and 2D acceleration. This patch adds the
> driver to staging.
>
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> ---
>
> this patch has lots of checkpatch warnings including some trailing whitespaces.
And it has build warnings as well. Please send me patches to fix that
up as soon as possible, you will start to get nasty emails from the
0-day build bot about them...
^ permalink raw reply
* Re: [PATCH 1/2] staging: sm750fb: add sm750 to staging
From: Sudip Mukherjee @ 2015-03-07 11:20 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-kernel, devel, linux-fbdev
In-Reply-To: <20150307003834.GA2577@kroah.com>
On Fri, Mar 06, 2015 at 04:38:34PM -0800, Greg Kroah-Hartman wrote:
> On Tue, Mar 03, 2015 at 04:21:06PM +0530, Sudip Mukherjee wrote:
> > ---
> >
> > this patch has lots of checkpatch warnings including some trailing whitespaces.
>
> And it has build warnings as well. Please send me patches to fix that
> up as soon as possible, you will start to get nasty emails from the
> 0-day build bot about them...
so build warning should be the first priority? ok, i will have something ready for you over the weekend.
and i also have few more patches queued up for staging/sm7xxfb and staging/panel, will send you that as soon as you have added my existing ones to staging-next.
regards
sudip
^ permalink raw reply
* Re: [PATCH 1/4] staging: sm750fb: wrong type for print
From: Giedrius Statkevičius @ 2015-03-08 12:40 UTC (permalink / raw)
To: Sudip Mukherjee, Greg Kroah-Hartman; +Cc: devel, linux-fbdev, linux-kernel
In-Reply-To: <1425817886-14387-1-git-send-email-sudipm.mukherjee@gmail.com>
On 2015.03.08 14:31, Sudip Mukherjee wrote:
> mention correct format specifier while printing
>
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> ---
>
> this patch will give checkpatch warnings about use of printk.
> this patch was mainly to fix the build warnings. printk will be
> converted to pr_* and dev_* in a later patch.
>
> drivers/staging/sm750fb/sm750.c | 24 ++++++++++++------------
> drivers/staging/sm750fb/sm750.h | 8 ++++----
> drivers/staging/sm750fb/sm750_hw.c | 4 ++--
> 3 files changed, 18 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
> index 520c69e..753869e 100644
> --- a/drivers/staging/sm750fb/sm750.c
> +++ b/drivers/staging/sm750fb/sm750.c
> @@ -530,20 +530,20 @@ static int lynxfb_ops_mmap(struct fb_info * info, struct vm_area_struct * vma)
> if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT))
> return -EINVAL;
> off = vma->vm_pgoff << PAGE_SHIFT;
> - printk("lynxfb mmap pgoff: %x\n", vma->vm_pgoff);
> - printk("lynxfb mmap off 1: %x\n", off);
> + printk("lynxfb mmap pgoff: %lx\n", vma->vm_pgoff);
> + printk("lynxfb mmap off 1: %lx\n", off);
>
> /* frame buffer memory */
> start = info->fix.smem_start;
> len = PAGE_ALIGN((start & ~PAGE_MASK) + info->fix.smem_len);
>
> - printk("lynxfb mmap start 1: %x\n", start);
> + printk("lynxfb mmap start 1: %lx\n", start);
> printk("lynxfb mmap len 1: %x\n", len);
>
> if (off >= len) {
> /* memory mapped io */
> off -= len;
> - printk("lynxfb mmap off 2: %x\n", off);
> + printk("lynxfb mmap off 2: %lx\n", off);
> if (info->var.accel_flags) {
> printk("lynxfb mmap accel flags true");
> return -EINVAL;
> @@ -551,28 +551,28 @@ static int lynxfb_ops_mmap(struct fb_info * info, struct vm_area_struct * vma)
> start = info->fix.mmio_start;
> len = PAGE_ALIGN((start & ~PAGE_MASK) + info->fix.mmio_len);
>
> - printk("lynxfb mmap start 2: %x\n", start);
> + printk("lynxfb mmap start 2: %lx\n", start);
> printk("lynxfb mmap len 2: %x\n", len);
> }
> start &= PAGE_MASK;
> - printk("lynxfb mmap start 3: %x\n", start);
> - printk("lynxfb mmap vm start: %x\n", vma->vm_start);
> - printk("lynxfb mmap vm end: %x\n", vma->vm_end);
> + printk("lynxfb mmap start 3: %lx\n", start);
> + printk("lynxfb mmap vm start: %lx\n", vma->vm_start);
> + printk("lynxfb mmap vm end: %lx\n", vma->vm_end);
> printk("lynxfb mmap len: %x\n", len);
> - printk("lynxfb mmap off: %x\n", off);
> + printk("lynxfb mmap off: %lx\n", off);
> if ((vma->vm_end - vma->vm_start + off) > len)
> {
> return -EINVAL;
> }
> off += start;
> - printk("lynxfb mmap off 3: %x\n", off);
> + printk("lynxfb mmap off 3: %lx\n", off);
> vma->vm_pgoff = off >> PAGE_SHIFT;
> /* This is an IO map - tell maydump to skip this VMA */
> vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP;
> vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
> fb_pgprotect(file, vma, off);
> - printk("lynxfb mmap off 4: %x\n", off);
> - printk("lynxfb mmap pgprot: %x\n", vma->vm_page_prot);
> + printk("lynxfb mmap off 4: %lx\n", off);
> + printk("lynxfb mmap pgprot: %lx\n", (unsigned long) pgprot_val(vma->vm_page_prot));
> if (io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT,
> vma->vm_end - vma->vm_start, vma->vm_page_prot))
> return -EAGAIN;
> diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h
> index 711676c..2ab7b74 100644
> --- a/drivers/staging/sm750fb/sm750.h
> +++ b/drivers/staging/sm750fb/sm750.h
> @@ -59,10 +59,10 @@ struct lynx_share{
> }mtrr;
> #endif
> /* all smi graphic adaptor got below attributes */
> - resource_size_t vidmem_start;
> - resource_size_t vidreg_start;
> - resource_size_t vidmem_size;
> - resource_size_t vidreg_size;
> + unsigned long vidmem_start;
> + unsigned long vidreg_start;
> + unsigned long vidmem_size;
> + unsigned long vidreg_size;
Have you checked other places where these are used? resource_size_t can
be either u64 or u32 depending on if CONFIG_PHYS_ADDR_T_64BIT is
#defined. Are you sure you aren't losing information when results of
functions are being assigned to this? Maybe there should be a function
similar to printk that changes between %u and %llu depending on whether
that is defined?
--
Thanks,
Giedrius
^ permalink raw reply
* [PATCH 1/4] staging: sm750fb: wrong type for print
From: Sudip Mukherjee @ 2015-03-08 12:43 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Sudip Mukherjee, linux-fbdev, devel, linux-kernel
In-Reply-To: <54FC4323.3010909@gmail.com>
mention correct format specifier while printing
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
this patch will give checkpatch warnings about use of printk.
this patch was mainly to fix the build warnings. printk will be
converted to pr_* and dev_* in a later patch.
drivers/staging/sm750fb/sm750.c | 24 ++++++++++++------------
drivers/staging/sm750fb/sm750.h | 8 ++++----
drivers/staging/sm750fb/sm750_hw.c | 4 ++--
3 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 520c69e..753869e 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -530,20 +530,20 @@ static int lynxfb_ops_mmap(struct fb_info * info, struct vm_area_struct * vma)
if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT))
return -EINVAL;
off = vma->vm_pgoff << PAGE_SHIFT;
- printk("lynxfb mmap pgoff: %x\n", vma->vm_pgoff);
- printk("lynxfb mmap off 1: %x\n", off);
+ printk("lynxfb mmap pgoff: %lx\n", vma->vm_pgoff);
+ printk("lynxfb mmap off 1: %lx\n", off);
/* frame buffer memory */
start = info->fix.smem_start;
len = PAGE_ALIGN((start & ~PAGE_MASK) + info->fix.smem_len);
- printk("lynxfb mmap start 1: %x\n", start);
+ printk("lynxfb mmap start 1: %lx\n", start);
printk("lynxfb mmap len 1: %x\n", len);
if (off >= len) {
/* memory mapped io */
off -= len;
- printk("lynxfb mmap off 2: %x\n", off);
+ printk("lynxfb mmap off 2: %lx\n", off);
if (info->var.accel_flags) {
printk("lynxfb mmap accel flags true");
return -EINVAL;
@@ -551,28 +551,28 @@ static int lynxfb_ops_mmap(struct fb_info * info, struct vm_area_struct * vma)
start = info->fix.mmio_start;
len = PAGE_ALIGN((start & ~PAGE_MASK) + info->fix.mmio_len);
- printk("lynxfb mmap start 2: %x\n", start);
+ printk("lynxfb mmap start 2: %lx\n", start);
printk("lynxfb mmap len 2: %x\n", len);
}
start &= PAGE_MASK;
- printk("lynxfb mmap start 3: %x\n", start);
- printk("lynxfb mmap vm start: %x\n", vma->vm_start);
- printk("lynxfb mmap vm end: %x\n", vma->vm_end);
+ printk("lynxfb mmap start 3: %lx\n", start);
+ printk("lynxfb mmap vm start: %lx\n", vma->vm_start);
+ printk("lynxfb mmap vm end: %lx\n", vma->vm_end);
printk("lynxfb mmap len: %x\n", len);
- printk("lynxfb mmap off: %x\n", off);
+ printk("lynxfb mmap off: %lx\n", off);
if ((vma->vm_end - vma->vm_start + off) > len)
{
return -EINVAL;
}
off += start;
- printk("lynxfb mmap off 3: %x\n", off);
+ printk("lynxfb mmap off 3: %lx\n", off);
vma->vm_pgoff = off >> PAGE_SHIFT;
/* This is an IO map - tell maydump to skip this VMA */
vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP;
vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
fb_pgprotect(file, vma, off);
- printk("lynxfb mmap off 4: %x\n", off);
- printk("lynxfb mmap pgprot: %x\n", vma->vm_page_prot);
+ printk("lynxfb mmap off 4: %lx\n", off);
+ printk("lynxfb mmap pgprot: %lx\n", (unsigned long) pgprot_val(vma->vm_page_prot));
if (io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT,
vma->vm_end - vma->vm_start, vma->vm_page_prot))
return -EAGAIN;
diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h
index 711676c..2ab7b74 100644
--- a/drivers/staging/sm750fb/sm750.h
+++ b/drivers/staging/sm750fb/sm750.h
@@ -59,10 +59,10 @@ struct lynx_share{
}mtrr;
#endif
/* all smi graphic adaptor got below attributes */
- resource_size_t vidmem_start;
- resource_size_t vidreg_start;
- resource_size_t vidmem_size;
- resource_size_t vidreg_size;
+ unsigned long vidmem_start;
+ unsigned long vidreg_start;
+ unsigned long vidmem_size;
+ unsigned long vidreg_size;
volatile unsigned char __iomem * pvReg;
unsigned char __iomem * pvMem;
/* locks*/
diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c
index cd971bd..5a62721 100644
--- a/drivers/staging/sm750fb/sm750_hw.c
+++ b/drivers/staging/sm750fb/sm750_hw.c
@@ -36,7 +36,7 @@ int hw_sm750_map(struct lynx_share* share,struct pci_dev* pdev)
share->vidreg_start = pci_resource_start(pdev,1);
share->vidreg_size = MB(2);
- pr_info("mmio phyAddr = %x\n",share->vidreg_start);
+ pr_info("mmio phyAddr = %lx\n", share->vidreg_start);
/* reserve the vidreg space of smi adaptor
* if you do this, u need to add release region code
@@ -73,7 +73,7 @@ int hw_sm750_map(struct lynx_share* share,struct pci_dev* pdev)
* @hw_sm750_getVMSize function can be safe.
* */
share->vidmem_size = hw_sm750_getVMSize(share);
- pr_info("video memory phyAddr = %x, size = %d bytes\n",
+ pr_info("video memory phyAddr = %lx, size = %ld bytes\n",
share->vidmem_start,share->vidmem_size);
/* reserve the vidmem space of smi adaptor */
--
1.8.1.2
^ permalink raw reply related
* [PATCH 2/4] staging: sm750fb: remove pragma optimize
From: Sudip Mukherjee @ 2015-03-08 12:43 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Sudip Mukherjee, linux-fbdev, devel, linux-kernel
In-Reply-To: <1425817886-14387-1-git-send-email-sudipm.mukherjee@gmail.com>
remove use of #pragma optimize which will usually be ignored by the
compiler.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
drivers/staging/sm750fb/ddk750_swi2c.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/staging/sm750fb/ddk750_swi2c.c b/drivers/staging/sm750fb/ddk750_swi2c.c
index b53407b..cae6b9b 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.c
+++ b/drivers/staging/sm750fb/ddk750_swi2c.c
@@ -217,8 +217,6 @@ static unsigned char swI2CReadSDA(void)
return 0;
}
-#pragma optimize( "", off )
-
/*
* This function sends ACK signal
*/
@@ -356,7 +354,6 @@ unsigned char swI2CReadByte(unsigned char ack)
return data;
}
-#pragma optimize( "", on )
/*
* This function initializes GPIO port for SW I2C communication.
--
1.8.1.2
^ permalink raw reply related
* [PATCH 3/4] staging: sm750fb: correctly define SM750LE_REVISION_ID
From: Sudip Mukherjee @ 2015-03-08 12:43 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Sudip Mukherjee, linux-fbdev, devel, linux-kernel
In-Reply-To: <1425817886-14387-1-git-send-email-sudipm.mukherjee@gmail.com>
check if it is already defined before defining SM750LE_REVISION_ID
again and at the same time mention correct data type.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
drivers/staging/sm750fb/ddk750_chip.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/sm750fb/ddk750_chip.h b/drivers/staging/sm750fb/ddk750_chip.h
index 1c78875..e7d27e8 100644
--- a/drivers/staging/sm750fb/ddk750_chip.h
+++ b/drivers/staging/sm750fb/ddk750_chip.h
@@ -1,7 +1,9 @@
#ifndef DDK750_CHIP_H__
#define DDK750_CHIP_H__
#define DEFAULT_INPUT_CLOCK 14318181 /* Default reference clock */
-#define SM750LE_REVISION_ID (char)0xfe
+#ifndef SM750LE_REVISION_ID
+#define SM750LE_REVISION_ID ((unsigned char)0xfe)
+#endif
/* This is all the chips recognized by this library */
typedef enum _logical_chip_type_t
--
1.8.1.2
^ permalink raw reply related
* [PATCH 4/4] staging: sm750fb: fix undeclared function
From: Sudip Mukherjee @ 2015-03-08 12:43 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Sudip Mukherjee, linux-fbdev, devel, linux-kernel
In-Reply-To: <1425817886-14387-1-git-send-email-sudipm.mukherjee@gmail.com>
kbuild test robot reported that for microblaze-allyesconfig
chan_to_field() and lynxfb_ops_set_par() were not defined. These two
functions were defined under CONFIG_PM, so for any archtecture if
CONFIG_PM is not defined we will have this error.
while moving the lynxfb_suspend() function some very obvious
checkpatch errors were taken care of.
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
drivers/staging/sm750fb/sm750.c | 109 +++++++++++++++++++---------------------
1 file changed, 52 insertions(+), 57 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 753869e..8a78ea5 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -303,62 +303,6 @@ static int lynxfb_ops_pan_display(struct fb_var_screeninfo *var,
return ret;
}
-
-
-
-#ifdef CONFIG_PM
-static int lynxfb_suspend(struct pci_dev * pdev,pm_message_t mesg)
-{
- struct fb_info * info;
- struct lynx_share * share;
- int ret;
-
-
- if(mesg.event = pdev->dev.power.power_state.event)
- return 0;
-
- ret = 0;
- share = pci_get_drvdata(pdev);
- switch (mesg.event) {
- case PM_EVENT_FREEZE:
- case PM_EVENT_PRETHAW:
- pdev->dev.power.power_state = mesg;
- return 0;
- }
-
- console_lock();
- if (mesg.event & PM_EVENT_SLEEP) {
- info = share->fbinfo[0];
- if(info)
- fb_set_suspend(info, 1);/* 1 means do suspend*/
-
- info = share->fbinfo[1];
- if(info)
- fb_set_suspend(info, 1);/* 1 means do suspend*/
-
- ret = pci_save_state(pdev);
- if(ret){
- pr_err("error:%d occured in pci_save_state\n",ret);
- return ret;
- }
-
- /* set chip to sleep mode */
- if(share->suspend)
- (*share->suspend)(share);
-
- pci_disable_device(pdev);
- ret = pci_set_power_state(pdev,pci_choose_state(pdev,mesg));
- if(ret){
- pr_err("error:%d occured in pci_set_power_state\n",ret);
- return ret;
- }
- }
-
- pdev->dev.power.power_state = mesg;
- console_unlock();
- return ret;
-}
-
static int lynxfb_ops_set_par(struct fb_info * info)
{
struct lynxfb_par * par;
@@ -369,7 +313,6 @@ static int lynxfb_ops_set_par(struct fb_info * info)
struct fb_fix_screeninfo * fix;
int ret;
unsigned int line_length;
-
if(!info)
return -EINVAL;
@@ -441,6 +384,7 @@ static int lynxfb_ops_set_par(struct fb_info * info)
ret = output->proc_setMode(output,var,fix);
return ret;
}
+
static inline unsigned int chan_to_field(unsigned int chan,struct fb_bitfield * bf)
{
chan &= 0xffff;
@@ -448,6 +392,57 @@ static inline unsigned int chan_to_field(unsigned int chan,struct fb_bitfield *
return chan << bf->offset;
}
+#ifdef CONFIG_PM
+static int lynxfb_suspend(struct pci_dev *pdev, pm_message_t mesg)
+{
+ struct fb_info *info;
+ struct lynx_share *share;
+ int ret;
+
+ if (mesg.event = pdev->dev.power.power_state.event)
+ return 0;
+
+ ret = 0;
+ share = pci_get_drvdata(pdev);
+ switch (mesg.event) {
+ case PM_EVENT_FREEZE:
+ case PM_EVENT_PRETHAW:
+ pdev->dev.power.power_state = mesg;
+ return 0;
+ }
+
+ console_lock();
+ if (mesg.event & PM_EVENT_SLEEP) {
+ info = share->fbinfo[0];
+ if (info)
+ fb_set_suspend(info, 1);/* 1 means do suspend*/
+
+ info = share->fbinfo[1];
+ if (info)
+ fb_set_suspend(info, 1);/* 1 means do suspend*/
+
+ ret = pci_save_state(pdev);
+ if (ret) {
+ pr_err("error:%d occurred in pci_save_state\n", ret);
+ return ret;
+ }
+
+ /* set chip to sleep mode */
+ if (share->suspend)
+ (*share->suspend)(share);
+
+ pci_disable_device(pdev);
+ ret = pci_set_power_state(pdev, pci_choose_state(pdev, mesg));
+ if (ret) {
+ pr_err("error:%d occurred in pci_set_power_state\n", ret);
+ return ret;
+ }
+ }
+
+ pdev->dev.power.power_state = mesg;
+ console_unlock();
+ return ret;
+}
static int lynxfb_resume(struct pci_dev* pdev)
{
--
1.8.1.2
^ permalink raw reply related
* Re: [PATCH 3/4] staging: sm750fb: correctly define SM750LE_REVISION_ID
From: Giedrius Statkevičius @ 2015-03-08 12:59 UTC (permalink / raw)
To: Sudip Mukherjee, Greg Kroah-Hartman; +Cc: devel, linux-fbdev, linux-kernel
In-Reply-To: <1425817886-14387-3-git-send-email-sudipm.mukherjee@gmail.com>
On 2015.03.08 14:31, Sudip Mukherjee wrote:
> check if it is already defined before defining SM750LE_REVISION_ID
> again and at the same time mention correct data type.
>
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> ---
> drivers/staging/sm750fb/ddk750_chip.h | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/sm750fb/ddk750_chip.h b/drivers/staging/sm750fb/ddk750_chip.h
> index 1c78875..e7d27e8 100644
> --- a/drivers/staging/sm750fb/ddk750_chip.h
> +++ b/drivers/staging/sm750fb/ddk750_chip.h
> @@ -1,7 +1,9 @@
> #ifndef DDK750_CHIP_H__
> #define DDK750_CHIP_H__
> #define DEFAULT_INPUT_CLOCK 14318181 /* Default reference clock */
> -#define SM750LE_REVISION_ID (char)0xfe
> +#ifndef SM750LE_REVISION_ID
> +#define SM750LE_REVISION_ID ((unsigned char)0xfe)
> +#endif
Do you need these parantheses? Also, you can now then fix up this line
too to avoid a redundant cast in the same patch:
sm750_hw.c: if(share->revid = (unsigned char)SM750LE_REVISION_ID){
--
Thanks,
Giedrius
^ permalink raw reply
* Re: [PATCH 1/4] staging: sm750fb: wrong type for print
From: Sudip Mukherjee @ 2015-03-08 12:59 UTC (permalink / raw)
To: Giedrius Statkevičius
Cc: Greg Kroah-Hartman, devel, linux-fbdev, linux-kernel
In-Reply-To: <54FC4323.3010909@gmail.com>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="windows-1254", Size: 1554 bytes --]
On Sun, Mar 08, 2015 at 02:40:03PM +0200, Giedrius Statkevičius wrote:
> On 2015.03.08 14:31, Sudip Mukherjee wrote:
> > mention correct format specifier while printing
> > index 711676c..2ab7b74 100644
> > --- a/drivers/staging/sm750fb/sm750.h
> > +++ b/drivers/staging/sm750fb/sm750.h
> > @@ -59,10 +59,10 @@ struct lynx_share{
> > }mtrr;
> > #endif
> > /* all smi graphic adaptor got below attributes */
> > - resource_size_t vidmem_start;
> > - resource_size_t vidreg_start;
> > - resource_size_t vidmem_size;
> > - resource_size_t vidreg_size;
> > + unsigned long vidmem_start;
> > + unsigned long vidreg_start;
> > + unsigned long vidmem_size;
> > + unsigned long vidreg_size;
>
> Have you checked other places where these are used? resource_size_t can
> be either u64 or u32 depending on if CONFIG_PHYS_ADDR_T_64BIT is
> #defined. Are you sure you aren't losing information when results of
> functions are being assigned to this? Maybe there should be a function
> similar to printk that changes between %u and %llu depending on whether
> that is defined?
oops .. no .. :(
i checked in other framebuffer drivers and saw they are mostly unsigned long.
I will check further on this.
Greg: can you please drop this patch (1/4) from your queue and not apply this to your tree.
I will send it as a v2.
regards
sudip
>
> --
> Thanks,
> Giedrius
--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH 4/4] staging: sm750fb: fix undeclared function
From: Giedrius Statkevičius @ 2015-03-08 13:02 UTC (permalink / raw)
To: Sudip Mukherjee, Greg Kroah-Hartman; +Cc: devel, linux-fbdev, linux-kernel
In-Reply-To: <1425817886-14387-4-git-send-email-sudipm.mukherjee@gmail.com>
On 2015.03.08 14:31, Sudip Mukherjee wrote:
> kbuild test robot reported that for microblaze-allyesconfig
> chan_to_field() and lynxfb_ops_set_par() were not defined. These two
> functions were defined under CONFIG_PM, so for any archtecture if
> CONFIG_PM is not defined we will have this error.
> while moving the lynxfb_suspend() function some very obvious
> checkpatch errors were taken care of.
Such as? If you do you could also fix up the poor things with that
function too such as the comment style here (no space between ; and the
comment):
> + if (info)
> + fb_set_suspend(info, 1);/* 1 means do suspend*/
> +
or here (extra unneeded spaces):
> +
> + /* set chip to sleep mode */
> + if (share->suspend)
> + (*share->suspend)(share);
--
Thanks,
Giedrius
^ permalink raw reply
* Re: [PATCH 3/4] staging: sm750fb: correctly define SM750LE_REVISION_ID
From: Sudip Mukherjee @ 2015-03-08 17:43 UTC (permalink / raw)
To: Giedrius Statkevičius
Cc: Greg Kroah-Hartman, devel, linux-fbdev, linux-kernel
In-Reply-To: <54FC4797.6040704@gmail.com>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="windows-1254", Size: 874 bytes --]
On Sun, Mar 08, 2015 at 02:59:03PM +0200, Giedrius Statkevičius wrote:
> On 2015.03.08 14:31, Sudip Mukherjee wrote:
> > -#define SM750LE_REVISION_ID (char)0xfe
> > +#ifndef SM750LE_REVISION_ID
> > +#define SM750LE_REVISION_ID ((unsigned char)0xfe)
> > +#endif
>
> Do you need these parantheses? Also, you can now then fix up this line
> too to avoid a redundant cast in the same patch:
> sm750_hw.c: if(share->revid = (unsigned char)SM750LE_REVISION_ID){
good idea, thanks.
that extra parentheses is for checkpatch warning of complex macro value.
i will better send a v2 of the whole series after checking that resource_size_t.
regards
sudip
>
>
> --
> Thanks,
> Giedrius
--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH 1/3] staging: sm7xxfb: use module init and exit
From: Sudip Mukherjee @ 2015-03-08 17:52 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Sudip Mukherjee, linux-fbdev, devel, linux-kernel
use module_init() and module_exit() instead of module_pci_driver
and at the same time make way for use of kernel boot parameters.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
drivers/staging/sm7xxfb/sm7xxfb.c | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/sm7xxfb/sm7xxfb.c b/drivers/staging/sm7xxfb/sm7xxfb.c
index ebd9536..17b3917 100644
--- a/drivers/staging/sm7xxfb/sm7xxfb.c
+++ b/drivers/staging/sm7xxfb/sm7xxfb.c
@@ -113,6 +113,8 @@ static struct vesa_mode vesa_mode_table[] = {
static struct screen_info smtc_scr_info;
+static char *mode_option;
+
/* process command line options, get vga parameter */
static int __init sm7xx_vga_setup(char *options)
{
@@ -1017,7 +1019,29 @@ static struct pci_driver smtcfb_driver = {
.driver.pm = SM7XX_PM_OPS,
};
-module_pci_driver(smtcfb_driver);
+static int __init sm712fb_init(void)
+{
+#ifndef MODULE
+ char *option = NULL;
+
+ if (fb_get_options("sm712fb", &option))
+ return -ENODEV;
+ if (option && *option)
+ mode_option = option;
+#endif
+ sm7xx_vga_setup(mode_option);
+
+ return pci_register_driver(&smtcfb_driver);
+}
+
+module_init(sm712fb_init);
+
+static void __exit sm712fb_exit(void)
+{
+ pci_unregister_driver(&smtcfb_driver);
+}
+
+module_exit(sm712fb_exit);
MODULE_AUTHOR("Siliconmotion ");
MODULE_DESCRIPTION("Framebuffer driver for SMI Graphic Cards");
--
1.9.1
^ permalink raw reply related
* [PATCH 2/3] staging: sm7xxfb: remove unneeded __setup
From: Sudip Mukherjee @ 2015-03-08 17:52 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Sudip Mukherjee, linux-fbdev, devel, linux-kernel
In-Reply-To: <1425836411-15481-1-git-send-email-sudipm.mukherjee@gmail.com>
as we start to use kernel boot parameters and fb_get_options()
we donot need to use __setup() any more.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
drivers/staging/sm7xxfb/sm7xxfb.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/staging/sm7xxfb/sm7xxfb.c b/drivers/staging/sm7xxfb/sm7xxfb.c
index 17b3917..e93563f 100644
--- a/drivers/staging/sm7xxfb/sm7xxfb.c
+++ b/drivers/staging/sm7xxfb/sm7xxfb.c
@@ -141,7 +141,6 @@ static int __init sm7xx_vga_setup(char *options)
return -1;
}
-__setup("vga=", sm7xx_vga_setup);
static void sm712_setpalette(int regno, unsigned red, unsigned green,
unsigned blue, struct fb_info *info)
--
1.9.1
^ permalink raw reply related
* [PATCH 3/3] staging: sm7xxfb: change return of sm7xx_vga_setup
From: Sudip Mukherjee @ 2015-03-08 17:52 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Sudip Mukherjee, linux-fbdev, devel, linux-kernel
In-Reply-To: <1425836411-15481-1-git-send-email-sudipm.mukherjee@gmail.com>
change return type of sm7xx_vga_setup() to void as we are not using
the return type anywhere. if this function fails we fall back to the
default configuration.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
drivers/staging/sm7xxfb/sm7xxfb.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/sm7xxfb/sm7xxfb.c b/drivers/staging/sm7xxfb/sm7xxfb.c
index e93563f..abdb021 100644
--- a/drivers/staging/sm7xxfb/sm7xxfb.c
+++ b/drivers/staging/sm7xxfb/sm7xxfb.c
@@ -116,12 +116,12 @@ static struct screen_info smtc_scr_info;
static char *mode_option;
/* process command line options, get vga parameter */
-static int __init sm7xx_vga_setup(char *options)
+static void __init sm7xx_vga_setup(char *options)
{
int i;
if (!options || !*options)
- return -EINVAL;
+ return;
smtc_scr_info.lfb_width = 0;
smtc_scr_info.lfb_height = 0;
@@ -135,11 +135,9 @@ static int __init sm7xx_vga_setup(char *options)
smtc_scr_info.lfb_height vesa_mode_table[i].lfb_height;
smtc_scr_info.lfb_depth = vesa_mode_table[i].lfb_depth;
- return 0;
+ return;
}
}
-
- return -1;
}
static void sm712_setpalette(int regno, unsigned red, unsigned green,
--
1.9.1
^ permalink raw reply related
* Re: [PATCH v2 1/4] staging: sm750fb: wrong type for print
From: Lad, Prabhakar @ 2015-03-09 7:42 UTC (permalink / raw)
To: Sudip Mukherjee
Cc: Tomi Valkeinen, Greg Kroah-Hartman, LFBDEV, OSUOSL Drivers, LKML
In-Reply-To: <1425886506-8643-1-git-send-email-sudipm.mukherjee@gmail.com>
On Mon, Mar 9, 2015 at 7:35 AM, Sudip Mukherjee
<sudipm.mukherjee@gmail.com> wrote:
> mention correct format specifier while printing.
> fixes all the build warnings about incorrect argument type while
> printing.
>
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> ---
>
> V2: Giedrius commented resource_size_t can be either u64 or u32
> depending on if CONFIG_PHYS_ADDR_T_64BIT. based on his comments i
> should have kept the datatype as resource_size_t and used %pa as the
> format specifier. But since this is a framebuffer device and it
> should follow what the framebuffer layer is suggesting in
> struct fb_fix_screeninfo at smem_start and mmio_start.
> adding Tomi for his comments.
>
> this patch will give checkpatch warnings about use of printk.
> this patch was mainly to fix the build warnings. printk will be
> converted to pr_* and dev_* in a later patch.
>
> drivers/staging/sm750fb/sm750.c | 24 ++++++++++++------------
> drivers/staging/sm750fb/sm750.h | 8 ++++----
> drivers/staging/sm750fb/sm750_hw.c | 4 ++--
> 3 files changed, 18 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
> index 520c69e..753869e 100644
> --- a/drivers/staging/sm750fb/sm750.c
> +++ b/drivers/staging/sm750fb/sm750.c
> @@ -530,20 +530,20 @@ static int lynxfb_ops_mmap(struct fb_info * info, struct vm_area_struct * vma)
> if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT))
> return -EINVAL;
> off = vma->vm_pgoff << PAGE_SHIFT;
> - printk("lynxfb mmap pgoff: %x\n", vma->vm_pgoff);
> - printk("lynxfb mmap off 1: %x\n", off);
> + printk("lynxfb mmap pgoff: %lx\n", vma->vm_pgoff);
> + printk("lynxfb mmap off 1: %lx\n", off);
>
wouldn't it makes sense to change printk to some pr_*() ?
Cheers,
--Prabhakar Lad
^ permalink raw reply
* [PATCH v2 1/4] staging: sm750fb: wrong type for print
From: Sudip Mukherjee @ 2015-03-09 7:47 UTC (permalink / raw)
To: Tomi Valkeinen, Greg Kroah-Hartman
Cc: Sudip Mukherjee, linux-fbdev, devel, linux-kernel
In-Reply-To: <CA+V-a8s65fCvd2cA6w2EwaJfaLgPqQ=Hme+m9_wv+y3Y=GxPiQ@mail.gmail.com>
mention correct format specifier while printing.
fixes all the build warnings about incorrect argument type while
printing.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
V2: Giedrius commented resource_size_t can be either u64 or u32
depending on if CONFIG_PHYS_ADDR_T_64BIT. based on his comments i
should have kept the datatype as resource_size_t and used %pa as the
format specifier. But since this is a framebuffer device and it
should follow what the framebuffer layer is suggesting in
struct fb_fix_screeninfo at smem_start and mmio_start.
adding Tomi for his comments.
this patch will give checkpatch warnings about use of printk.
this patch was mainly to fix the build warnings. printk will be
converted to pr_* and dev_* in a later patch.
drivers/staging/sm750fb/sm750.c | 24 ++++++++++++------------
drivers/staging/sm750fb/sm750.h | 8 ++++----
drivers/staging/sm750fb/sm750_hw.c | 4 ++--
3 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 520c69e..753869e 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -530,20 +530,20 @@ static int lynxfb_ops_mmap(struct fb_info * info, struct vm_area_struct * vma)
if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT))
return -EINVAL;
off = vma->vm_pgoff << PAGE_SHIFT;
- printk("lynxfb mmap pgoff: %x\n", vma->vm_pgoff);
- printk("lynxfb mmap off 1: %x\n", off);
+ printk("lynxfb mmap pgoff: %lx\n", vma->vm_pgoff);
+ printk("lynxfb mmap off 1: %lx\n", off);
/* frame buffer memory */
start = info->fix.smem_start;
len = PAGE_ALIGN((start & ~PAGE_MASK) + info->fix.smem_len);
- printk("lynxfb mmap start 1: %x\n", start);
+ printk("lynxfb mmap start 1: %lx\n", start);
printk("lynxfb mmap len 1: %x\n", len);
if (off >= len) {
/* memory mapped io */
off -= len;
- printk("lynxfb mmap off 2: %x\n", off);
+ printk("lynxfb mmap off 2: %lx\n", off);
if (info->var.accel_flags) {
printk("lynxfb mmap accel flags true");
return -EINVAL;
@@ -551,28 +551,28 @@ static int lynxfb_ops_mmap(struct fb_info * info, struct vm_area_struct * vma)
start = info->fix.mmio_start;
len = PAGE_ALIGN((start & ~PAGE_MASK) + info->fix.mmio_len);
- printk("lynxfb mmap start 2: %x\n", start);
+ printk("lynxfb mmap start 2: %lx\n", start);
printk("lynxfb mmap len 2: %x\n", len);
}
start &= PAGE_MASK;
- printk("lynxfb mmap start 3: %x\n", start);
- printk("lynxfb mmap vm start: %x\n", vma->vm_start);
- printk("lynxfb mmap vm end: %x\n", vma->vm_end);
+ printk("lynxfb mmap start 3: %lx\n", start);
+ printk("lynxfb mmap vm start: %lx\n", vma->vm_start);
+ printk("lynxfb mmap vm end: %lx\n", vma->vm_end);
printk("lynxfb mmap len: %x\n", len);
- printk("lynxfb mmap off: %x\n", off);
+ printk("lynxfb mmap off: %lx\n", off);
if ((vma->vm_end - vma->vm_start + off) > len)
{
return -EINVAL;
}
off += start;
- printk("lynxfb mmap off 3: %x\n", off);
+ printk("lynxfb mmap off 3: %lx\n", off);
vma->vm_pgoff = off >> PAGE_SHIFT;
/* This is an IO map - tell maydump to skip this VMA */
vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP;
vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
fb_pgprotect(file, vma, off);
- printk("lynxfb mmap off 4: %x\n", off);
- printk("lynxfb mmap pgprot: %x\n", vma->vm_page_prot);
+ printk("lynxfb mmap off 4: %lx\n", off);
+ printk("lynxfb mmap pgprot: %lx\n", (unsigned long) pgprot_val(vma->vm_page_prot));
if (io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT,
vma->vm_end - vma->vm_start, vma->vm_page_prot))
return -EAGAIN;
diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h
index 711676c..d39968c 100644
--- a/drivers/staging/sm750fb/sm750.h
+++ b/drivers/staging/sm750fb/sm750.h
@@ -59,10 +59,10 @@ struct lynx_share{
}mtrr;
#endif
/* all smi graphic adaptor got below attributes */
- resource_size_t vidmem_start;
- resource_size_t vidreg_start;
- resource_size_t vidmem_size;
- resource_size_t vidreg_size;
+ unsigned long vidmem_start;
+ unsigned long vidreg_start;
+ __u32 vidmem_size;
+ __u32 vidreg_size;
volatile unsigned char __iomem * pvReg;
unsigned char __iomem * pvMem;
/* locks*/
diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c
index cd971bd..ec2d499 100644
--- a/drivers/staging/sm750fb/sm750_hw.c
+++ b/drivers/staging/sm750fb/sm750_hw.c
@@ -36,7 +36,7 @@ int hw_sm750_map(struct lynx_share* share,struct pci_dev* pdev)
share->vidreg_start = pci_resource_start(pdev,1);
share->vidreg_size = MB(2);
- pr_info("mmio phyAddr = %x\n",share->vidreg_start);
+ pr_info("mmio phyAddr = %lx\n", share->vidreg_start);
/* reserve the vidreg space of smi adaptor
* if you do this, u need to add release region code
@@ -73,7 +73,7 @@ int hw_sm750_map(struct lynx_share* share,struct pci_dev* pdev)
* @hw_sm750_getVMSize function can be safe.
* */
share->vidmem_size = hw_sm750_getVMSize(share);
- pr_info("video memory phyAddr = %x, size = %d bytes\n",
+ pr_info("video memory phyAddr = %lx, size = %u bytes\n",
share->vidmem_start,share->vidmem_size);
/* reserve the vidmem space of smi adaptor */
--
1.8.1.2
^ permalink raw reply related
* [PATCH v2 2/4] staging: sm750fb: remove pragma optimize
From: Sudip Mukherjee @ 2015-03-09 7:47 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Sudip Mukherjee, linux-fbdev, devel, linux-kernel
In-Reply-To: <1425886506-8643-1-git-send-email-sudipm.mukherjee@gmail.com>
remove use of #pragma optimize which will usually be ignored by the
compiler.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
v2: same as v1
drivers/staging/sm750fb/ddk750_swi2c.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/staging/sm750fb/ddk750_swi2c.c b/drivers/staging/sm750fb/ddk750_swi2c.c
index b53407b..cae6b9b 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.c
+++ b/drivers/staging/sm750fb/ddk750_swi2c.c
@@ -217,8 +217,6 @@ static unsigned char swI2CReadSDA(void)
return 0;
}
-#pragma optimize( "", off )
-
/*
* This function sends ACK signal
*/
@@ -356,7 +354,6 @@ unsigned char swI2CReadByte(unsigned char ack)
return data;
}
-#pragma optimize( "", on )
/*
* This function initializes GPIO port for SW I2C communication.
--
1.8.1.2
^ permalink raw reply related
* [PATCH v2 3/4] staging: sm750fb: correctly define SM750LE_REVISION_ID
From: Sudip Mukherjee @ 2015-03-09 7:47 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Sudip Mukherjee, linux-fbdev, devel, linux-kernel
In-Reply-To: <1425886506-8643-1-git-send-email-sudipm.mukherjee@gmail.com>
check if it is already defined before defining SM750LE_REVISION_ID
again and at the same time mention correct data type.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
v2: removed the redundant cast in sm750_hw.c
drivers/staging/sm750fb/ddk750_chip.h | 4 +++-
drivers/staging/sm750fb/sm750_hw.c | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/sm750fb/ddk750_chip.h b/drivers/staging/sm750fb/ddk750_chip.h
index 1c78875..d761b72 100644
--- a/drivers/staging/sm750fb/ddk750_chip.h
+++ b/drivers/staging/sm750fb/ddk750_chip.h
@@ -1,7 +1,9 @@
#ifndef DDK750_CHIP_H__
#define DDK750_CHIP_H__
#define DEFAULT_INPUT_CLOCK 14318181 /* Default reference clock */
-#define SM750LE_REVISION_ID (char)0xfe
+#ifndef SM750LE_REVISION_ID
+#define SM750LE_REVISION_ID ((unsigned char)0xfe)
+#endif
/* This is all the chips recognized by this library */
typedef enum _logical_chip_type_t
diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c
index ec2d499..a2b7fe2 100644
--- a/drivers/staging/sm750fb/sm750_hw.c
+++ b/drivers/staging/sm750fb/sm750_hw.c
@@ -277,7 +277,7 @@ int hw_sm750_crtc_checkMode(struct lynxfb_crtc* crtc,struct fb_var_screeninfo* v
case 16:
break;
case 32:
- if(share->revid = (unsigned char)SM750LE_REVISION_ID){
+ if (share->revid = SM750LE_REVISION_ID) {
pr_debug("750le do not support 32bpp\n");
return -EINVAL;
}
--
1.8.1.2
^ permalink raw reply related
* [PATCH v2 4/4] staging: sm750fb: fix undeclared function
From: Sudip Mukherjee @ 2015-03-09 7:47 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Sudip Mukherjee, linux-fbdev, devel, linux-kernel
In-Reply-To: <1425886506-8643-1-git-send-email-sudipm.mukherjee@gmail.com>
kbuild test robot reported that for microblaze-allyesconfig
chan_to_field() and lynxfb_ops_set_par() were not defined. These two
functions were defined under CONFIG_PM, so for any archtecture if
CONFIG_PM is not defined we will have this error.
while moving the lynxfb_suspend() function some very obvious
checkpatch errors, like space after comma, space after if, space
before opening brace, were taken care of.
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
v2: some extra spaces in the comments were removed.
drivers/staging/sm750fb/sm750.c | 110 +++++++++++++++++++---------------------
1 file changed, 53 insertions(+), 57 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 753869e..476dc5c 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -303,62 +303,6 @@ static int lynxfb_ops_pan_display(struct fb_var_screeninfo *var,
return ret;
}
-
-
-
-#ifdef CONFIG_PM
-static int lynxfb_suspend(struct pci_dev * pdev,pm_message_t mesg)
-{
- struct fb_info * info;
- struct lynx_share * share;
- int ret;
-
-
- if(mesg.event = pdev->dev.power.power_state.event)
- return 0;
-
- ret = 0;
- share = pci_get_drvdata(pdev);
- switch (mesg.event) {
- case PM_EVENT_FREEZE:
- case PM_EVENT_PRETHAW:
- pdev->dev.power.power_state = mesg;
- return 0;
- }
-
- console_lock();
- if (mesg.event & PM_EVENT_SLEEP) {
- info = share->fbinfo[0];
- if(info)
- fb_set_suspend(info, 1);/* 1 means do suspend*/
-
- info = share->fbinfo[1];
- if(info)
- fb_set_suspend(info, 1);/* 1 means do suspend*/
-
- ret = pci_save_state(pdev);
- if(ret){
- pr_err("error:%d occured in pci_save_state\n",ret);
- return ret;
- }
-
- /* set chip to sleep mode */
- if(share->suspend)
- (*share->suspend)(share);
-
- pci_disable_device(pdev);
- ret = pci_set_power_state(pdev,pci_choose_state(pdev,mesg));
- if(ret){
- pr_err("error:%d occured in pci_set_power_state\n",ret);
- return ret;
- }
- }
-
- pdev->dev.power.power_state = mesg;
- console_unlock();
- return ret;
-}
-
static int lynxfb_ops_set_par(struct fb_info * info)
{
struct lynxfb_par * par;
@@ -369,7 +313,6 @@ static int lynxfb_ops_set_par(struct fb_info * info)
struct fb_fix_screeninfo * fix;
int ret;
unsigned int line_length;
-
if(!info)
return -EINVAL;
@@ -441,6 +384,7 @@ static int lynxfb_ops_set_par(struct fb_info * info)
ret = output->proc_setMode(output,var,fix);
return ret;
}
+
static inline unsigned int chan_to_field(unsigned int chan,struct fb_bitfield * bf)
{
chan &= 0xffff;
@@ -448,6 +392,58 @@ static inline unsigned int chan_to_field(unsigned int chan,struct fb_bitfield *
return chan << bf->offset;
}
+#ifdef CONFIG_PM
+static int lynxfb_suspend(struct pci_dev *pdev, pm_message_t mesg)
+{
+ struct fb_info *info;
+ struct lynx_share *share;
+ int ret;
+
+ if (mesg.event = pdev->dev.power.power_state.event)
+ return 0;
+
+ ret = 0;
+ share = pci_get_drvdata(pdev);
+ switch (mesg.event) {
+ case PM_EVENT_FREEZE:
+ case PM_EVENT_PRETHAW:
+ pdev->dev.power.power_state = mesg;
+ return 0;
+ }
+
+ console_lock();
+ if (mesg.event & PM_EVENT_SLEEP) {
+ info = share->fbinfo[0];
+ if (info)
+ /* 1 means do suspend*/
+ fb_set_suspend(info, 1);
+ info = share->fbinfo[1];
+ if (info)
+ /* 1 means do suspend*/
+ fb_set_suspend(info, 1);
+
+ ret = pci_save_state(pdev);
+ if (ret) {
+ pr_err("error:%d occurred in pci_save_state\n", ret);
+ return ret;
+ }
+
+ /* set chip to sleep mode*/
+ if (share->suspend)
+ (*share->suspend)(share);
+
+ pci_disable_device(pdev);
+ ret = pci_set_power_state(pdev, pci_choose_state(pdev, mesg));
+ if (ret) {
+ pr_err("error:%d occurred in pci_set_power_state\n", ret);
+ return ret;
+ }
+ }
+
+ pdev->dev.power.power_state = mesg;
+ console_unlock();
+ return ret;
+}
static int lynxfb_resume(struct pci_dev* pdev)
{
--
1.8.1.2
^ permalink raw reply related
* Re: [PATCH v2 3/4] staging: sm750fb: correctly define SM750LE_REVISION_ID
From: Lad, Prabhakar @ 2015-03-09 7:47 UTC (permalink / raw)
To: Sudip Mukherjee; +Cc: Greg Kroah-Hartman, LFBDEV, OSUOSL Drivers, LKML
In-Reply-To: <1425886506-8643-3-git-send-email-sudipm.mukherjee@gmail.com>
On Mon, Mar 9, 2015 at 7:35 AM, Sudip Mukherjee
<sudipm.mukherjee@gmail.com> wrote:
> check if it is already defined before defining SM750LE_REVISION_ID
> again and at the same time mention correct data type.
>
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> ---
>
> v2: removed the redundant cast in sm750_hw.c
>
> drivers/staging/sm750fb/ddk750_chip.h | 4 +++-
> drivers/staging/sm750fb/sm750_hw.c | 2 +-
> 2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/sm750fb/ddk750_chip.h b/drivers/staging/sm750fb/ddk750_chip.h
> index 1c78875..d761b72 100644
> --- a/drivers/staging/sm750fb/ddk750_chip.h
> +++ b/drivers/staging/sm750fb/ddk750_chip.h
> @@ -1,7 +1,9 @@
> #ifndef DDK750_CHIP_H__
> #define DDK750_CHIP_H__
> #define DEFAULT_INPUT_CLOCK 14318181 /* Default reference clock */
> -#define SM750LE_REVISION_ID (char)0xfe
> +#ifndef SM750LE_REVISION_ID
> +#define SM750LE_REVISION_ID ((unsigned char)0xfe)
BTW who is defining this somewhere else ?
Cheers,
--Prabhakar Lad
^ permalink raw reply
* Re: [PATCH v2 1/4] staging: sm750fb: wrong type for print
From: Sudip Mukherjee @ 2015-03-09 8:42 UTC (permalink / raw)
To: Lad, Prabhakar
Cc: Tomi Valkeinen, Greg Kroah-Hartman, LFBDEV, OSUOSL Drivers, LKML
In-Reply-To: <CA+V-a8s65fCvd2cA6w2EwaJfaLgPqQ=Hme+m9_wv+y3Y=GxPiQ@mail.gmail.com>
On Mon, Mar 09, 2015 at 07:42:53AM +0000, Lad, Prabhakar wrote:
> On Mon, Mar 9, 2015 at 7:35 AM, Sudip Mukherjee
> <sudipm.mukherjee@gmail.com> wrote:
> >
> >
> > this patch will give checkpatch warnings about use of printk.
> > this patch was mainly to fix the build warnings. printk will be
> > converted to pr_* and dev_* in a later patch.
> >
> > + printk("lynxfb mmap pgoff: %lx\n", vma->vm_pgoff);
> > + printk("lynxfb mmap off 1: %lx\n", off);
> >
> wouldn't it makes sense to change printk to some pr_*() ?
yes, i could have. But usually Greg does not accept patches which is doing more than one type of change. That is why I mentioned in the comments that this will be converted to pr_* and dev_* in a later patch.
regards
sudip
>
> Cheers,
> --Prabhakar Lad
^ permalink raw reply
* Re: [PATCH v2 3/4] staging: sm750fb: correctly define SM750LE_REVISION_ID
From: Sudip Mukherjee @ 2015-03-09 8:53 UTC (permalink / raw)
To: Lad, Prabhakar; +Cc: Greg Kroah-Hartman, LFBDEV, OSUOSL Drivers, LKML
In-Reply-To: <CA+V-a8sNsxzz38K5KOn7WyDPDR=2bCNpg+53ULQn3qcTPCvcqw@mail.gmail.com>
On Mon, Mar 09, 2015 at 07:47:40AM +0000, Lad, Prabhakar wrote:
> On Mon, Mar 9, 2015 at 7:35 AM, Sudip Mukherjee
> <sudipm.mukherjee@gmail.com> wrote:
> > check if it is already defined before defining SM750LE_REVISION_ID
> > again and at the same time mention correct data type.
> >
> > Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> > ---
> >
> > v2: removed the redundant cast in sm750_hw.c
> >
> > drivers/staging/sm750fb/ddk750_chip.h | 4 +++-
> > drivers/staging/sm750fb/sm750_hw.c | 2 +-
> > 2 files changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/staging/sm750fb/ddk750_chip.h b/drivers/staging/sm750fb/ddk750_chip.h
> > index 1c78875..d761b72 100644
> > --- a/drivers/staging/sm750fb/ddk750_chip.h
> > +++ b/drivers/staging/sm750fb/ddk750_chip.h
> > @@ -1,7 +1,9 @@
> > #ifndef DDK750_CHIP_H__
> > #define DDK750_CHIP_H__
> > #define DEFAULT_INPUT_CLOCK 14318181 /* Default reference clock */
> > -#define SM750LE_REVISION_ID (char)0xfe
> > +#ifndef SM750LE_REVISION_ID
> > +#define SM750LE_REVISION_ID ((unsigned char)0xfe)
>
> BTW who is defining this somewhere else ?
it is defined in ddk750_chip.h which is again being used by ddk750_chip.c .
regards
sudip
>
> Cheers,
> --Prabhakar Lad
^ permalink raw reply
* Re: [PATCH 1/4] staging: sm750fb: wrong type for print
From: Dan Carpenter @ 2015-03-09 9:22 UTC (permalink / raw)
To: Sudip Mukherjee; +Cc: Greg Kroah-Hartman, devel, linux-fbdev, linux-kernel
In-Reply-To: <1425817886-14387-1-git-send-email-sudipm.mukherjee@gmail.com>
On Sun, Mar 08, 2015 at 06:01:23PM +0530, Sudip Mukherjee wrote:
> diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h
> index 711676c..2ab7b74 100644
> --- a/drivers/staging/sm750fb/sm750.h
> +++ b/drivers/staging/sm750fb/sm750.h
> @@ -59,10 +59,10 @@ struct lynx_share{
> }mtrr;
> #endif
> /* all smi graphic adaptor got below attributes */
> - resource_size_t vidmem_start;
> - resource_size_t vidreg_start;
> - resource_size_t vidmem_size;
> - resource_size_t vidreg_size;
> + unsigned long vidmem_start;
> + unsigned long vidreg_start;
> + unsigned long vidmem_size;
> + unsigned long vidreg_size;
> volatile unsigned char __iomem * pvReg;
> unsigned char __iomem * pvMem;
> /* locks*/
This seems like a very risky sort of change. It's not explained very
well in the changelog. What's the deal?
regards,
dan carpenter
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox