All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Miao <eric.y.miao@gmail.com>
To: Stefan Schmidt <stefan@datenfreihafen.org>
Cc: pHilipp Zabel <philipp.zabel@gmail.com>,
	linux-arm-kernel@lists.arm.linux.org.uk, sameo@openedhand.com,
	linux-kernel@vger.kernel.org, Daniel Ribeiro <wyrm@openezx.org>
Subject: Re: [Patch 06/10] mfd: PCAP driver for the Motorola EZX GSM mobile phones
Date: Tue, 08 Jul 2008 14:49:06 +0800	[thread overview]
Message-ID: <48730DE2.2050302@gmail.com> (raw)
In-Reply-To: <20080707200251.GA3449@datenfreihafen.org>

Stefan Schmidt wrote:

>> Otherwise I'd dislike the hardcoded IRQ numbers in the MFD driver.
> 
> So far it seems to be no problem. If there is a strong feeling to change this we
> will of course work on that. Personally I would prefer to do this when new users
> of this driver appear.

The irq2pcap[] array looks horrible to me. It's actually a sparse array.
Isn't there a nice 1:1 mapping using a formular??

Besides, the IRQ numbering scheme has now changed to a more generic way,
I suggest to pull from Russell's latest git tree and rebase the IRQ
part.

> 
>> The machine_is_xyz() calls inside ezx-pcap could be replaced with
>> configuration via platform_data (have pcap_platform_data->cs_inverted,
>> for example)
> 
> We had this before and it turned out as messy as this solution. We have one
> machine file that supports up to 6 devices right now. So we would have to deal
> with the same machine_is_xyz macros in the machine file.
> 
> We thought it would be better to let the driver handle this. Open for discussion
> of course.

The following block of code:

+	if (pcap_data->cs >= 0) {
+		if (machine_is_ezx_a780() || machine_is_ezx_e680())
+			gpio_direction_output(pcap_data->cs, 1);
+		else
+			gpio_direction_output(pcap_data->cs, 0);
+	}

has 3 occurrences in the driver (2 in ezx_ssp_pcap_putget, 1 in ezx_pcap_probe)
which is good reason to fold this into the platform data.

Well, if the above is done in platform data, I guess you won't mind another bit
flag (e.g. PCAP_REDIRECT_IRQ or something alike) added in platform data, either

> 
>>> +#if 0
>>> +#define DEBUGP(x, args...) printk(x, ## args)
>>> +#else
>>> +#define DEBUGP(x, args...)
>>> +#endif
>> Could you remove the custom debug macros and use pr_debug (or even
>> better, dev_dbg) instead?
> 
> Will do.
> 
>>> +static void __exit ezx_pcap_exit(void)
>>> +{
>>> +       return platform_driver_unregister(&ezxpcap_driver);
>>> +}
>>> +
>>> +module_init(ezx_pcap_init);
>> Depending on what platform_devices depend on this, maybe use
>> subsys_initcall here.
> 
> Ok, I'll need to look up on this to see if it is an option.
> 
>>> +module_exit(ezx_pcap_exit);
>> Why bother with module_exit when the Kconfig option is bool?
> 
> Well, matter of taste. :)
> 
> Taking care about cleanup is good style. Still you are right that it is useles
> for the time being.
> 
>>> +#define PCAP_IRQ_USB4V         (1 << 6)        /* USB above 4volt???
>>> +                                               called "USBDET_4V" in blob */
>> I assume that's for OTG operation. The VBUS voltage is valid from 4.4 V, and the
>> PXA27x UDC controller has "Vbus valid 4.0 V" and "Vbus valid 4.4 V" interrupts
> 
> ok
> 
>>> +       /*  set core voltage */
>>> +       ezx_pcap_set_sw(SW1, SW_VOLTAGE, SW_VOLTAGE_1250);
>> Btw, did you see the voltage regulator framework that is in linux-next?
> 
> Heard of it, but not read the code yet. It's on my list. I just a bit hesitant
> to base on code that is not in mainline yet. But -next should be ok.
> 
>>> -
>>> +       platform_device_register(&ezx_pcap_device);
>>>        platform_add_devices(devices, ARRAY_SIZE(devices));
>> You could put ezx_pcap_device into the beginning of devices[].
> 
> Duh, will fix.
> 
> I send out an updated patch tomorrow. Need some sleep now.
> 
> Thanks for the feedback.
> 
> regards
> Stefan Schmidt
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/


  reply	other threads:[~2008-07-08  6:49 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20080707184000.411913919@datenfreihafen.org>
2008-07-07 18:40 ` [Patch 01/10] pxafb: More LCCR3 depth defines stefan
2008-07-08  7:43   ` Eric Miao
2008-07-07 18:40 ` [Patch 02/10] pxafb: Support for RGB666, RGBT666, RGB888 and RGBT888 stefan
2008-07-08  7:45   ` Eric Miao
2008-07-08 20:13     ` Stefan Schmidt
2008-07-07 18:40 ` [Patch 06/10] mfd: PCAP driver for the Motorola EZX GSM mobile phones stefan
2008-07-07 19:21   ` pHilipp Zabel
2008-07-07 20:02     ` Stefan Schmidt
2008-07-08  6:49       ` Eric Miao [this message]
2008-07-08 14:01         ` Daniel Ribeiro
2008-07-08 20:32           ` Stefan Schmidt
2008-07-08 21:19             ` pHilipp Zabel
2008-07-09  2:34             ` Eric Miao
2008-07-09  6:26               ` Stefan Schmidt
2008-07-09 15:29             ` Liam Girdwood
2008-07-10 16:21             ` Russell King - ARM Linux
2008-07-10 16:40               ` Stefan Schmidt
2008-07-07 18:40 ` [Patch 08/10] input: Touchscreen driver for the PCAP stefan
2008-07-07 20:13   ` Dmitry Torokhov
2008-07-07 20:22     ` Stefan Schmidt
2008-07-08  7:40       ` Eric Miao
2008-07-08 20:24         ` Stefan Schmidt
2008-07-08 20:26     ` Stefan Schmidt
2008-07-10 14:23       ` Dmitry Torokhov
2008-07-11 15:23         ` Stefan Schmidt

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=48730DE2.2050302@gmail.com \
    --to=eric.y.miao@gmail.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=philipp.zabel@gmail.com \
    --cc=sameo@openedhand.com \
    --cc=stefan@datenfreihafen.org \
    --cc=wyrm@openezx.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.