public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Antonino A. Daplas" <adaplas@pol.net>
To: Krzysztof Halasa <khc@pm.waw.pl>
Cc: Jean Delvare <khali@linux-fr.org>, Andrew Morton <akpm@osdl.org>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] cirrus-logic-framebuffer-i2c-support.patch
Date: Mon, 10 Jul 2006 07:53:17 +0800	[thread overview]
Message-ID: <44B196ED.1070804@pol.net> (raw)
In-Reply-To: <m3bqryv7jx.fsf_-_@defiant.localdomain>

Krzysztof Halasa wrote:
> Hi,
> 
> I've attached the second version of the Cirrus Logic I2C patch.
> Supersedes:
> cirrus-logic-framebuffer-i2c-support.patch
> cirrus-logic-framebuffer-i2c-support-fix.patch
> 
> Created against current Linus' tree.
> Thanks.
> 
> Signed-off-by: Krzysztof Halasa <khc@pm.waw.pl>
> 


> @@ -2335,6 +2376,36 @@ static int cirrusfb_register(struct cirr
>  		goto err_dealloc_cmap;
>  	}
>  
> +#ifdef CONFIG_FB_CIRRUS_I2C
> +	cinfo->i2c_used = 0;
> +	if (cinfo->btype == BT_ALPINE || cinfo->btype == BT_PICASSO4) {
> +		vga_wseq(cinfo->regbase, 0x08, 0x41); /* DDC mode: SCL */
> +		vga_wseq(cinfo->regbase, 0x08, 0x43); /* DDC mode: SCL + SDA */
> +		cinfo->bit_cirrus_data.setsda = alpine_setsda;
> +		cinfo->bit_cirrus_data.setscl = alpine_setscl;
> +		cinfo->bit_cirrus_data.getsda = alpine_getsda;
> +		cinfo->bit_cirrus_data.getscl = alpine_getscl;
> +		cinfo->bit_cirrus_data.udelay = 5;
> +		cinfo->bit_cirrus_data.mdelay = 1;
> +		cinfo->bit_cirrus_data.timeout = HZ;
> +		cinfo->bit_cirrus_data.data = cinfo;
> +		cinfo->cirrus_ops.owner = THIS_MODULE;
> +		cinfo->cirrus_ops.id = I2C_HW_B_CIRRUS;
> +		cinfo->cirrus_ops.class = I2C_CLASS_DDC;
> +		cinfo->cirrus_ops.algo_data = &cinfo->bit_cirrus_data;
> +		cinfo->cirrus_ops.dev.parent = info->device;
> +		strlcpy(cinfo->cirrus_ops.name, "Cirrus Logic DDC I2C adapter",
> +			I2C_NAME_SIZE);
> +		if (!(err = i2c_bit_add_bus(&cinfo->cirrus_ops))) {
> +			printk(KERN_DEBUG "Initialized Cirrus Logic I2C"
> +			       " adapter\n");
> +			cinfo->i2c_used = 1;
> +		} else
> +			printk(KERN_WARNING "Unable to initialize Cirrus"
> +			       " Logic I2C adapter (result = %i)\n", err);
> +	}
> +#endif

Why don't you create a separate function for this, ie cirrusfb_create_i2c()
or something. This way, we eliminate the #ifdef/#endif inside the function.

> +
>  	DPRINTK ("EXIT, returning 0\n");
>  	return 0;
>  
> @@ -2350,6 +2421,10 @@ static void __devexit cirrusfb_cleanup (
>  	struct cirrusfb_info *cinfo = info->par;
>  	DPRINTK ("ENTER\n");
>  
> +#ifdef CONFIG_FB_CIRRUS_I2C
> +	if (cinfo->i2c_used)
> +		i2c_bit_del_bus(&cinfo->cirrus_ops);
> +#endif

Same here.

Tony

  reply	other threads:[~2006-07-09 23:53 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200607050147.k651kxmT023763@shell0.pdx.osdl.net>
     [not found] ` <20060705165255.ab7f1b83.khali@linux-fr.org>
2006-07-09 20:37   ` [PATCH v2] cirrus-logic-framebuffer-i2c-support.patch Krzysztof Halasa
2006-07-09 23:53     ` Antonino A. Daplas [this message]
2006-07-10  9:49       ` Krzysztof Halasa
2006-07-10 10:07         ` Antonino A. Daplas
2006-07-10 10:49           ` Krzysztof Halasa
2006-07-10 11:27             ` Antonino A. Daplas
2006-07-10 11:49               ` Krzysztof Halasa
2006-07-10 12:32                 ` Antonino A. Daplas
2006-07-10 13:09                   ` Krzysztof Halasa
2006-07-10 14:29                     ` Antonino A. Daplas
2006-07-10 14:46                       ` Krzysztof Halasa
2006-07-27 21:23                       ` Jean Delvare
2006-07-10 13:27                   ` Krzysztof Halasa
2006-07-10 14:11                     ` Antonino A. Daplas
2006-07-10 15:37                       ` Krzysztof Halasa
2006-07-10 16:30                         ` Antonino A. Daplas
2006-07-10 20:34                           ` Krzysztof Halasa
2006-07-11  7:22                             ` Antonino A. Daplas
2006-07-11 10:53                               ` Krzysztof Halasa
2006-07-27 20:55                                 ` Jean Delvare
2006-07-28 10:05                                   ` Krzysztof Halasa
2006-07-10 15:18                     ` Antonino A. Daplas

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=44B196ED.1070804@pol.net \
    --to=adaplas@pol.net \
    --cc=akpm@osdl.org \
    --cc=khali@linux-fr.org \
    --cc=khc@pm.waw.pl \
    --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