From: Deepak Saxena <dsaxena@plexity.net>
To: Li Shaohua <shaohua.li@intel.com>
Cc: lkml <linux-kernel@vger.kernel.org>, Greg <greg@kroah.com>,
Andrew Morton <akpm@osdl.org>,
rmk@arm.linux.org.uk
Subject: Re: [PATCH]change 'struct device' -> platform_data to firmware_data
Date: Tue, 11 Jan 2005 19:54:46 -0800 [thread overview]
Message-ID: <20050112035446.GA11251@plexity.net> (raw)
In-Reply-To: <1105498626.26324.14.camel@sli10-desk.sh.intel.com>
On Jan 12 2005, at 10:57, Li Shaohua was caught saying:
> Hi,
> struct device->platform_data is designed for ACPI, BIOS or other
> platform specific data, but some drivers misused the field which makes
> adding ACPI handle in device core impossible. Greg suggested me changing
> the name of the filed and so it breaks all such drivers, and then fix
> them. I'll try to fix some, but it would be great if the driver authors
> could do it.
Whatever the original purpose of this field was, it is now in use by
several drivers for ARM systems where we need to support multiple SOCs
with slight variations and we use the platform_data field to pass
board-specific information to the drivers. Before we had this, we were
putting ugly #ifdefs in drivers. Examples of drivers using this
include:
- serial/8250.c.
platform_data points to a plat_serial8250_port structure that
provides per-serial port information such as capabilities and
uart clk rate.
- mtd/maps/various ARM drivers
platform_data points to a flash_platform_data structure containing
information such as bus width and function pointers for some init
and shutdown work.
- i2c/busses/i2c-ixp4xx.c and i2c-ixp2000.c
The IXP4xx and IXP2000 chips do not have an I2C controller and
use GPIO pins to create a bit-bang "adapter". What I2C lines to
use is up to the board designer so we pass that information via
a custom data structure shared between the driver and the board
level code that contains the GPIO lines to use for SCL and SDA.
i2c-s3c2410.c also seems to use platform_data to pass board-specific
information to the driver.
So the question I have is whether we are using the field as intended
or we have overloaded it with our own purposes?
If we are doing things incorrectly, I am not argueing that our usage
has to the way it sits. We could create a new generic serial_device and
flash_device structures and subsystems for these, but that requires
rewriting drivers and board ports; however, we need enough time
to work with appropriate subsystem maintainers to do so. My suggestion
is to add a new firmware_data field for use by ACPI ATM while we
clean things up in ARM world if so required. Since ACPI is non-existent
on ARM systems, another option is that we keep using the renamed data
structure as we have been doing. /me votes for this option
Thoughts?
~Deepak
--
Deepak Saxena - dsaxena@plexity.net - http://www.plexity.net
If you complain once more, you'll meet an army of me. - Bjork
next prev parent reply other threads:[~2005-01-12 3:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-12 2:57 [PATCH]change 'struct device' -> platform_data to firmware_data Li Shaohua
2005-01-12 3:54 ` Deepak Saxena [this message]
2005-01-12 5:06 ` Greg KH
2005-01-12 5:15 ` Li Shaohua
2005-01-12 6:07 ` Kumar Gala
2005-01-12 6:37 ` Li Shaohua
2005-01-12 5:02 ` Greg KH
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=20050112035446.GA11251@plexity.net \
--to=dsaxena@plexity.net \
--cc=akpm@osdl.org \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rmk@arm.linux.org.uk \
--cc=shaohua.li@intel.com \
/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