All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Daney <ddaney-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
To: Sergei Shtylyov <sshtylyov-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
Cc: linux-mips-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org,
	ralf-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org,
	khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org,
	rade.bozic.ext-OYasijW0DpE@public.gmane.org
Subject: Re: [PATCH 1/3] MIPS: Octeon: Add I2C platform driver.
Date: Thu, 07 Jan 2010 12:55:19 -0800	[thread overview]
Message-ID: <4B464A37.7020300@caviumnetworks.com> (raw)
In-Reply-To: <4B4645A3.30401-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>

Sergei Shtylyov wrote:
> Hello.
> 
> David Daney wrote:
> 
>> Signed-off-by: David Daney <ddaney-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
>> CC: Rade Bozic <rade.bozic.ext-OYasijW0DpE@public.gmane.org>
>>   
> [...]
>> diff --git a/arch/mips/cavium-octeon/octeon-platform.c 
>> b/arch/mips/cavium-octeon/octeon-platform.c
>> index 20698a6..f2c0602 100644
>> --- a/arch/mips/cavium-octeon/octeon-platform.c
>> +++ b/arch/mips/cavium-octeon/octeon-platform.c
>> @@ -165,6 +165,78 @@ out:
>>  }
>>  device_initcall(octeon_rng_device_init);
>>  
>> +
>> +#define OCTEON_I2C_IO_BASE 0x1180000001000ull
>> +#define OCTEON_I2C_IO_UNIT_OFFSET 0x200
>> +
>> +static struct octeon_i2c_data octeon_i2c_data[2];
>> +
>> +static int __init octeon_i2c_device_init(void)
>> +{
>> +    struct platform_device *pd;
>> +    int ret = 0;
>> +    int port, num_ports;
>> +
>> +    struct resource i2c_resources[] = {
>> +        {
>> +            .flags    = IORESOURCE_MEM,
>> +        }, {
>> +            .flags    = IORESOURCE_IRQ,
>> +        }
>> +    };
>> +
>> +    if (OCTEON_IS_MODEL(OCTEON_CN56XX) || 
>> OCTEON_IS_MODEL(OCTEON_CN52XX))
>> +        num_ports = 2;
>> +    else
>> +        num_ports = 1;
>> +
>> +    for (port = 0; port < num_ports; port++) {
>> +        octeon_i2c_data[port].sys_freq = octeon_get_clock_rate();
>> +        /*FIXME: should be examined. At the moment is set for 100Khz */
>> +        octeon_i2c_data[port].i2c_freq = 100000;
>> +
>> +        pd = platform_device_alloc("i2c-octeon", port);
>> +        if (!pd) {
>> +            ret = -ENOMEM;
>> +            goto out;
>> +        }
>> +
>> +        pd->dev.platform_data = octeon_i2c_data + port;
>> +
>> +        i2c_resources[0].start =
>> +            OCTEON_I2C_IO_BASE + (port * OCTEON_I2C_IO_UNIT_OFFSET);
>> +        i2c_resources[0].end = i2c_resources[0].start + 0x20;
>>   
> 
>   Not 0x1F?
> 

You are correct.  I will fix it.

David Daney

WARNING: multiple messages have this Message-ID (diff)
From: David Daney <ddaney@caviumnetworks.com>
To: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: linux-mips@linux-mips.org, ralf@linux-mips.org,
	linux-i2c@vger.kernel.org, ben-linux@fluff.org,
	khali@linux-fr.org, rade.bozic.ext@nsn.com
Subject: Re: [PATCH 1/3] MIPS: Octeon: Add I2C platform driver.
Date: Thu, 07 Jan 2010 12:55:19 -0800	[thread overview]
Message-ID: <4B464A37.7020300@caviumnetworks.com> (raw)
In-Reply-To: <4B4645A3.30401@ru.mvista.com>

Sergei Shtylyov wrote:
> Hello.
> 
> David Daney wrote:
> 
>> Signed-off-by: David Daney <ddaney@caviumnetworks.com>
>> CC: Rade Bozic <rade.bozic.ext@nsn.com>
>>   
> [...]
>> diff --git a/arch/mips/cavium-octeon/octeon-platform.c 
>> b/arch/mips/cavium-octeon/octeon-platform.c
>> index 20698a6..f2c0602 100644
>> --- a/arch/mips/cavium-octeon/octeon-platform.c
>> +++ b/arch/mips/cavium-octeon/octeon-platform.c
>> @@ -165,6 +165,78 @@ out:
>>  }
>>  device_initcall(octeon_rng_device_init);
>>  
>> +
>> +#define OCTEON_I2C_IO_BASE 0x1180000001000ull
>> +#define OCTEON_I2C_IO_UNIT_OFFSET 0x200
>> +
>> +static struct octeon_i2c_data octeon_i2c_data[2];
>> +
>> +static int __init octeon_i2c_device_init(void)
>> +{
>> +    struct platform_device *pd;
>> +    int ret = 0;
>> +    int port, num_ports;
>> +
>> +    struct resource i2c_resources[] = {
>> +        {
>> +            .flags    = IORESOURCE_MEM,
>> +        }, {
>> +            .flags    = IORESOURCE_IRQ,
>> +        }
>> +    };
>> +
>> +    if (OCTEON_IS_MODEL(OCTEON_CN56XX) || 
>> OCTEON_IS_MODEL(OCTEON_CN52XX))
>> +        num_ports = 2;
>> +    else
>> +        num_ports = 1;
>> +
>> +    for (port = 0; port < num_ports; port++) {
>> +        octeon_i2c_data[port].sys_freq = octeon_get_clock_rate();
>> +        /*FIXME: should be examined. At the moment is set for 100Khz */
>> +        octeon_i2c_data[port].i2c_freq = 100000;
>> +
>> +        pd = platform_device_alloc("i2c-octeon", port);
>> +        if (!pd) {
>> +            ret = -ENOMEM;
>> +            goto out;
>> +        }
>> +
>> +        pd->dev.platform_data = octeon_i2c_data + port;
>> +
>> +        i2c_resources[0].start =
>> +            OCTEON_I2C_IO_BASE + (port * OCTEON_I2C_IO_UNIT_OFFSET);
>> +        i2c_resources[0].end = i2c_resources[0].start + 0x20;
>>   
> 
>   Not 0x1F?
> 

You are correct.  I will fix it.

David Daney

  parent reply	other threads:[~2010-01-07 20:55 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-07 19:50 [PATCH 0/3] Add I2C support for Octeon SOCs David Daney
2010-01-07 19:50 ` David Daney
     [not found] ` <4B463B1F.6000404-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
2010-01-07 19:54   ` [PATCH 1/3] MIPS: Octeon: Add I2C platform driver David Daney
2010-01-07 19:54     ` David Daney
     [not found]     ` <1262894061-32613-1-git-send-email-ddaney-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
2010-01-07 20:35       ` Sergei Shtylyov
2010-01-07 20:35         ` Sergei Shtylyov
     [not found]         ` <4B4645A3.30401-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
2010-01-07 20:55           ` David Daney [this message]
2010-01-07 20:55             ` David Daney
2010-01-07 21:23             ` [PATCH 1/3] MIPS: Octeon: Add I2C platform device David Daney
2010-01-07 19:54   ` [PATCH 2/3] I2C: Add driver for Cavium OCTEON I2C ports David Daney
2010-01-07 19:54     ` David Daney
     [not found]     ` <1262894061-32613-2-git-send-email-ddaney-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
2010-01-24 16:00       ` Ben Dooks
2010-01-24 16:00         ` Ben Dooks
2010-01-25 15:12         ` Bozic, Rade (EXT-Other - DE/Ulm)
2010-01-25 15:12           ` Bozic, Rade (EXT-Other - DE/Ulm)
     [not found]         ` <20100124160017.GF28675-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
2010-01-25 11:55           ` Michael Lawnick
2010-01-25 11:55             ` Michael Lawnick
2010-01-25 18:19           ` David Daney
2010-01-25 18:19             ` David Daney
2010-01-07 19:54   ` [PATCH 3/3] MIPS: Octeon: Register some devices on the I2C bus David Daney
2010-01-07 19:54     ` David Daney
2010-01-07 19:56   ` [PATCH 0/3] Add I2C support for Octeon SOCs David Daney
2010-01-07 19:56     ` David Daney
     [not found]     ` <4B463C71.3080005-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
2010-01-11 14:44       ` Ralf Baechle
2010-01-11 14:44         ` Ralf Baechle
     [not found]         ` <20100111144416.GA23157-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org>
2010-01-11 17:16           ` David Daney
2010-01-11 17:16             ` David Daney
     [not found]             ` <4B4B5CD3.4040204-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
2010-01-11 17:23               ` Jean Delvare
2010-01-11 17:23                 ` Jean Delvare
2010-01-13  0:49             ` Markus Gothe
     [not found]               ` <F5F1F5D1-6057-49CF-A5B3-A921E1C0EEEB-SamgB31n2u5IcsJQ0EH25Q@public.gmane.org>
2010-01-13  9:29                 ` Jean Delvare
2010-01-13  9:29                   ` Jean Delvare

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=4B464A37.7020300@caviumnetworks.com \
    --to=ddaney-m3mlkvoiwjvv6pq1l3v1odbpr1lh4cv8@public.gmane.org \
    --cc=ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org \
    --cc=khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-mips-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org \
    --cc=rade.bozic.ext-OYasijW0DpE@public.gmane.org \
    --cc=ralf-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org \
    --cc=sshtylyov-hkdhdckH98+B+jHODAdFcQ@public.gmane.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.