From: Pavel Machek <pavel@ucw.cz>
To: Alan Hourihane <alanh@fairlite.demon.co.uk>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 01/01] New FBDev driver for Intel Vermilion Range
Date: Mon, 9 Apr 2007 20:10:51 +0000 [thread overview]
Message-ID: <20070409201050.GA4302@ucw.cz> (raw)
In-Reply-To: <1175769886.10382.29.camel@localhost>
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<linux/ioctl.h>
> +#include<linux/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
next prev parent reply other threads:[~2007-04-10 14:17 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-05 10:44 [PATCH 01/01] New FBDev driver for Intel Vermilion Range Alan Hourihane
2007-04-05 17:38 ` Valdis.Kletnieks
2007-04-05 18:42 ` James Simmons
2007-04-05 18:58 ` Alan Hourihane
[not found] ` <200704052138.08897.arnd@arndb.de>
2007-04-05 21:42 ` Alan Hourihane
2007-04-05 21:56 ` Arnd Bergmann
2007-04-05 22:00 ` Antonino A. Daplas
2007-04-06 0:09 ` Antonino A. Daplas
2007-04-06 13:39 ` Alan Hourihane
2007-04-09 20:10 ` Pavel Machek [this message]
2007-04-20 9:04 ` Alan Hourihane
2007-04-20 13:51 ` Antonino A. Daplas
2007-04-20 13:54 ` Alan Hourihane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070409201050.GA4302@ucw.cz \
--to=pavel@ucw.cz \
--cc=alanh@fairlite.demon.co.uk \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox