From: "corentin.labbe" <corentin.labbe@geomatys.fr>
To: sparclinux@vger.kernel.org
Subject: Re: patch for i2c_ali1535 working on SPARC
Date: Thu, 09 Jun 2011 11:37:43 +0000 [thread overview]
Message-ID: <4DF0B087.9090902@geomatys.fr> (raw)
In-Reply-To: <4DEC895B.30101@geomatys.fr>
Le 06/06/2011 10:01, corentin.labbe a écrit :
> Hello
>
> I have a sun blade 100 and I want to get the sensors working with
> lm_sensors, but in current state, it doesn't work.
>
> After some research, i have found that all smbus driver and the i2c_ali1535 particularly cant work.
> It assumes that ioport address are 16bits wide (address stored with an unsigned short).
> But on SPARC arch, ioports are mapped in memory and so are stored with an unsigned long.
>
> So I write a patch for i2c_ali1535 for supporting SPARC architecture.
> With this patch, the driver i2c_ali1535 loads and works successfully.
> # sensors
> adm1023-i2c-0-18
> Adapter: SMBus ALI1535 adapter at 0x1fe02000620
> temp1: +31.0 C (low = -55.0 C, high = +127.0 C)
> temp2: +61.6 C (low = -55.0 C, high = +127.0 C)
>
> But this patch is bad because the base address for ioport is hard-coded (0x1fe02000000).
> I have tried to understand how works all SPARC drivers but I cant find how to get that.
>
> Perhaps i can get some usefull infos with all of_* functions but i dont know what exaclty means infos printed by prtconf (assigned-addresses and reg specifically).
> Node 0xf0083f44
> .node: f0083f44
> assigned-addresses: 81001810.00000000.00000000.00000000.00000010
> name: 'pmu'
> ranges: 00000000.00000000.00001800.00000000.00000000.00000100.00000001.00000000.81001810.00000000.00000600.00000100.00000002.00000000.81001814.00000000.00000000.00000100
> reg: 00001800.00000000.00000000.00000000.00000000.81001810.00000000.00000600.00000000.00000010
> compatible: 70636931.3062392c.37313031.2e300070.63693130.62392c37.31303100.70636963.6c617373.2c303030.30303000.70636963.6c617373.2c303030.3000
> #address-cells: 00000002
> #size-cells: 00000001
> devsel-speed: 00000001
> class-code: 00000000
> latency-timer: 00000000
> cache-line-size: 00000000
> max-latency: 00000000
> min-grant: 00000000
> revision-id: 00000000
> device-id: 00007101
> vendor-id: 000010b9
>
> Node 0xf00849c4
> .node: f00849c4
> reg: 00000000.00000000.00000100.00000001.00000000.00000100
> #address-cells: 00000002
> #size-cells: 00000000
> interrupts: 00000001
> compatible: 'i2c-smbus'
> name: 'i2c'
>
> Node 0xf008505c
> .node: f008505c
> compatible: 'i2c-max1617'
> name: 'temperature'
> reg: 00000000.00000030
>
>
> Best regards
Hello
Sorry, i think i must clarify, my question is:
Is there a way to figure out the I/O port offset without hard-coding it ?
I have found pci_determine_mem_io_space() in arch/sparc/kernel/pci_common.c and struct iomem_resource.start but still dont know if it is a good way to get it.
Thanks in advance
Best regards
prev parent reply other threads:[~2011-06-09 11:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-06 8:01 patch for i2c_ali1535 working on SPARC corentin.labbe
2011-06-09 11:37 ` corentin.labbe [this message]
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=4DF0B087.9090902@geomatys.fr \
--to=corentin.labbe@geomatys.fr \
--cc=sparclinux@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 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.