Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 34054
b: refs/heads/master
c: 018a3d1
h: refs/heads/master
v: v3
  • Loading branch information
Jeremy Kerr authored and Paul Mackerras committed Jul 31, 2006
1 parent a7d2432 commit b0de6c1
Show file tree
Hide file tree
Showing 30 changed files with 167 additions and 159 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: eeb2b723ef5100fafa381d92eb70d83e98516a44
refs/heads/master: 018a3d1db7cdb6127656c1622ee1d2302e16436d
3 changes: 2 additions & 1 deletion trunk/arch/powerpc/platforms/powermac/backlight.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ int pmac_has_backlight_type(const char *type)
struct device_node* bk_node = find_devices("backlight");

if (bk_node) {
char *prop = get_property(bk_node, "backlight-control", NULL);
const char *prop = get_property(bk_node,
"backlight-control", NULL);
if (prop && strncmp(prop, type, strlen(type)) == 0)
return 1;
}
Expand Down
23 changes: 12 additions & 11 deletions trunk/arch/powerpc/platforms/powermac/cpufreq_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ static int pmac_cpufreq_cpu_init(struct cpufreq_policy *policy)

static u32 read_gpio(struct device_node *np)
{
u32 *reg = (u32 *)get_property(np, "reg", NULL);
const u32 *reg = get_property(np, "reg", NULL);
u32 offset;

if (reg == NULL)
Expand Down Expand Up @@ -497,7 +497,7 @@ static int pmac_cpufreq_init_MacRISC3(struct device_node *cpunode)
"frequency-gpio");
struct device_node *slew_done_gpio_np = of_find_node_by_name(NULL,
"slewing-done");
u32 *value;
const u32 *value;

/*
* Check to see if it's GPIO driven or PMU only
Expand All @@ -519,15 +519,15 @@ static int pmac_cpufreq_init_MacRISC3(struct device_node *cpunode)
*/
if (frequency_gpio && slew_done_gpio) {
int lenp, rc;
u32 *freqs, *ratio;
const u32 *freqs, *ratio;

freqs = (u32 *)get_property(cpunode, "bus-frequencies", &lenp);
freqs = get_property(cpunode, "bus-frequencies", &lenp);
lenp /= sizeof(u32);
if (freqs == NULL || lenp != 2) {
printk(KERN_ERR "cpufreq: bus-frequencies incorrect or missing\n");
return 1;
}
ratio = (u32 *)get_property(cpunode, "processor-to-bus-ratio*2", NULL);
ratio = get_property(cpunode, "processor-to-bus-ratio*2", NULL);
if (ratio == NULL) {
printk(KERN_ERR "cpufreq: processor-to-bus-ratio*2 missing\n");
return 1;
Expand Down Expand Up @@ -562,7 +562,7 @@ static int pmac_cpufreq_init_MacRISC3(struct device_node *cpunode)
/* If we use the PMU, look for the min & max frequencies in the
* device-tree
*/
value = (u32 *)get_property(cpunode, "min-clock-frequency", NULL);
value = get_property(cpunode, "min-clock-frequency", NULL);
if (!value)
return 1;
low_freq = (*value) / 1000;
Expand All @@ -571,7 +571,7 @@ static int pmac_cpufreq_init_MacRISC3(struct device_node *cpunode)
if (low_freq < 100000)
low_freq *= 10;

value = (u32 *)get_property(cpunode, "max-clock-frequency", NULL);
value = get_property(cpunode, "max-clock-frequency", NULL);
if (!value)
return 1;
hi_freq = (*value) / 1000;
Expand Down Expand Up @@ -611,13 +611,14 @@ static int pmac_cpufreq_init_7447A(struct device_node *cpunode)
static int pmac_cpufreq_init_750FX(struct device_node *cpunode)
{
struct device_node *volt_gpio_np;
u32 pvr, *value;
u32 pvr;
const u32 *value;

if (get_property(cpunode, "dynamic-power-step", NULL) == NULL)
return 1;

hi_freq = cur_freq;
value = (u32 *)get_property(cpunode, "reduced-clock-frequency", NULL);
value = get_property(cpunode, "reduced-clock-frequency", NULL);
if (!value)
return 1;
low_freq = (*value) / 1000;
Expand Down Expand Up @@ -650,7 +651,7 @@ static int pmac_cpufreq_init_750FX(struct device_node *cpunode)
static int __init pmac_cpufreq_setup(void)
{
struct device_node *cpunode;
u32 *value;
const u32 *value;

if (strstr(cmd_line, "nocpufreq"))
return 0;
Expand All @@ -661,7 +662,7 @@ static int __init pmac_cpufreq_setup(void)
goto out;

/* Get current cpu clock freq */
value = (u32 *)get_property(cpunode, "clock-frequency", NULL);
value = get_property(cpunode, "clock-frequency", NULL);
if (!value)
goto out;
cur_freq = (*value) / 1000;
Expand Down
27 changes: 14 additions & 13 deletions trunk/arch/powerpc/platforms/powermac/cpufreq_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ static DEFINE_MUTEX(g5_switch_mutex);

#ifdef CONFIG_PPC_SMU

static u32 *g5_pmode_data;
static const u32 *g5_pmode_data;
static int g5_pmode_max;

static struct smu_sdbp_fvt *g5_fvt_table; /* table of op. points */
Expand Down Expand Up @@ -391,7 +391,8 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpus)
unsigned int psize, ssize;
unsigned long max_freq;
char *freq_method, *volt_method;
u32 *valp, pvr_hi;
const u32 *valp;
u32 pvr_hi;
int use_volts_vdnap = 0;
int use_volts_smu = 0;
int rc = -ENODEV;
Expand All @@ -409,8 +410,7 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpus)
/* Get first CPU node */
for (cpunode = NULL;
(cpunode = of_get_next_child(cpus, cpunode)) != NULL;) {
u32 *reg =
(u32 *)get_property(cpunode, "reg", NULL);
const u32 *reg = get_property(cpunode, "reg", NULL);
if (reg == NULL || (*reg) != 0)
continue;
if (!strcmp(cpunode->type, "cpu"))
Expand All @@ -422,7 +422,7 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpus)
}

/* Check 970FX for now */
valp = (u32 *)get_property(cpunode, "cpu-version", NULL);
valp = get_property(cpunode, "cpu-version", NULL);
if (!valp) {
DBG("No cpu-version property !\n");
goto bail_noprops;
Expand All @@ -434,15 +434,15 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpus)
}

/* Look for the powertune data in the device-tree */
g5_pmode_data = (u32 *)get_property(cpunode, "power-mode-data",&psize);
g5_pmode_data = get_property(cpunode, "power-mode-data",&psize);
if (!g5_pmode_data) {
DBG("No power-mode-data !\n");
goto bail_noprops;
}
g5_pmode_max = psize / sizeof(u32) - 1;

if (use_volts_smu) {
struct smu_sdbp_header *shdr;
const struct smu_sdbp_header *shdr;

/* Look for the FVT table */
shdr = smu_get_sdb_partition(SMU_SDB_FVT_ID, NULL);
Expand Down Expand Up @@ -493,7 +493,7 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpus)
* half freq in this version. So far, I haven't yet seen a machine
* supporting anything else.
*/
valp = (u32 *)get_property(cpunode, "clock-frequency", NULL);
valp = get_property(cpunode, "clock-frequency", NULL);
if (!valp)
return -ENODEV;
max_freq = (*valp)/1000;
Expand Down Expand Up @@ -541,8 +541,8 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpus)
static int __init g5_pm72_cpufreq_init(struct device_node *cpus)
{
struct device_node *cpuid = NULL, *hwclock = NULL, *cpunode = NULL;
u8 *eeprom = NULL;
u32 *valp;
const u8 *eeprom = NULL;
const u32 *valp;
u64 max_freq, min_freq, ih, il;
int has_volt = 1, rc = 0;

Expand All @@ -563,7 +563,7 @@ static int __init g5_pm72_cpufreq_init(struct device_node *cpus)
/* Lookup the cpuid eeprom node */
cpuid = of_find_node_by_path("/u3@0,f8000000/i2c@f8001000/cpuid@a0");
if (cpuid != NULL)
eeprom = (u8 *)get_property(cpuid, "cpuid", NULL);
eeprom = get_property(cpuid, "cpuid", NULL);
if (eeprom == NULL) {
printk(KERN_ERR "cpufreq: Can't find cpuid EEPROM !\n");
rc = -ENODEV;
Expand All @@ -573,7 +573,8 @@ static int __init g5_pm72_cpufreq_init(struct device_node *cpus)
/* Lookup the i2c hwclock */
for (hwclock = NULL;
(hwclock = of_find_node_by_name(hwclock, "i2c-hwclock")) != NULL;){
char *loc = get_property(hwclock, "hwctrl-location", NULL);
const char *loc = get_property(hwclock,
"hwctrl-location", NULL);
if (loc == NULL)
continue;
if (strcmp(loc, "CPU CLOCK"))
Expand Down Expand Up @@ -637,7 +638,7 @@ static int __init g5_pm72_cpufreq_init(struct device_node *cpus)
*/

/* Get max frequency from device-tree */
valp = (u32 *)get_property(cpunode, "clock-frequency", NULL);
valp = get_property(cpunode, "clock-frequency", NULL);
if (!valp) {
printk(KERN_ERR "cpufreq: Can't find CPU frequency !\n");
rc = -ENODEV;
Expand Down
30 changes: 15 additions & 15 deletions trunk/arch/powerpc/platforms/powermac/feature.c
Original file line number Diff line number Diff line change
Expand Up @@ -1058,8 +1058,8 @@ core99_reset_cpu(struct device_node *node, long param, long value)
if (np == NULL)
return -ENODEV;
for (np = np->child; np != NULL; np = np->sibling) {
u32 *num = (u32 *)get_property(np, "reg", NULL);
u32 *rst = (u32 *)get_property(np, "soft-reset", NULL);
u32 *num = get_property(np, "reg", NULL);
u32 *rst = get_property(np, "soft-reset", NULL);
if (num == NULL || rst == NULL)
continue;
if (param == *num) {
Expand Down Expand Up @@ -1087,7 +1087,7 @@ core99_usb_enable(struct device_node *node, long param, long value)
{
struct macio_chip *macio;
unsigned long flags;
char *prop;
const char *prop;
int number;
u32 reg;

Expand All @@ -1096,7 +1096,7 @@ core99_usb_enable(struct device_node *node, long param, long value)
macio->type != macio_intrepid)
return -ENODEV;

prop = (char *)get_property(node, "AAPL,clock-id", NULL);
prop = get_property(node, "AAPL,clock-id", NULL);
if (!prop)
return -ENODEV;
if (strncmp(prop, "usb0u048", 8) == 0)
Expand Down Expand Up @@ -1507,8 +1507,8 @@ static long g5_reset_cpu(struct device_node *node, long param, long value)
if (np == NULL)
return -ENODEV;
for (np = np->child; np != NULL; np = np->sibling) {
u32 *num = (u32 *)get_property(np, "reg", NULL);
u32 *rst = (u32 *)get_property(np, "soft-reset", NULL);
const u32 *num = get_property(np, "reg", NULL);
const u32 *rst = get_property(np, "soft-reset", NULL);
if (num == NULL || rst == NULL)
continue;
if (param == *num) {
Expand Down Expand Up @@ -2408,7 +2408,7 @@ static int __init probe_motherboard(void)
*/
dt = find_devices("device-tree");
if (dt != NULL)
model = (const char *) get_property(dt, "model", NULL);
model = get_property(dt, "model", NULL);
for(i=0; model && i<(sizeof(pmac_mb_defs)/sizeof(struct pmac_mb_def)); i++) {
if (strcmp(model, pmac_mb_defs[i].model_string) == 0) {
pmac_mb = pmac_mb_defs[i];
Expand Down Expand Up @@ -2536,7 +2536,7 @@ static int __init probe_motherboard(void)
*/
static void __init probe_uninorth(void)
{
u32 *addrp;
const u32 *addrp;
phys_addr_t address;
unsigned long actrl;

Expand All @@ -2555,7 +2555,7 @@ static void __init probe_uninorth(void)
if (uninorth_node == NULL)
return;

addrp = (u32 *)get_property(uninorth_node, "reg", NULL);
addrp = get_property(uninorth_node, "reg", NULL);
if (addrp == NULL)
return;
address = of_translate_address(uninorth_node, addrp);
Expand Down Expand Up @@ -2596,7 +2596,7 @@ static void __init probe_one_macio(const char *name, const char *compat, int typ
struct device_node* node;
int i;
volatile u32 __iomem *base;
u32 *addrp, *revp;
const u32 *addrp, *revp;
phys_addr_t addr;
u64 size;

Expand Down Expand Up @@ -2639,7 +2639,7 @@ static void __init probe_one_macio(const char *name, const char *compat, int typ
return;
}
if (type == macio_keylargo || type == macio_keylargo2) {
u32 *did = (u32 *)get_property(node, "device-id", NULL);
const u32 *did = get_property(node, "device-id", NULL);
if (*did == 0x00000025)
type = macio_pangea;
if (*did == 0x0000003e)
Expand All @@ -2652,7 +2652,7 @@ static void __init probe_one_macio(const char *name, const char *compat, int typ
macio_chips[i].base = base;
macio_chips[i].flags = MACIO_FLAG_SCCB_ON | MACIO_FLAG_SCCB_ON;
macio_chips[i].name = macio_names[type];
revp = (u32 *)get_property(node, "revision-id", NULL);
revp = get_property(node, "revision-id", NULL);
if (revp)
macio_chips[i].rev = *revp;
printk(KERN_INFO "Found a %s mac-io controller, rev: %d, mapped at 0x%p\n",
Expand Down Expand Up @@ -2695,15 +2695,15 @@ static void __init
initial_serial_shutdown(struct device_node *np)
{
int len;
struct slot_names_prop {
const struct slot_names_prop {
int count;
char name[1];
} *slots;
char *conn;
const char *conn;
int port_type = PMAC_SCC_ASYNC;
int modem = 0;

slots = (struct slot_names_prop *)get_property(np, "slot-names", &len);
slots = get_property(np, "slot-names", &len);
conn = get_property(np, "AAPL,connector", &len);
if (conn && (strcmp(conn, "infrared") == 0))
port_type = PMAC_SCC_IRDA;
Expand Down
Loading

0 comments on commit b0de6c1

Please sign in to comment.