Commit c4f55b39 authored by Stephen Rothwell's avatar Stephen Rothwell Committed by Paul Mackerras

[POWERPC] Rename get_property to of_get_property: sound

Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Acked-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent e2eb6392
...@@ -1064,7 +1064,7 @@ static int onyx_i2c_attach(struct i2c_adapter *adapter) ...@@ -1064,7 +1064,7 @@ static int onyx_i2c_attach(struct i2c_adapter *adapter)
if (device_is_compatible(dev, "pcm3052")) { if (device_is_compatible(dev, "pcm3052")) {
const u32 *addr; const u32 *addr;
printk(KERN_DEBUG PFX "found pcm3052\n"); printk(KERN_DEBUG PFX "found pcm3052\n");
addr = get_property(dev, "reg", NULL); addr = of_get_property(dev, "reg", NULL);
if (!addr) if (!addr)
return -ENODEV; return -ENODEV;
return onyx_create(adapter, dev, (*addr)>>1); return onyx_create(adapter, dev, (*addr)>>1);
......
...@@ -941,7 +941,7 @@ static int tas_i2c_attach(struct i2c_adapter *adapter) ...@@ -941,7 +941,7 @@ static int tas_i2c_attach(struct i2c_adapter *adapter)
if (device_is_compatible(dev, "tas3004")) { if (device_is_compatible(dev, "tas3004")) {
const u32 *addr; const u32 *addr;
printk(KERN_DEBUG PFX "found tas3004\n"); printk(KERN_DEBUG PFX "found tas3004\n");
addr = get_property(dev, "reg", NULL); addr = of_get_property(dev, "reg", NULL);
if (!addr) if (!addr)
continue; continue;
return tas_create(adapter, dev, ((*addr) >> 1) & 0x7f); return tas_create(adapter, dev, ((*addr) >> 1) & 0x7f);
...@@ -953,7 +953,7 @@ static int tas_i2c_attach(struct i2c_adapter *adapter) ...@@ -953,7 +953,7 @@ static int tas_i2c_attach(struct i2c_adapter *adapter)
const u32 *_addr; const u32 *_addr;
u32 addr; u32 addr;
printk(KERN_DEBUG PFX "found 'deq' node\n"); printk(KERN_DEBUG PFX "found 'deq' node\n");
_addr = (u32 *) get_property(dev, "i2c-address", NULL); _addr = of_get_property(dev, "i2c-address", NULL);
if (!_addr) if (!_addr)
continue; continue;
addr = ((*_addr) >> 1) & 0x7f; addr = ((*_addr) >> 1) & 0x7f;
......
...@@ -71,7 +71,7 @@ static struct device_node *get_gpio(char *name, ...@@ -71,7 +71,7 @@ static struct device_node *get_gpio(char *name,
if (!gpio) if (!gpio)
return NULL; return NULL;
while ((np = of_get_next_child(gpio, np))) { while ((np = of_get_next_child(gpio, np))) {
audio_gpio = get_property(np, "audio-gpio", NULL); audio_gpio = of_get_property(np, "audio-gpio", NULL);
if (!audio_gpio) if (!audio_gpio)
continue; continue;
if (strcmp(audio_gpio, name) == 0) if (strcmp(audio_gpio, name) == 0)
...@@ -84,7 +84,7 @@ static struct device_node *get_gpio(char *name, ...@@ -84,7 +84,7 @@ static struct device_node *get_gpio(char *name,
return NULL; return NULL;
} }
reg = get_property(np, "reg", NULL); reg = of_get_property(np, "reg", NULL);
if (!reg) if (!reg)
return NULL; return NULL;
...@@ -96,7 +96,7 @@ static struct device_node *get_gpio(char *name, ...@@ -96,7 +96,7 @@ static struct device_node *get_gpio(char *name,
if (*gpioptr < 0x50) if (*gpioptr < 0x50)
*gpioptr += 0x50; *gpioptr += 0x50;
reg = get_property(np, "audio-gpio-active-state", NULL); reg = of_get_property(np, "audio-gpio-active-state", NULL);
if (!reg) if (!reg)
/* Apple seems to default to 1, but /* Apple seems to default to 1, but
* that doesn't seem right at least on most * that doesn't seem right at least on most
......
...@@ -732,7 +732,7 @@ static int check_codec(struct aoa_codec *codec, ...@@ -732,7 +732,7 @@ static int check_codec(struct aoa_codec *codec,
if (codec->node && (strcmp(codec->node->name, "codec") == 0)) { if (codec->node && (strcmp(codec->node->name, "codec") == 0)) {
snprintf(propname, sizeof(propname), snprintf(propname, sizeof(propname),
"platform-%s-codec-ref", codec->name); "platform-%s-codec-ref", codec->name);
ref = get_property(ldev->sound, propname, NULL); ref = of_get_property(ldev->sound, propname, NULL);
if (!ref) { if (!ref) {
printk(KERN_INFO "snd-aoa-fabric-layout: " printk(KERN_INFO "snd-aoa-fabric-layout: "
"required property %s not present\n", propname); "required property %s not present\n", propname);
...@@ -946,7 +946,7 @@ static struct aoa_fabric layout_fabric = { ...@@ -946,7 +946,7 @@ static struct aoa_fabric layout_fabric = {
static int aoa_fabric_layout_probe(struct soundbus_dev *sdev) static int aoa_fabric_layout_probe(struct soundbus_dev *sdev)
{ {
struct device_node *sound = NULL; struct device_node *sound = NULL;
unsigned int *layout_id; const unsigned int *layout_id;
struct layout *layout; struct layout *layout;
struct layout_dev *ldev = NULL; struct layout_dev *ldev = NULL;
int err; int err;
...@@ -962,7 +962,7 @@ static int aoa_fabric_layout_probe(struct soundbus_dev *sdev) ...@@ -962,7 +962,7 @@ static int aoa_fabric_layout_probe(struct soundbus_dev *sdev)
} }
if (!sound) return -ENODEV; if (!sound) return -ENODEV;
layout_id = (unsigned int *) get_property(sound, "layout-id", NULL); layout_id = of_get_property(sound, "layout-id", NULL);
if (!layout_id) if (!layout_id)
goto outnodev; goto outnodev;
printk(KERN_INFO "snd-aoa-fabric-layout: found bus with layout %d\n", printk(KERN_INFO "snd-aoa-fabric-layout: found bus with layout %d\n",
......
...@@ -96,7 +96,7 @@ static int soundbus_uevent(struct device *dev, char **envp, int num_envp, ...@@ -96,7 +96,7 @@ static int soundbus_uevent(struct device *dev, char **envp, int num_envp,
* it's not really legal to split it out with commas. We split it * it's not really legal to split it out with commas. We split it
* up using a number of environment variables instead. */ * up using a number of environment variables instead. */
compat = get_property(of->node, "compatible", &cplen); compat = of_get_property(of->node, "compatible", &cplen);
while (compat && cplen > 0) { while (compat && cplen > 0) {
envp[i++] = scratch; envp[i++] = scratch;
length = scnprintf (scratch, buffer_size, length = scnprintf (scratch, buffer_size,
......
...@@ -141,7 +141,7 @@ static int i2sbus_get_and_fixup_rsrc(struct device_node *np, int index, ...@@ -141,7 +141,7 @@ static int i2sbus_get_and_fixup_rsrc(struct device_node *np, int index,
rc = of_address_to_resource(parent, pindex, res); rc = of_address_to_resource(parent, pindex, res);
if (rc) if (rc)
goto bail; goto bail;
reg = get_property(np, "reg", NULL); reg = of_get_property(np, "reg", NULL);
if (reg == NULL) { if (reg == NULL) {
rc = -ENXIO; rc = -ENXIO;
goto bail; goto bail;
...@@ -188,7 +188,8 @@ static int i2sbus_add_dev(struct macio_dev *macio, ...@@ -188,7 +188,8 @@ static int i2sbus_add_dev(struct macio_dev *macio,
} }
} }
if (i == 1) { if (i == 1) {
const u32 *layout_id = get_property(sound, "layout-id", NULL); const u32 *layout_id =
of_get_property(sound, "layout-id", NULL);
if (layout_id) { if (layout_id) {
layout = *layout_id; layout = *layout_id;
snprintf(dev->sound.modalias, 32, snprintf(dev->sound.modalias, 32,
......
...@@ -357,7 +357,7 @@ setup_audio_gpio(const char *name, const char* compatible, int *gpio_addr, int* ...@@ -357,7 +357,7 @@ setup_audio_gpio(const char *name, const char* compatible, int *gpio_addr, int*
while(np != 0) { while(np != 0) {
if (name) { if (name) {
const char *property = const char *property =
get_property(np,"audio-gpio",NULL); of_get_property(np,"audio-gpio",NULL);
if (property != 0 && strcmp(property,name) == 0) if (property != 0 && strcmp(property,name) == 0)
break; break;
} else if (compatible && device_is_compatible(np, compatible)) } else if (compatible && device_is_compatible(np, compatible))
...@@ -366,11 +366,11 @@ setup_audio_gpio(const char *name, const char* compatible, int *gpio_addr, int* ...@@ -366,11 +366,11 @@ setup_audio_gpio(const char *name, const char* compatible, int *gpio_addr, int*
} }
if (!np) if (!np)
return -ENODEV; return -ENODEV;
pp = get_property(np, "AAPL,address", NULL); pp = of_get_property(np, "AAPL,address", NULL);
if (!pp) if (!pp)
return -ENODEV; return -ENODEV;
*gpio_addr = (*pp) & 0x0000ffff; *gpio_addr = (*pp) & 0x0000ffff;
pp = get_property(np, "audio-gpio-active-state", NULL); pp = of_get_property(np, "audio-gpio-active-state", NULL);
if (pp) if (pp)
*gpio_pol = *pp; *gpio_pol = *pp;
else else
...@@ -2977,16 +2977,16 @@ printk("dmasound_pmac: Awacs/Screamer Codec Mfct: %d Rev %d\n", mfg, rev); ...@@ -2977,16 +2977,16 @@ printk("dmasound_pmac: Awacs/Screamer Codec Mfct: %d Rev %d\n", mfg, rev);
sound_device_id = 0; sound_device_id = 0;
/* device ID appears post g3 b&w */ /* device ID appears post g3 b&w */
prop = get_property(info, "device-id", NULL); prop = of_get_property(info, "device-id", NULL);
if (prop != 0) if (prop != 0)
sound_device_id = *prop; sound_device_id = *prop;
/* look for a property saying what sample rates /* look for a property saying what sample rates
are available */ are available */
prop = get_property(info, "sample-rates", &l); prop = of_get_property(info, "sample-rates", &l);
if (prop == 0) if (prop == 0)
prop = get_property(info, "output-frame-rates", &l); prop = of_get_property(info, "output-frame-rates", &l);
/* if it's there use it to set up frame rates */ /* if it's there use it to set up frame rates */
init_frame_rates(prop, l) ; init_frame_rates(prop, l) ;
......
...@@ -200,7 +200,7 @@ tas_init(int driver_id, const char *driver_name) ...@@ -200,7 +200,7 @@ tas_init(int driver_id, const char *driver_name)
tas_node = find_devices("deq"); tas_node = find_devices("deq");
if (tas_node == NULL) if (tas_node == NULL)
return -ENODEV; return -ENODEV;
paddr = get_property(tas_node, "i2c-address", NULL); paddr = of_get_property(tas_node, "i2c-address", NULL);
if (paddr) { if (paddr) {
tas_i2c_address = (*paddr) >> 1; tas_i2c_address = (*paddr) >> 1;
printk(KERN_INFO "using i2c address: 0x%x from device-tree\n", printk(KERN_INFO "using i2c address: 0x%x from device-tree\n",
......
...@@ -864,7 +864,8 @@ static void __init detect_byte_swap(struct snd_pmac *chip) ...@@ -864,7 +864,8 @@ static void __init detect_byte_swap(struct snd_pmac *chip)
static int __init snd_pmac_detect(struct snd_pmac *chip) static int __init snd_pmac_detect(struct snd_pmac *chip)
{ {
struct device_node *sound = NULL; struct device_node *sound = NULL;
unsigned int *prop, l; const unsigned int *prop;
unsigned int l;
struct macio_chip* macio; struct macio_chip* macio;
if (!machine_is(powermac)) if (!machine_is(powermac))
...@@ -923,10 +924,10 @@ static int __init snd_pmac_detect(struct snd_pmac *chip) ...@@ -923,10 +924,10 @@ static int __init snd_pmac_detect(struct snd_pmac *chip)
} }
if (! sound) if (! sound)
return -ENODEV; return -ENODEV;
prop = (unsigned int *) get_property(sound, "sub-frame", NULL); prop = of_get_property(sound, "sub-frame", NULL);
if (prop && *prop < 16) if (prop && *prop < 16)
chip->subframe = *prop; chip->subframe = *prop;
prop = (unsigned int *) get_property(sound, "layout-id", NULL); prop = of_get_property(sound, "layout-id", NULL);
if (prop) { if (prop) {
/* partly deprecate snd-powermac, for those machines /* partly deprecate snd-powermac, for those machines
* that have a layout-id property for now */ * that have a layout-id property for now */
...@@ -967,7 +968,7 @@ static int __init snd_pmac_detect(struct snd_pmac *chip) ...@@ -967,7 +968,7 @@ static int __init snd_pmac_detect(struct snd_pmac *chip)
chip->freq_table = tumbler_freqs; chip->freq_table = tumbler_freqs;
chip->control_mask = MASK_IEPC | 0x11; /* disable IEE */ chip->control_mask = MASK_IEPC | 0x11; /* disable IEE */
} }
prop = (unsigned int *)get_property(sound, "device-id", NULL); prop = of_get_property(sound, "device-id", NULL);
if (prop) if (prop)
chip->device_id = *prop; chip->device_id = *prop;
chip->has_iic = (find_devices("perch") != NULL); chip->has_iic = (find_devices("perch") != NULL);
...@@ -997,10 +998,9 @@ static int __init snd_pmac_detect(struct snd_pmac *chip) ...@@ -997,10 +998,9 @@ static int __init snd_pmac_detect(struct snd_pmac *chip)
/* look for a property saying what sample rates /* look for a property saying what sample rates
are available */ are available */
prop = (unsigned int *) get_property(sound, "sample-rates", &l); prop = of_get_property(sound, "sample-rates", &l);
if (! prop) if (! prop)
prop = (unsigned int *) get_property(sound, prop = of_get_property(sound, "output-frame-rates", &l);
"output-frame-rates", &l);
if (prop) { if (prop) {
int i; int i;
chip->freqs_ok = 0; chip->freqs_ok = 0;
......
...@@ -1037,7 +1037,7 @@ static struct device_node *find_audio_device(const char *name) ...@@ -1037,7 +1037,7 @@ static struct device_node *find_audio_device(const char *name)
return NULL; return NULL;
for (np = np->child; np; np = np->sibling) { for (np = np->child; np; np = np->sibling) {
const char *property = get_property(np, "audio-gpio", NULL); const char *property = of_get_property(np, "audio-gpio", NULL);
if (property && strcmp(property, name) == 0) if (property && strcmp(property, name) == 0)
return np; return np;
} }
...@@ -1077,9 +1077,9 @@ static long tumbler_find_device(const char *device, const char *platform, ...@@ -1077,9 +1077,9 @@ static long tumbler_find_device(const char *device, const char *platform,
return -ENODEV; return -ENODEV;
} }
base = get_property(node, "AAPL,address", NULL); base = of_get_property(node, "AAPL,address", NULL);
if (! base) { if (! base) {
base = get_property(node, "reg", NULL); base = of_get_property(node, "reg", NULL);
if (!base) { if (!base) {
DBG("(E) cannot find address for device %s !\n", device); DBG("(E) cannot find address for device %s !\n", device);
snd_printd("cannot find address for device %s\n", device); snd_printd("cannot find address for device %s\n", device);
...@@ -1093,7 +1093,7 @@ static long tumbler_find_device(const char *device, const char *platform, ...@@ -1093,7 +1093,7 @@ static long tumbler_find_device(const char *device, const char *platform,
gp->addr = addr & 0x0000ffff; gp->addr = addr & 0x0000ffff;
/* Try to find the active state, default to 0 ! */ /* Try to find the active state, default to 0 ! */
base = get_property(node, "audio-gpio-active-state", NULL); base = of_get_property(node, "audio-gpio-active-state", NULL);
if (base) { if (base) {
gp->active_state = *base; gp->active_state = *base;
gp->active_val = (*base) ? 0x5 : 0x4; gp->active_val = (*base) ? 0x5 : 0x4;
...@@ -1108,7 +1108,7 @@ static long tumbler_find_device(const char *device, const char *platform, ...@@ -1108,7 +1108,7 @@ static long tumbler_find_device(const char *device, const char *platform,
* as we don't yet have an interpreter for these things * as we don't yet have an interpreter for these things
*/ */
if (platform) if (platform)
prop = get_property(node, platform, NULL); prop = of_get_property(node, platform, NULL);
if (prop) { if (prop) {
if (prop[3] == 0x9 && prop[4] == 0x9) { if (prop[3] == 0x9 && prop[4] == 0x9) {
gp->active_val = 0xd; gp->active_val = 0xd;
...@@ -1310,7 +1310,7 @@ int __init snd_pmac_tumbler_init(struct snd_pmac *chip) ...@@ -1310,7 +1310,7 @@ int __init snd_pmac_tumbler_init(struct snd_pmac *chip)
{ {
int i, err; int i, err;
struct pmac_tumbler *mix; struct pmac_tumbler *mix;
u32 *paddr; const u32 *paddr;
struct device_node *tas_node, *np; struct device_node *tas_node, *np;
char *chipname; char *chipname;
...@@ -1331,9 +1331,9 @@ int __init snd_pmac_tumbler_init(struct snd_pmac *chip) ...@@ -1331,9 +1331,9 @@ int __init snd_pmac_tumbler_init(struct snd_pmac *chip)
for (np = chip->node->child; np; np = np->sibling) { for (np = chip->node->child; np; np = np->sibling) {
if (!strcmp(np->name, "sound")) { if (!strcmp(np->name, "sound")) {
if (get_property(np, "has-anded-reset", NULL)) if (of_get_property(np, "has-anded-reset", NULL))
mix->anded_reset = 1; mix->anded_reset = 1;
if (get_property(np, "layout-id", NULL)) if (of_get_property(np, "layout-id", NULL))
mix->reset_on_sleep = 0; mix->reset_on_sleep = 0;
break; break;
} }
...@@ -1348,9 +1348,9 @@ int __init snd_pmac_tumbler_init(struct snd_pmac *chip) ...@@ -1348,9 +1348,9 @@ int __init snd_pmac_tumbler_init(struct snd_pmac *chip)
if (tas_node == NULL) if (tas_node == NULL)
return -ENODEV; return -ENODEV;
paddr = (u32 *)get_property(tas_node, "i2c-address", NULL); paddr = of_get_property(tas_node, "i2c-address", NULL);
if (paddr == NULL) if (paddr == NULL)
paddr = (u32 *)get_property(tas_node, "reg", NULL); paddr = of_get_property(tas_node, "reg", NULL);
if (paddr) if (paddr)
mix->i2c.addr = (*paddr) >> 1; mix->i2c.addr = (*paddr) >> 1;
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment