Skip to contentSkip to conversation

IBM ocp I2C

PATCH In review andrew may 2 participants 10 messages Apr 24, 2002 – May 1, 2002

lore
Share & tools
lore

andrew may

author
#0 lore raw

PATCH 1/1 IBM ocp I2C

Would anyone be heartbroken if "struct i2c_algo_iic_data" went away completely?

In this patch I dump getown and getclock because they aren't used and I am sure there is a better way to do things.

Also calculate the I2C div value from the clock rate. I am not sure if that will work on all 4xx types but it does the right thing for my 405's.

I also fixed a few C++ style comments.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

author
#1 lore raw
Quoted 12 lines · andrew may

Would anyone be heartbroken if "struct i2c_algo_iic_data" went away completely?

In this patch I dump getown and getclock because they aren't used and I am sure there is a better way to do things.

Also calculate the I2C div value from the clock rate. I am not sure if that will work on all 4xx types but it does the right thing for my 405's.

I also fixed a few C++ style comments.

and the patch

#2 lore raw
Quoted 8 lines · andrew may
Quoted 6 lines · andrew may

Would anyone be heartbroken if "struct i2c_algo_iic_data" went away completely?

In this patch I dump getown and getclock because they aren't used and I am sure there is a better way to do things.

Quoted 9 lines
Quoted 7 lines

Also calculate the I2C div value from the clock rate. I am not sure if that will work on all 4xx types but it does the right thing for my 405's.

I also fixed a few C++ style comments.

and the patch

Andrew,

could you provide a single patch that would be applied on top of the *devel. I appreciate the changes and I will get back to you in on "struct i2c_algo_iic_data". I will need to try the div changes on the redwoods (stb03 & stb04 cpus).

armin

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

author
#3 lore raw
Quoted 19 lines · Armin
Quoted 8 lines · andrew may
Quoted 6 lines · andrew may

Would anyone be heartbroken if "struct i2c_algo_iic_data" went away completely?

In this patch I dump getown and getclock because they aren't used and I am sure there is a better way to do things.

Quoted 9 lines
Quoted 7 lines

Also calculate the I2C div value from the clock rate. I am not sure if that will work on all 4xx types but it does the right thing for my 405's.

I also fixed a few C++ style comments.

and the patch

Quoted 7 lines

Andrew,

could you provide a single patch that would be applied on top of the *devel. I appreciate the changes and I will get back to you in on "struct i2c_algo_iic_data". I will need to try the div changes on the redwoods (stb03 & stb04 cpus).

This is a single patch, and you should be able to apply it without the other patches I sent.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

author
#4 lore raw
In reply to andrew may

This patch is also needed to get it to compile. I forgot to check things after I removed the stuff from the headers.

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux 2.4 for PowerPC development tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.966 -> 1.967
# drivers/i2c/i2c-adap-ibm_ocp.c 1.2 -> 1.3
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/04/24 [email protected] 1.967

# remove dead code
# --------------------------------------------
#
diff -Nru a/drivers/i2c/i2c-adap-ibm_ocp.c b/drivers/i2c/i2c-adap-ibm_ocp.c
--- a/drivers/i2c/i2c-adap-ibm_ocp.c	Wed Apr 24 11:21:27 2002
+++ b/drivers/i2c/i2c-adap-ibm_ocp.c	Wed Apr 24 11:21:27 2002
@@ -304,8 +304,6 @@
       iic_ibmocp_data[i]->data = (struct iic_regs *)iic_ibmocp_adaps[i];
       iic_ibmocp_data[i]->setiic = iic_ibmocp_setbyte;
       iic_ibmocp_data[i]->getiic = iic_ibmocp_getbyte;
-      iic_ibmocp_data[i]->getown = 0;
-      iic_ibmocp_data[i]->getclock = 0;
       iic_ibmocp_data[i]->waitforpin = iic_ibmocp_waitforpin;
       iic_ibmocp_data[i]->udelay = 80;
       iic_ibmocp_data[i]->mdelay = 80;
#5 lore raw
Quoted 4 lines · andrew may

This patch is also needed to get it to compile. I forgot to check things after I removed the stuff from the headers.

Andrew,

Thanks, the clock changes are on hold until I can validate on the other 40x boards I have that support i2c.

armin

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#7 lore raw
In reply to andrew may
Quoted 2 lines · andrew may

Would anyone be heartbroken if "struct i2c_algo_iic_data" went away completely?

It might with the us of ocp_driver struct. still working on it

Quoted 3 lines

In this patch I dump getown and getclock because they aren't used and I am sure there is a better way to do things.

this does not work on Walnut since "procfreq" is not part of openbios and the PLLMR does not exsist on the stb03 or 03 so this changes wont go in.

Quoted 6 lines

Also calculate the I2C div value from the clock rate. I am not sure if that will work on all 4xx types but it does the right thing for my 405's.

I also fixed a few C++ style comments.

thanks

armin

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

author
#8 lore raw
Quoted 6 lines · Armin
Quoted 2 lines

In this patch I dump getown and getclock because they aren't used and I am sure there is a better way to do things.

this does not work on Walnut since "procfreq" is not part of openbios and the PLLMR does not exsist on the stb03 or 03 so this changes wont go in.

I don't have a stb03 or even know what chip it uses, so I have no idea what to do about it. We should have some generic 4xx functions to get the CPU/PLB/OPB clocks so we can calculate what the I2C div should be. We could always try trusing what the BIOS sets the divider to as well.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#9 lore raw
Quoted 10 lines · andrew may
Quoted 7 lines · Armin
Quoted 3 lines

In this patch I dump getown and getclock because they aren't used and I am sure there is a better way to do things.

this does not work on Walnut since "procfreq" is not part of openbios and the PLLMR does not exsist on the stb03 or 03 so this changes wont go in.

Quoted 8 lines

I don't have a stb03 or even know what chip it uses, so I have no idea what to do about it. We should have some generic 4xx functions to get the CPU/PLB/OPB clocks so we can calculate what the I2C div should be. We could always try trusing what the BIOS sets the divider to as well.

Andrew,

I agree, the issue I have is that the clock solution was too arch/bios specific and should reside somewhere outside the driver in the form of a fuction or variable (as you suggest) that can take into accout the differences in arch and possibly bios.

Thanks

armin

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#6 lore raw
In reply to andrew may
Quoted 24 lines · andrew may

This patch is also needed to get it to compile. I forgot to check things after I removed the stuff from the headers.

------------------------------------------------------------------------

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux 2.4 for PowerPC development tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.966 -> 1.967
# drivers/i2c/i2c-adap-ibm_ocp.c 1.2 -> 1.3
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/04/24 [email protected] 1.967

# remove dead code
# --------------------------------------------
#
diff -Nru a/drivers/i2c/i2c-adap-ibm_ocp.c b/drivers/i2c/i2c-adap-ibm_ocp.c

drivers/i2c/i2c-adap-ibm_ocp.c line 309

Quoted 8 lines
drivers/i2c/i2c-adap-ibm_ocp.c +0 -2
@@ -304,8 +304,6 @@
       iic_ibmocp_data[i]->data = (struct iic_regs *)iic_ibmocp_adaps[i];
       iic_ibmocp_data[i]->setiic = iic_ibmocp_setbyte;
       iic_ibmocp_data[i]->getiic = iic_ibmocp_getbyte;
-      iic_ibmocp_data[i]->getown = 0;
-      iic_ibmocp_data[i]->getclock = 0;
       iic_ibmocp_data[i]->waitforpin = iic_ibmocp_waitforpin;
       iic_ibmocp_data[i]->udelay = 80;
       iic_ibmocp_data[i]->mdelay = 80;

Andrew,

the entier ibm_ibmocp_data has beeen removed, found other ways arround it

Armin

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/