Re: [PATCH 01/01] New FBDev driver for Intel Vermilion Range
On Fri, 2007-04-20 at 21:51 +0800, Antonino A. Daplas wrote: > On Fri, 2007-04-20 at 10:04 +0100, Alan Hourihane wrote: > > I've updated the Vermilion Range (LE80578) patch against linus' tree. > > > > Hopefully this rectifies all of the issues noted previously. > > > > Let me know again if there's more updates needed. > > > > Thanks to all who responded with the feedback, it was appreciated. > > > > This (at least the framebuffer part) looks good to me (except for the > excessive curly braces, but that can be fixed easily). Okay if I add a > > Signed-off-by: Alan Hourihane <[EMAIL PROTECTED]>? Signed-off-by: Alan Hourihane <[EMAIL PROTECTED]> would be better. Thanks Antonino ! Alan. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 01/01] New FBDev driver for Intel Vermilion Range
On Fri, 2007-04-20 at 10:04 +0100, Alan Hourihane wrote: > I've updated the Vermilion Range (LE80578) patch against linus' tree. > > Hopefully this rectifies all of the issues noted previously. > > Let me know again if there's more updates needed. > > Thanks to all who responded with the feedback, it was appreciated. > This (at least the framebuffer part) looks good to me (except for the excessive curly braces, but that can be fixed easily). Okay if I add a Signed-off-by: Alan Hourihane <[EMAIL PROTECTED]>? Tony - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 01/01] New FBDev driver for Intel Vermilion Range
I've updated the Vermilion Range (LE80578) patch against linus' tree. Hopefully this rectifies all of the issues noted previously. Let me know again if there's more updates needed. Thanks to all who responded with the feedback, it was appreciated. Alan. diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index e4f0dd0..eedd4c5 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -806,6 +806,22 @@ config FB_I810_I2C select FB_DDC help +config FB_LE80578 + tristate "Intel LE80578 (Vermilion) support" + depends on FB && PCI && X86 + select FB_MODE_HELPERS + select FB_CFB_FILLRECT + select FB_CFB_COPYAREA + select FB_CFB_IMAGEBLIT + help + This driver supports the LE80578 (Vermilion Range) chipset + +config FB_CARILLO_RANCH + tristate "Intel Carillo Ranch support" + depends on FB_LE80578 && FB && PCI && X86 + help + This driver supports the LE80578 (Carillo Ranch) board + config FB_INTEL tristate "Intel 830M/845G/852GM/855GM/865G/915G/945G support (EXPERIMENTAL)" depends on FB && EXPERIMENTAL && PCI && X86 diff --git a/drivers/video/Makefile b/drivers/video/Makefile index 760305c..8bc405b 100644 --- a/drivers/video/Makefile +++ b/drivers/video/Makefile @@ -51,6 +51,7 @@ obj-$(CONFIG_FB_IMSTT)+= imsttfb.o obj-$(CONFIG_FB_FM2) += fm2fb.o obj-$(CONFIG_FB_CYBLA)+= cyblafb.o obj-$(CONFIG_FB_TRIDENT) += tridentfb.o +obj-$(CONFIG_FB_LE80578) += vermilion/ obj-$(CONFIG_FB_S3) += s3fb.o vgastate.o obj-$(CONFIG_FB_STI) += stifb.o obj-$(CONFIG_FB_FFB) += ffb.o sbuslib.o diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig index 47d15b5..fbef663 100644 --- a/drivers/video/backlight/Kconfig +++ b/drivers/video/backlight/Kconfig @@ -63,3 +63,11 @@ config BACKLIGHT_PROGEAR help If you have a Frontpath ProGear say Y to enable the backlight driver. + +config BACKLIGHT_CARILLO_RANCH + tristate "Intel Carillo Ranch Backlight Driver" + depends on BACKLIGHT_CLASS_DEVICE && LCD_CLASS_DEVICE && PCI && X86 && FB_LE80578 + default n + help + If you have a Intel LE80578 (Carillo Ranch) say Y to enable the + backlight driver. diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile index 0c3ce46..c6e2266 100644 --- a/drivers/video/backlight/Makefile +++ b/drivers/video/backlight/Makefile @@ -6,3 +6,4 @@ obj-$(CONFIG_BACKLIGHT_CORGI) += corgi_bl.o obj-$(CONFIG_BACKLIGHT_HP680) += hp680_bl.o obj-$(CONFIG_BACKLIGHT_LOCOMO) += locomolcd.o obj-$(CONFIG_BACKLIGHT_PROGEAR) += progear_bl.o +obj-$(CONFIG_BACKLIGHT_CARILLO_RANCH) += cr_bllcd.o diff --git a/drivers/video/backlight/cr_bllcd.c b/drivers/video/backlight/cr_bllcd.c new file mode 100644 index 000..8fb288b --- /dev/null +++ b/drivers/video/backlight/cr_bllcd.c @@ -0,0 +1,287 @@ +/* + * Copyright (c) Intel Corp. 2007. + * All Rights Reserved. + * + * Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to + * develop this driver. + * + * This file is part of the Carillo Ranch video subsystem driver. + * The Carillo Ranch video subsystem driver is free software; + * you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * The Carillo Ranch video subsystem driver is distributed + * in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this driver; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * Authors: + * Thomas Hellstrom + * Alan Hourihane + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* The LVDS- and panel power controls sits on the + * GPIO port of the ISA bridge. + */ + +#define CRVML_DEVICE_LPC0x27B8 +#define CRVML_REG_GPIOBAR 0x48 +#define CRVML_REG_GPIOEN0x4C +#define CRVML_GPIOEN_BIT(1 << 4) +#define CRVML_PANEL_PORT0x38 +#define CRVML_LVDS_ON 0x0001 +#define CRVML_PANEL_ON 0x0002 +#define CRVML_BACKLIGHT_OFF 0x0004 + +/* The PLL Clock register sits on Host bridge */ +#define CRVML_DEVICE_MCH 0x5001 +#define CRVML_REG_MCHBAR 0x44 +#define CRVML_REG_MCHEN0x54 +#define CRVML_MCHEN_BIT(1 << 28) +#define CRVML_MCHMAP_SIZE 4096 +#define CRVML_REG_CLOCK0xc3c +#define CRVML_CLOCK_SHIFT 8 +#define CRVML_CLOCK_MASK 0x0f00 + +static struct pci_dev *lpc_dev; +static u32 gpio_bar; + +struct cr_panel { + struct backlight_device *cr_backlight_device; + struct lcd_device *cr_lcd_device; +}; + +static int
Re: [PATCH 01/01] New FBDev driver for Intel Vermilion Range
I've updated the Vermilion Range (LE80578) patch against linus' tree. Hopefully this rectifies all of the issues noted previously. Let me know again if there's more updates needed. Thanks to all who responded with the feedback, it was appreciated. Alan. diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index e4f0dd0..eedd4c5 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -806,6 +806,22 @@ config FB_I810_I2C select FB_DDC help +config FB_LE80578 + tristate Intel LE80578 (Vermilion) support + depends on FB PCI X86 + select FB_MODE_HELPERS + select FB_CFB_FILLRECT + select FB_CFB_COPYAREA + select FB_CFB_IMAGEBLIT + help + This driver supports the LE80578 (Vermilion Range) chipset + +config FB_CARILLO_RANCH + tristate Intel Carillo Ranch support + depends on FB_LE80578 FB PCI X86 + help + This driver supports the LE80578 (Carillo Ranch) board + config FB_INTEL tristate Intel 830M/845G/852GM/855GM/865G/915G/945G support (EXPERIMENTAL) depends on FB EXPERIMENTAL PCI X86 diff --git a/drivers/video/Makefile b/drivers/video/Makefile index 760305c..8bc405b 100644 --- a/drivers/video/Makefile +++ b/drivers/video/Makefile @@ -51,6 +51,7 @@ obj-$(CONFIG_FB_IMSTT)+= imsttfb.o obj-$(CONFIG_FB_FM2) += fm2fb.o obj-$(CONFIG_FB_CYBLA)+= cyblafb.o obj-$(CONFIG_FB_TRIDENT) += tridentfb.o +obj-$(CONFIG_FB_LE80578) += vermilion/ obj-$(CONFIG_FB_S3) += s3fb.o vgastate.o obj-$(CONFIG_FB_STI) += stifb.o obj-$(CONFIG_FB_FFB) += ffb.o sbuslib.o diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig index 47d15b5..fbef663 100644 --- a/drivers/video/backlight/Kconfig +++ b/drivers/video/backlight/Kconfig @@ -63,3 +63,11 @@ config BACKLIGHT_PROGEAR help If you have a Frontpath ProGear say Y to enable the backlight driver. + +config BACKLIGHT_CARILLO_RANCH + tristate Intel Carillo Ranch Backlight Driver + depends on BACKLIGHT_CLASS_DEVICE LCD_CLASS_DEVICE PCI X86 FB_LE80578 + default n + help + If you have a Intel LE80578 (Carillo Ranch) say Y to enable the + backlight driver. diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile index 0c3ce46..c6e2266 100644 --- a/drivers/video/backlight/Makefile +++ b/drivers/video/backlight/Makefile @@ -6,3 +6,4 @@ obj-$(CONFIG_BACKLIGHT_CORGI) += corgi_bl.o obj-$(CONFIG_BACKLIGHT_HP680) += hp680_bl.o obj-$(CONFIG_BACKLIGHT_LOCOMO) += locomolcd.o obj-$(CONFIG_BACKLIGHT_PROGEAR) += progear_bl.o +obj-$(CONFIG_BACKLIGHT_CARILLO_RANCH) += cr_bllcd.o diff --git a/drivers/video/backlight/cr_bllcd.c b/drivers/video/backlight/cr_bllcd.c new file mode 100644 index 000..8fb288b --- /dev/null +++ b/drivers/video/backlight/cr_bllcd.c @@ -0,0 +1,287 @@ +/* + * Copyright (c) Intel Corp. 2007. + * All Rights Reserved. + * + * Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to + * develop this driver. + * + * This file is part of the Carillo Ranch video subsystem driver. + * The Carillo Ranch video subsystem driver is free software; + * you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * The Carillo Ranch video subsystem driver is distributed + * in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this driver; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * Authors: + * Thomas Hellstrom thomas-at-tungstengraphics-dot-com + * Alan Hourihane alanh-at-tungstengraphics-dot-com + */ + +#include linux/module.h +#include linux/kernel.h +#include linux/init.h +#include linux/platform_device.h +#include linux/mutex.h +#include linux/fb.h +#include linux/backlight.h +#include linux/lcd.h +#include linux/pci.h +#include asm/uaccess.h + +/* The LVDS- and panel power controls sits on the + * GPIO port of the ISA bridge. + */ + +#define CRVML_DEVICE_LPC0x27B8 +#define CRVML_REG_GPIOBAR 0x48 +#define CRVML_REG_GPIOEN0x4C +#define CRVML_GPIOEN_BIT(1 4) +#define CRVML_PANEL_PORT0x38 +#define CRVML_LVDS_ON 0x0001 +#define CRVML_PANEL_ON 0x0002 +#define CRVML_BACKLIGHT_OFF 0x0004 + +/* The PLL Clock register sits on Host bridge */ +#define CRVML_DEVICE_MCH 0x5001 +#define CRVML_REG_MCHBAR 0x44 +#define CRVML_REG_MCHEN0x54 +#define CRVML_MCHEN_BIT(1 28) +#define CRVML_MCHMAP_SIZE 4096 +#define CRVML_REG_CLOCK0xc3c +#define CRVML_CLOCK_SHIFT 8 +#define CRVML_CLOCK_MASK 0x0f00 + +static struct pci_dev *lpc_dev; +static
Re: [PATCH 01/01] New FBDev driver for Intel Vermilion Range
On Fri, 2007-04-20 at 10:04 +0100, Alan Hourihane wrote: I've updated the Vermilion Range (LE80578) patch against linus' tree. Hopefully this rectifies all of the issues noted previously. Let me know again if there's more updates needed. Thanks to all who responded with the feedback, it was appreciated. This (at least the framebuffer part) looks good to me (except for the excessive curly braces, but that can be fixed easily). Okay if I add a Signed-off-by: Alan Hourihane [EMAIL PROTECTED]? Tony - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 01/01] New FBDev driver for Intel Vermilion Range
On Fri, 2007-04-20 at 21:51 +0800, Antonino A. Daplas wrote: On Fri, 2007-04-20 at 10:04 +0100, Alan Hourihane wrote: I've updated the Vermilion Range (LE80578) patch against linus' tree. Hopefully this rectifies all of the issues noted previously. Let me know again if there's more updates needed. Thanks to all who responded with the feedback, it was appreciated. This (at least the framebuffer part) looks good to me (except for the excessive curly braces, but that can be fixed easily). Okay if I add a Signed-off-by: Alan Hourihane [EMAIL PROTECTED]? Signed-off-by: Alan Hourihane [EMAIL PROTECTED] would be better. Thanks Antonino ! Alan. - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 01/01] New FBDev driver for Intel Vermilion Range
Hi! > +struct cr_sys { > + struct vml_sys sys; > + struct pci_dev *mch_dev; > + struct pci_dev *lpc_dev; > + __u32 mch_bar; > + __u8 *mch_regs_base; > + __u32 gpio_bar; > + __u32 saved_panel_state; > + __u32 saved_clock; u32/u8 is right type to use here. > +static struct vml_sys *my_sys = NULL; No need for zero initing. > +static int crvml_sysinit(struct cr_sys *crsys) > +{ > + __u32 dev_en; > + __u8 dev_en8; u8/u32, please. > +static void crvml_panel_on(const struct vml_sys *sys) > +{ > + const struct cr_sys *crsys = container_of(sys, struct cr_sys, sys); > + __u32 addr = crsys->gpio_bar + CRVML_PANEL_PORT; > + __u32 cur = inl(addr); here too, and everywhere outside headers. > +static void crvml_backlight_on(const struct vml_sys *sys) > +{ > + const struct cr_sys *crsys = container_of(sys, struct cr_sys, sys); > + __u32 addr = crsys->gpio_bar + CRVML_PANEL_PORT; > + __u32 cur = inl(addr); > + > + if (cur & CRVML_BACKLIGHT_OFF) { > + cur &= ~CRVML_BACKLIGHT_OFF; > + outl(cur, addr); > + } > +} > + > +static void crvml_backlight_off(const struct vml_sys *sys) > +{ > + const struct cr_sys *crsys = container_of(sys, struct cr_sys, sys); > + __u32 addr = crsys->gpio_bar + CRVML_PANEL_PORT; > + __u32 cur = inl(addr); > + > + if (!(cur & CRVML_BACKLIGHT_OFF)) { > + cur |= CRVML_BACKLIGHT_OFF; > + outl(cur, addr); > + } > +} Should this go to driv*/video/backlight? > +static int crvml_false(const struct vml_sys *sys) > +{ > + return 0; > +} > + > +static int crvml_true(const struct vml_sys *sys) > +{ > + return 1; > +} Ugly but useful... should be done once for all fbdevs? > +#if (defined(CONFIG_X86) && defined(X86_FEATURE_PAT) && > defined(X86_FEATURE_MSR)) > + > +/* > + * Use the i386 Page Attribute Table for write-combining. > + * We can't include this code in the kernel submission, since some of it > + * belongs at kernel startup. > + */ > + > +#define USE_PAT_WC > +#else > +#undef USE_PAT_WC > +#endif Eh? Did you want to remove this? > +/** > + * > + * Copyright (c) Intel Corp. 2007. > + * All Rights Reserved. > + * > + * Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to > + * develop this driver. > + * > + * Permission is hereby granted, free of charge, to any person obtaining a > + * copy of this software and associated documentation files (the > + * "Software"), to deal in the Software without restriction, including > + * without limitation the rights to use, copy, modify, merge, publish, > + * distribute, sub license, and/or sell copies of the Software, and to > + * permit persons to whom the Software is furnished to do so, subject to > + * the following conditions: > + * > + * The above copyright notice and this permission notice (including the > + * next paragraph) shall be included in all copies or substantial portions > + * of the Software. > + * > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL > + * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY > CLAIM, > + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR > + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE > + * USE OR OTHER DEALINGS IN THE SOFTWARE. Can you just use GPL here? > +#ifdef __KERNEL__ > +#include > +#include Missingspaces. > +#define __u64 uint64_t No. Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 01/01] New FBDev driver for Intel Vermilion Range
Hi! +struct cr_sys { + struct vml_sys sys; + struct pci_dev *mch_dev; + struct pci_dev *lpc_dev; + __u32 mch_bar; + __u8 *mch_regs_base; + __u32 gpio_bar; + __u32 saved_panel_state; + __u32 saved_clock; u32/u8 is right type to use here. +static struct vml_sys *my_sys = NULL; No need for zero initing. +static int crvml_sysinit(struct cr_sys *crsys) +{ + __u32 dev_en; + __u8 dev_en8; u8/u32, please. +static void crvml_panel_on(const struct vml_sys *sys) +{ + const struct cr_sys *crsys = container_of(sys, struct cr_sys, sys); + __u32 addr = crsys-gpio_bar + CRVML_PANEL_PORT; + __u32 cur = inl(addr); here too, and everywhere outside headers. +static void crvml_backlight_on(const struct vml_sys *sys) +{ + const struct cr_sys *crsys = container_of(sys, struct cr_sys, sys); + __u32 addr = crsys-gpio_bar + CRVML_PANEL_PORT; + __u32 cur = inl(addr); + + if (cur CRVML_BACKLIGHT_OFF) { + cur = ~CRVML_BACKLIGHT_OFF; + outl(cur, addr); + } +} + +static void crvml_backlight_off(const struct vml_sys *sys) +{ + const struct cr_sys *crsys = container_of(sys, struct cr_sys, sys); + __u32 addr = crsys-gpio_bar + CRVML_PANEL_PORT; + __u32 cur = inl(addr); + + if (!(cur CRVML_BACKLIGHT_OFF)) { + cur |= CRVML_BACKLIGHT_OFF; + outl(cur, addr); + } +} Should this go to driv*/video/backlight? +static int crvml_false(const struct vml_sys *sys) +{ + return 0; +} + +static int crvml_true(const struct vml_sys *sys) +{ + return 1; +} Ugly but useful... should be done once for all fbdevs? +#if (defined(CONFIG_X86) defined(X86_FEATURE_PAT) defined(X86_FEATURE_MSR)) + +/* + * Use the i386 Page Attribute Table for write-combining. + * We can't include this code in the kernel submission, since some of it + * belongs at kernel startup. + */ + +#define USE_PAT_WC +#else +#undef USE_PAT_WC +#endif Eh? Did you want to remove this? +/** + * + * Copyright (c) Intel Corp. 2007. + * All Rights Reserved. + * + * Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to + * develop this driver. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * Software), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. Can you just use GPL here? +#ifdef __KERNEL__ +#includelinux/ioctl.h +#includelinux/types.h Missingspaces. +#define __u64 uint64_t No. Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 01/01] New FBDev driver for Intel Vermilion Range
On Fri, 2007-04-06 at 08:09 +0800, Antonino A. Daplas wrote: > On Thu, 2007-04-05 at 11:44 +0100, Alan Hourihane wrote: > > Attached is a patch against 2.6.21-rc5 which adds the Intel Vermilion > > Range support. > > > > Intel funded Tungsten Graphics to do this work. > > > > If there's any problems or updates needed to be done to get accepted, > > please let me know. > > > > Preferably, add sparse annotations and compile with make C=1. I've > included possible sparse annotations (the only ones I can see) below. Great. Thanks for this information. > Perhaps backling_on/off and panel_on/off can be moved to the backlight > subsystem? Another good pointer. Thanks. I'll revisit things and get back to the list. Alan. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 01/01] New FBDev driver for Intel Vermilion Range
On Fri, 2007-04-06 at 08:09 +0800, Antonino A. Daplas wrote: On Thu, 2007-04-05 at 11:44 +0100, Alan Hourihane wrote: Attached is a patch against 2.6.21-rc5 which adds the Intel Vermilion Range support. Intel funded Tungsten Graphics to do this work. If there's any problems or updates needed to be done to get accepted, please let me know. Preferably, add sparse annotations and compile with make C=1. I've included possible sparse annotations (the only ones I can see) below. Great. Thanks for this information. Perhaps backling_on/off and panel_on/off can be moved to the backlight subsystem? Another good pointer. Thanks. I'll revisit things and get back to the list. Alan. - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 01/01] New FBDev driver for Intel Vermilion Range
On Thu, 2007-04-05 at 11:44 +0100, Alan Hourihane wrote: > Attached is a patch against 2.6.21-rc5 which adds the Intel Vermilion > Range support. > > Intel funded Tungsten Graphics to do this work. > > If there's any problems or updates needed to be done to get accepted, > please let me know. > Preferably, add sparse annotations and compile with make C=1. I've included possible sparse annotations (the only ones I can see) below. > > + > +struct cr_sys { > + struct vml_sys sys; > + struct pci_dev *mch_dev; > + struct pci_dev *lpc_dev; > + __u32 mch_bar; > + __u8 *mch_regs_base; void __iomem *mch_regs_base; (sparse) > + __u32 gpio_bar; > + __u32 saved_panel_state; > + __u32 saved_clock; > +}; > + > > +static void crvml_panel_on(const struct vml_sys *sys) > +{ > + const struct cr_sys *crsys = container_of(sys, struct cr_sys, sys); > + __u32 addr = crsys->gpio_bar + CRVML_PANEL_PORT; > + __u32 cur = inl(addr); > + > + if (!(cur & CRVML_PANEL_ON)) { > + /* Make sure LVDS controller is down. */ > + if (cur & 0x0001) { > + cur &= ~CRVML_LVDS_ON; > + outl(cur, addr); > + } > + /* Power up Panel */ > + schedule_timeout(HZ / 10); > + cur |= CRVML_PANEL_ON; > + outl(cur, addr); > + } > + > + /* Power up LVDS controller */ > + > + if (!(cur & CRVML_LVDS_ON)) { > + schedule_timeout(HZ / 10); > + outl(cur | CRVML_LVDS_ON, addr); > + } > +} > + > +static void crvml_panel_off(const struct vml_sys *sys) > +{ > + const struct cr_sys *crsys = container_of(sys, struct cr_sys, sys); > + > + __u32 addr = crsys->gpio_bar + CRVML_PANEL_PORT; > + __u32 cur = inl(addr); > + > + /* Power down LVDS controller first to avoid high currents */ > + if (cur & CRVML_LVDS_ON) { > + cur &= ~CRVML_LVDS_ON; > + outl(cur, addr); > + } > + if (cur & CRVML_PANEL_ON) { > + schedule_timeout(HZ / 10); > + outl(cur & ~CRVML_PANEL_ON, addr); > + } > +} > + > +static void crvml_backlight_on(const struct vml_sys *sys) > +{ > + const struct cr_sys *crsys = container_of(sys, struct cr_sys, sys); > + __u32 addr = crsys->gpio_bar + CRVML_PANEL_PORT; > + __u32 cur = inl(addr); > + > + if (cur & CRVML_BACKLIGHT_OFF) { > + cur &= ~CRVML_BACKLIGHT_OFF; > + outl(cur, addr); > + } > +} > + > +static void crvml_backlight_off(const struct vml_sys *sys) > +{ > + const struct cr_sys *crsys = container_of(sys, struct cr_sys, sys); > + __u32 addr = crsys->gpio_bar + CRVML_PANEL_PORT; > + __u32 cur = inl(addr); > + > + if (!(cur & CRVML_BACKLIGHT_OFF)) { > + cur |= CRVML_BACKLIGHT_OFF; > + outl(cur, addr); > + } > +} > Perhaps backling_on/off and panel_on/off can be moved to the backlight subsystem? > + > > +static int crvml_sys_restore(struct vml_sys *sys) > +{ > + struct cr_sys *crsys = container_of(sys, struct cr_sys, sys); > + __u32 *clock_reg = (__u32 *) (crsys->mch_regs_base + CRVML_REG_CLOCK); __u32 __iomem *clock_reg = crsys->mch_regs_base + CRVML_REG_CLOCK; (sparse) > + __u32 cur = crsys->saved_panel_state; > + > + if (cur & CRVML_BACKLIGHT_OFF) { > + crvml_backlight_off(sys); > + } else { > + crvml_backlight_on(sys); > + } > + > + if (cur & CRVML_PANEL_ON) { > + crvml_panel_on(sys); > + } else { > + crvml_panel_off(sys); > + if (cur & CRVML_LVDS_ON) { > + ; > + /* Will not power up LVDS controller while panel is off > */ > + } > + } > + iowrite32(crsys->saved_clock, clock_reg); > + ioread32(clock_reg); > + > + return 0; > +} > + > +static int crvml_sys_save(struct vml_sys *sys) > +{ > + struct cr_sys *crsys = container_of(sys, struct cr_sys, sys); > + __u32 *clock_reg = (__u32 *) (crsys->mch_regs_base + CRVML_REG_CLOCK); > + __u32 __iomem *clock_reg = crsys->mch_regs_base + CRVML_REG_CLOCK; (sparse) > + crsys->saved_panel_state = inl(crsys->gpio_bar + CRVML_PANEL_PORT); > + crsys->saved_clock = ioread32(clock_reg); > + > + return 0; > +} > + > +static int crvml_nearest_index(const struct vml_sys *sys, int clock) > +{ > + > + int i; > + int cur_index; > + int cur_diff; > + int diff; > + > + cur_index = 0; > + cur_diff = clock - crvml_clocks[0]; > + cur_diff = (cur_diff < 0) ? -cur_diff : cur_diff; > + for (i = 1; i < crvml_num_clocks; ++i) { > + diff = clock - crvml_clocks[i]; > + diff = (diff < 0) ? -diff : diff; > + if (diff < cur_diff) { > + cur_index = i; > + cur_diff = diff; > + } > + } > + return cur_index; > +} > + > +static int crvml_nearest_clock(const
Re: [PATCH 01/01] New FBDev driver for Intel Vermilion Range
On Thu, 2007-04-05 at 22:42 +0100, Alan Hourihane wrote: > On Thu, 2007-04-05 at 21:38 +0200, Arnd Bergmann wrote: > > On Thursday 05 April 2007, Alan Hourihane wrote: > > > @@ -0,0 +1,405 @@ > > > +/* > > > + * Copyright (c) Intel Corp. 2007. > > > + * All Rights Reserved. > > > + * > > > > Saying 'All Rights Reserved' is usually considered the opposite of > > licensing your code as GPL. I suppose you need to remove that. > > Arnd, > > Thanks for your comments, and I'll review and make appropriate changes > as you've suggested. > > As for the above, I've noticed that drivers/video/epson1355fb.c also has > this wording and is under the GPL. > "All Rights Reserved" is written notice, a part of copyright law formality. Nowadays, your works are protected (under the copyright law) even without that written notice, so the phrase can be excluded. I don't think the phrase is incompatible with GPL. Tony - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 01/01] New FBDev driver for Intel Vermilion Range
On Thursday 05 April 2007, Alan Hourihane wrote: > As for the above, I've noticed that drivers/video/epson1355fb.c also has > this wording and is under the GPL. Yes, many files have it, but that doesn't make it right ;-) Arnd <>< - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 01/01] New FBDev driver for Intel Vermilion Range
On Thu, 2007-04-05 at 21:38 +0200, Arnd Bergmann wrote: > On Thursday 05 April 2007, Alan Hourihane wrote: > > @@ -0,0 +1,405 @@ > > +/* > > + * Copyright (c) Intel Corp. 2007. > > + * All Rights Reserved. > > + * > > Saying 'All Rights Reserved' is usually considered the opposite of > licensing your code as GPL. I suppose you need to remove that. Arnd, Thanks for your comments, and I'll review and make appropriate changes as you've suggested. As for the above, I've noticed that drivers/video/epson1355fb.c also has this wording and is under the GPL. Alan. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 01/01] New FBDev driver for Intel Vermilion Range
On Thu, 2007-04-05 at 13:38 -0400, [EMAIL PROTECTED] wrote: > On Thu, 05 Apr 2007 11:44:46 BST, Alan Hourihane said: > > > Attached is a patch against 2.6.21-rc5 which adds the Intel Vermilion > > Range support. > > One non-technical question here... > > > +config FB_VERMILION > > + tristate "Vermilion support" > > + depends on FB && PCI && X86 > > + select FB_MODE_HELPERS > > + select FB_CFB_FILLRECT > > + select FB_CFB_COPYAREA > > + select FB_CFB_IMAGEBLIT > > + help > > + This driver supports the Vermilion Range chipset > > Is 'Vermillion' the project codename, or the name that end users will actually > see when hardware ships? Most of the Intel graphics chopsets have been > named things like i810, i925, and so on - if the user-visible name is known, > that should probably be reflected in the 'tristate' string and help > text (FB_VERMILLION in the code is fine by be though). I've asked the question and the part number would be... LE80578 So, if that desperately needs changing let me know and I'll submit another patch, or maybe someone can make the tweak for me. Thanks, Alan. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 01/01] New FBDev driver for Intel Vermilion Range
> One non-technical question here... > > > +config FB_VERMILION > > + tristate "Vermilion support" > > + depends on FB && PCI && X86 > > + select FB_MODE_HELPERS > > + select FB_CFB_FILLRECT > > + select FB_CFB_COPYAREA > > + select FB_CFB_IMAGEBLIT > > + help > > + This driver supports the Vermilion Range chipset > > Is 'Vermillion' the project codename, or the name that end users will actually > see when hardware ships? Most of the Intel graphics chopsets have been > named things like i810, i925, and so on - if the user-visible name is known, > that should probably be reflected in the 'tristate' string and help > text (FB_VERMILLION in the code is fine by be though). I have to agree. I went looking for info on this card and I can't find anything. Please name it what the end user will expect. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 01/01] New FBDev driver for Intel Vermilion Range
On Thu, 05 Apr 2007 11:44:46 BST, Alan Hourihane said: > Attached is a patch against 2.6.21-rc5 which adds the Intel Vermilion > Range support. One non-technical question here... > +config FB_VERMILION > + tristate "Vermilion support" > + depends on FB && PCI && X86 > + select FB_MODE_HELPERS > + select FB_CFB_FILLRECT > + select FB_CFB_COPYAREA > + select FB_CFB_IMAGEBLIT > + help > + This driver supports the Vermilion Range chipset Is 'Vermillion' the project codename, or the name that end users will actually see when hardware ships? Most of the Intel graphics chopsets have been named things like i810, i925, and so on - if the user-visible name is known, that should probably be reflected in the 'tristate' string and help text (FB_VERMILLION in the code is fine by be though). pgpSOsQI9RkGm.pgp Description: PGP signature
Re: [PATCH 01/01] New FBDev driver for Intel Vermilion Range
One non-technical question here... +config FB_VERMILION + tristate Vermilion support + depends on FB PCI X86 + select FB_MODE_HELPERS + select FB_CFB_FILLRECT + select FB_CFB_COPYAREA + select FB_CFB_IMAGEBLIT + help + This driver supports the Vermilion Range chipset Is 'Vermillion' the project codename, or the name that end users will actually see when hardware ships? Most of the Intel graphics chopsets have been named things like i810, i925, and so on - if the user-visible name is known, that should probably be reflected in the 'tristate' string and help text (FB_VERMILLION in the code is fine by be though). I have to agree. I went looking for info on this card and I can't find anything. Please name it what the end user will expect. - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 01/01] New FBDev driver for Intel Vermilion Range
On Thu, 2007-04-05 at 13:38 -0400, [EMAIL PROTECTED] wrote: On Thu, 05 Apr 2007 11:44:46 BST, Alan Hourihane said: Attached is a patch against 2.6.21-rc5 which adds the Intel Vermilion Range support. One non-technical question here... +config FB_VERMILION + tristate Vermilion support + depends on FB PCI X86 + select FB_MODE_HELPERS + select FB_CFB_FILLRECT + select FB_CFB_COPYAREA + select FB_CFB_IMAGEBLIT + help + This driver supports the Vermilion Range chipset Is 'Vermillion' the project codename, or the name that end users will actually see when hardware ships? Most of the Intel graphics chopsets have been named things like i810, i925, and so on - if the user-visible name is known, that should probably be reflected in the 'tristate' string and help text (FB_VERMILLION in the code is fine by be though). I've asked the question and the part number would be... LE80578 So, if that desperately needs changing let me know and I'll submit another patch, or maybe someone can make the tweak for me. Thanks, Alan. - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 01/01] New FBDev driver for Intel Vermilion Range
On Thu, 2007-04-05 at 21:38 +0200, Arnd Bergmann wrote: On Thursday 05 April 2007, Alan Hourihane wrote: @@ -0,0 +1,405 @@ +/* + * Copyright (c) Intel Corp. 2007. + * All Rights Reserved. + * Saying 'All Rights Reserved' is usually considered the opposite of licensing your code as GPL. I suppose you need to remove that. Arnd, Thanks for your comments, and I'll review and make appropriate changes as you've suggested. As for the above, I've noticed that drivers/video/epson1355fb.c also has this wording and is under the GPL. Alan. - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 01/01] New FBDev driver for Intel Vermilion Range
On Thursday 05 April 2007, Alan Hourihane wrote: As for the above, I've noticed that drivers/video/epson1355fb.c also has this wording and is under the GPL. Yes, many files have it, but that doesn't make it right ;-) Arnd - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 01/01] New FBDev driver for Intel Vermilion Range
On Thu, 2007-04-05 at 22:42 +0100, Alan Hourihane wrote: On Thu, 2007-04-05 at 21:38 +0200, Arnd Bergmann wrote: On Thursday 05 April 2007, Alan Hourihane wrote: @@ -0,0 +1,405 @@ +/* + * Copyright (c) Intel Corp. 2007. + * All Rights Reserved. + * Saying 'All Rights Reserved' is usually considered the opposite of licensing your code as GPL. I suppose you need to remove that. Arnd, Thanks for your comments, and I'll review and make appropriate changes as you've suggested. As for the above, I've noticed that drivers/video/epson1355fb.c also has this wording and is under the GPL. All Rights Reserved is written notice, a part of copyright law formality. Nowadays, your works are protected (under the copyright law) even without that written notice, so the phrase can be excluded. I don't think the phrase is incompatible with GPL. Tony - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 01/01] New FBDev driver for Intel Vermilion Range
On Thu, 2007-04-05 at 11:44 +0100, Alan Hourihane wrote: Attached is a patch against 2.6.21-rc5 which adds the Intel Vermilion Range support. Intel funded Tungsten Graphics to do this work. If there's any problems or updates needed to be done to get accepted, please let me know. Preferably, add sparse annotations and compile with make C=1. I've included possible sparse annotations (the only ones I can see) below. + +struct cr_sys { + struct vml_sys sys; + struct pci_dev *mch_dev; + struct pci_dev *lpc_dev; + __u32 mch_bar; + __u8 *mch_regs_base; void __iomem *mch_regs_base; (sparse) + __u32 gpio_bar; + __u32 saved_panel_state; + __u32 saved_clock; +}; + +static void crvml_panel_on(const struct vml_sys *sys) +{ + const struct cr_sys *crsys = container_of(sys, struct cr_sys, sys); + __u32 addr = crsys-gpio_bar + CRVML_PANEL_PORT; + __u32 cur = inl(addr); + + if (!(cur CRVML_PANEL_ON)) { + /* Make sure LVDS controller is down. */ + if (cur 0x0001) { + cur = ~CRVML_LVDS_ON; + outl(cur, addr); + } + /* Power up Panel */ + schedule_timeout(HZ / 10); + cur |= CRVML_PANEL_ON; + outl(cur, addr); + } + + /* Power up LVDS controller */ + + if (!(cur CRVML_LVDS_ON)) { + schedule_timeout(HZ / 10); + outl(cur | CRVML_LVDS_ON, addr); + } +} + +static void crvml_panel_off(const struct vml_sys *sys) +{ + const struct cr_sys *crsys = container_of(sys, struct cr_sys, sys); + + __u32 addr = crsys-gpio_bar + CRVML_PANEL_PORT; + __u32 cur = inl(addr); + + /* Power down LVDS controller first to avoid high currents */ + if (cur CRVML_LVDS_ON) { + cur = ~CRVML_LVDS_ON; + outl(cur, addr); + } + if (cur CRVML_PANEL_ON) { + schedule_timeout(HZ / 10); + outl(cur ~CRVML_PANEL_ON, addr); + } +} + +static void crvml_backlight_on(const struct vml_sys *sys) +{ + const struct cr_sys *crsys = container_of(sys, struct cr_sys, sys); + __u32 addr = crsys-gpio_bar + CRVML_PANEL_PORT; + __u32 cur = inl(addr); + + if (cur CRVML_BACKLIGHT_OFF) { + cur = ~CRVML_BACKLIGHT_OFF; + outl(cur, addr); + } +} + +static void crvml_backlight_off(const struct vml_sys *sys) +{ + const struct cr_sys *crsys = container_of(sys, struct cr_sys, sys); + __u32 addr = crsys-gpio_bar + CRVML_PANEL_PORT; + __u32 cur = inl(addr); + + if (!(cur CRVML_BACKLIGHT_OFF)) { + cur |= CRVML_BACKLIGHT_OFF; + outl(cur, addr); + } +} Perhaps backling_on/off and panel_on/off can be moved to the backlight subsystem? + +static int crvml_sys_restore(struct vml_sys *sys) +{ + struct cr_sys *crsys = container_of(sys, struct cr_sys, sys); + __u32 *clock_reg = (__u32 *) (crsys-mch_regs_base + CRVML_REG_CLOCK); __u32 __iomem *clock_reg = crsys-mch_regs_base + CRVML_REG_CLOCK; (sparse) + __u32 cur = crsys-saved_panel_state; + + if (cur CRVML_BACKLIGHT_OFF) { + crvml_backlight_off(sys); + } else { + crvml_backlight_on(sys); + } + + if (cur CRVML_PANEL_ON) { + crvml_panel_on(sys); + } else { + crvml_panel_off(sys); + if (cur CRVML_LVDS_ON) { + ; + /* Will not power up LVDS controller while panel is off */ + } + } + iowrite32(crsys-saved_clock, clock_reg); + ioread32(clock_reg); + + return 0; +} + +static int crvml_sys_save(struct vml_sys *sys) +{ + struct cr_sys *crsys = container_of(sys, struct cr_sys, sys); + __u32 *clock_reg = (__u32 *) (crsys-mch_regs_base + CRVML_REG_CLOCK); + __u32 __iomem *clock_reg = crsys-mch_regs_base + CRVML_REG_CLOCK; (sparse) + crsys-saved_panel_state = inl(crsys-gpio_bar + CRVML_PANEL_PORT); + crsys-saved_clock = ioread32(clock_reg); + + return 0; +} + +static int crvml_nearest_index(const struct vml_sys *sys, int clock) +{ + + int i; + int cur_index; + int cur_diff; + int diff; + + cur_index = 0; + cur_diff = clock - crvml_clocks[0]; + cur_diff = (cur_diff 0) ? -cur_diff : cur_diff; + for (i = 1; i crvml_num_clocks; ++i) { + diff = clock - crvml_clocks[i]; + diff = (diff 0) ? -diff : diff; + if (diff cur_diff) { + cur_index = i; + cur_diff = diff; + } + } + return cur_index; +} + +static int crvml_nearest_clock(const struct vml_sys *sys, int clock) +{ + return crvml_clocks[crvml_nearest_index(sys, clock)]; +} + +static int crvml_set_clock(struct vml_sys *sys, int clock) +{ + struct
Re: [PATCH 01/01] New FBDev driver for Intel Vermilion Range
On Thu, 05 Apr 2007 11:44:46 BST, Alan Hourihane said: Attached is a patch against 2.6.21-rc5 which adds the Intel Vermilion Range support. One non-technical question here... +config FB_VERMILION + tristate Vermilion support + depends on FB PCI X86 + select FB_MODE_HELPERS + select FB_CFB_FILLRECT + select FB_CFB_COPYAREA + select FB_CFB_IMAGEBLIT + help + This driver supports the Vermilion Range chipset Is 'Vermillion' the project codename, or the name that end users will actually see when hardware ships? Most of the Intel graphics chopsets have been named things like i810, i925, and so on - if the user-visible name is known, that should probably be reflected in the 'tristate' string and help text (FB_VERMILLION in the code is fine by be though). pgpSOsQI9RkGm.pgp Description: PGP signature