diff options
Diffstat (limited to 'sound/ppc')
| -rw-r--r-- | sound/ppc/awacs.c | 54 | ||||
| -rw-r--r-- | sound/ppc/beep.c | 2 | ||||
| -rw-r--r-- | sound/ppc/burgundy.c | 22 | ||||
| -rw-r--r-- | sound/ppc/daca.c | 2 | ||||
| -rw-r--r-- | sound/ppc/keywest.c | 9 | ||||
| -rw-r--r-- | sound/ppc/pmac.c | 41 | ||||
| -rw-r--r-- | sound/ppc/powermac.c | 38 | ||||
| -rw-r--r-- | sound/ppc/snd_ps3.c | 32 | ||||
| -rw-r--r-- | sound/ppc/snd_ps3_reg.h | 14 | ||||
| -rw-r--r-- | sound/ppc/tumbler.c | 19 | 
10 files changed, 118 insertions, 115 deletions
diff --git a/sound/ppc/awacs.c b/sound/ppc/awacs.c index b36679384b2..5fbf5db2543 100644 --- a/sound/ppc/awacs.c +++ b/sound/ppc/awacs.c @@ -477,7 +477,7 @@ static int snd_pmac_awacs_put_master_amp(struct snd_kcontrol *kcontrol,  #define AMP_CH_SPK	0  #define AMP_CH_HD	1 -static struct snd_kcontrol_new snd_pmac_awacs_amp_vol[] __devinitdata = { +static struct snd_kcontrol_new snd_pmac_awacs_amp_vol[] = {  	{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,  	  .name = "Speaker Playback Volume",  	  .info = snd_pmac_awacs_info_volume_amp, @@ -514,7 +514,7 @@ static struct snd_kcontrol_new snd_pmac_awacs_amp_vol[] __devinitdata = {  	},  }; -static struct snd_kcontrol_new snd_pmac_awacs_amp_hp_sw __devinitdata = { +static struct snd_kcontrol_new snd_pmac_awacs_amp_hp_sw = {  	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,  	.name = "Headphone Playback Switch",  	.info = snd_pmac_boolean_stereo_info, @@ -523,7 +523,7 @@ static struct snd_kcontrol_new snd_pmac_awacs_amp_hp_sw __devinitdata = {  	.private_value = AMP_CH_HD,  }; -static struct snd_kcontrol_new snd_pmac_awacs_amp_spk_sw __devinitdata = { +static struct snd_kcontrol_new snd_pmac_awacs_amp_spk_sw = {  	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,  	.name = "Speaker Playback Switch",  	.info = snd_pmac_boolean_stereo_info, @@ -595,46 +595,46 @@ static int snd_pmac_screamer_mic_boost_put(struct snd_kcontrol *kcontrol,  /*   * lists of mixer elements   */ -static struct snd_kcontrol_new snd_pmac_awacs_mixers[] __devinitdata = { +static struct snd_kcontrol_new snd_pmac_awacs_mixers[] = {  	AWACS_SWITCH("Master Capture Switch", 1, SHIFT_LOOPTHRU, 0),  	AWACS_VOLUME("Master Capture Volume", 0, 4, 0),  /*	AWACS_SWITCH("Unknown Playback Switch", 6, SHIFT_PAROUT0, 0), */  }; -static struct snd_kcontrol_new snd_pmac_screamer_mixers_beige[] __devinitdata = { +static struct snd_kcontrol_new snd_pmac_screamer_mixers_beige[] = {  	AWACS_VOLUME("Master Playback Volume", 2, 6, 1),  	AWACS_VOLUME("Play-through Playback Volume", 5, 6, 1),  	AWACS_SWITCH("Line Capture Switch", 0, SHIFT_MUX_MIC, 0),  	AWACS_SWITCH("CD Capture Switch", 0, SHIFT_MUX_LINE, 0),  }; -static struct snd_kcontrol_new snd_pmac_screamer_mixers_lo[] __devinitdata = { +static struct snd_kcontrol_new snd_pmac_screamer_mixers_lo[] = {  	AWACS_VOLUME("Line out Playback Volume", 2, 6, 1),  }; -static struct snd_kcontrol_new snd_pmac_screamer_mixers_imac[] __devinitdata = { +static struct snd_kcontrol_new snd_pmac_screamer_mixers_imac[] = {  	AWACS_VOLUME("Play-through Playback Volume", 5, 6, 1),  	AWACS_SWITCH("CD Capture Switch", 0, SHIFT_MUX_CD, 0),  }; -static struct snd_kcontrol_new snd_pmac_screamer_mixers_g4agp[] __devinitdata = { +static struct snd_kcontrol_new snd_pmac_screamer_mixers_g4agp[] = {  	AWACS_VOLUME("Line out Playback Volume", 2, 6, 1),  	AWACS_VOLUME("Master Playback Volume", 5, 6, 1),  	AWACS_SWITCH("CD Capture Switch", 0, SHIFT_MUX_CD, 0),  	AWACS_SWITCH("Line Capture Switch", 0, SHIFT_MUX_MIC, 0),  }; -static struct snd_kcontrol_new snd_pmac_awacs_mixers_pmac7500[] __devinitdata = { +static struct snd_kcontrol_new snd_pmac_awacs_mixers_pmac7500[] = {  	AWACS_VOLUME("Line out Playback Volume", 2, 6, 1),  	AWACS_SWITCH("CD Capture Switch", 0, SHIFT_MUX_CD, 0),  	AWACS_SWITCH("Line Capture Switch", 0, SHIFT_MUX_MIC, 0),  }; -static struct snd_kcontrol_new snd_pmac_awacs_mixers_pmac5500[] __devinitdata = { +static struct snd_kcontrol_new snd_pmac_awacs_mixers_pmac5500[] = {  	AWACS_VOLUME("Headphone Playback Volume", 2, 6, 1),  }; -static struct snd_kcontrol_new snd_pmac_awacs_mixers_pmac[] __devinitdata = { +static struct snd_kcontrol_new snd_pmac_awacs_mixers_pmac[] = {  	AWACS_VOLUME("Master Playback Volume", 2, 6, 1),  	AWACS_SWITCH("CD Capture Switch", 0, SHIFT_MUX_CD, 0),  }; @@ -642,34 +642,34 @@ static struct snd_kcontrol_new snd_pmac_awacs_mixers_pmac[] __devinitdata = {  /* FIXME: is this correct order?   * screamer (powerbook G3 pismo) seems to have different bits...   */ -static struct snd_kcontrol_new snd_pmac_awacs_mixers2[] __devinitdata = { +static struct snd_kcontrol_new snd_pmac_awacs_mixers2[] = {  	AWACS_SWITCH("Line Capture Switch", 0, SHIFT_MUX_LINE, 0),  	AWACS_SWITCH("Mic Capture Switch", 0, SHIFT_MUX_MIC, 0),  }; -static struct snd_kcontrol_new snd_pmac_screamer_mixers2[] __devinitdata = { +static struct snd_kcontrol_new snd_pmac_screamer_mixers2[] = {  	AWACS_SWITCH("Line Capture Switch", 0, SHIFT_MUX_MIC, 0),  	AWACS_SWITCH("Mic Capture Switch", 0, SHIFT_MUX_LINE, 0),  }; -static struct snd_kcontrol_new snd_pmac_awacs_mixers2_pmac5500[] __devinitdata = { +static struct snd_kcontrol_new snd_pmac_awacs_mixers2_pmac5500[] = {  	AWACS_SWITCH("CD Capture Switch", 0, SHIFT_MUX_CD, 0),  }; -static struct snd_kcontrol_new snd_pmac_awacs_master_sw __devinitdata = +static struct snd_kcontrol_new snd_pmac_awacs_master_sw =  AWACS_SWITCH("Master Playback Switch", 1, SHIFT_HDMUTE, 1); -static struct snd_kcontrol_new snd_pmac_awacs_master_sw_imac __devinitdata = +static struct snd_kcontrol_new snd_pmac_awacs_master_sw_imac =  AWACS_SWITCH("Line out Playback Switch", 1, SHIFT_HDMUTE, 1); -static struct snd_kcontrol_new snd_pmac_awacs_master_sw_pmac5500 __devinitdata = +static struct snd_kcontrol_new snd_pmac_awacs_master_sw_pmac5500 =  AWACS_SWITCH("Headphone Playback Switch", 1, SHIFT_HDMUTE, 1); -static struct snd_kcontrol_new snd_pmac_awacs_mic_boost[] __devinitdata = { +static struct snd_kcontrol_new snd_pmac_awacs_mic_boost[] = {  	AWACS_SWITCH("Mic Boost Capture Switch", 0, SHIFT_GAINLINE, 0),  }; -static struct snd_kcontrol_new snd_pmac_screamer_mic_boost[] __devinitdata = { +static struct snd_kcontrol_new snd_pmac_screamer_mic_boost[] = {  	{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,  	  .name = "Mic Boost Capture Volume",  	  .info = snd_pmac_screamer_mic_boost_info, @@ -678,34 +678,34 @@ static struct snd_kcontrol_new snd_pmac_screamer_mic_boost[] __devinitdata = {  	},  }; -static struct snd_kcontrol_new snd_pmac_awacs_mic_boost_pmac7500[] __devinitdata = +static struct snd_kcontrol_new snd_pmac_awacs_mic_boost_pmac7500[] =  {  	AWACS_SWITCH("Line Boost Capture Switch", 0, SHIFT_GAINLINE, 0),  }; -static struct snd_kcontrol_new snd_pmac_screamer_mic_boost_beige[] __devinitdata = +static struct snd_kcontrol_new snd_pmac_screamer_mic_boost_beige[] =  {  	AWACS_SWITCH("Line Boost Capture Switch", 0, SHIFT_GAINLINE, 0),  	AWACS_SWITCH("CD Boost Capture Switch", 6, SHIFT_MIC_BOOST, 0),  }; -static struct snd_kcontrol_new snd_pmac_screamer_mic_boost_imac[] __devinitdata = +static struct snd_kcontrol_new snd_pmac_screamer_mic_boost_imac[] =  {  	AWACS_SWITCH("Line Boost Capture Switch", 0, SHIFT_GAINLINE, 0),  	AWACS_SWITCH("Mic Boost Capture Switch", 6, SHIFT_MIC_BOOST, 0),  }; -static struct snd_kcontrol_new snd_pmac_awacs_speaker_vol[] __devinitdata = { +static struct snd_kcontrol_new snd_pmac_awacs_speaker_vol[] = {  	AWACS_VOLUME("Speaker Playback Volume", 4, 6, 1),  }; -static struct snd_kcontrol_new snd_pmac_awacs_speaker_sw __devinitdata = +static struct snd_kcontrol_new snd_pmac_awacs_speaker_sw =  AWACS_SWITCH("Speaker Playback Switch", 1, SHIFT_SPKMUTE, 1); -static struct snd_kcontrol_new snd_pmac_awacs_speaker_sw_imac1 __devinitdata = +static struct snd_kcontrol_new snd_pmac_awacs_speaker_sw_imac1 =  AWACS_SWITCH("Speaker Playback Switch", 1, SHIFT_PAROUT1, 1); -static struct snd_kcontrol_new snd_pmac_awacs_speaker_sw_imac2 __devinitdata = +static struct snd_kcontrol_new snd_pmac_awacs_speaker_sw_imac2 =  AWACS_SWITCH("Speaker Playback Switch", 1, SHIFT_PAROUT1, 0); @@ -872,7 +872,7 @@ static void snd_pmac_awacs_update_automute(struct snd_pmac *chip, int do_notify)  /*   * initialize chip   */ -int __devinit +int  snd_pmac_awacs_init(struct snd_pmac *chip)  {  	int pm7500 = IS_PM7500; diff --git a/sound/ppc/beep.c b/sound/ppc/beep.c index a9d350789f5..0040f048221 100644 --- a/sound/ppc/beep.c +++ b/sound/ppc/beep.c @@ -215,7 +215,7 @@ static struct snd_kcontrol_new snd_pmac_beep_mixer = {  };  /* Initialize beep stuff */ -int __devinit snd_pmac_attach_beep(struct snd_pmac *chip) +int snd_pmac_attach_beep(struct snd_pmac *chip)  {  	struct pmac_beep *beep;  	struct input_dev *input_dev; diff --git a/sound/ppc/burgundy.c b/sound/ppc/burgundy.c index 00e2d5166d0..cb4f0a5e984 100644 --- a/sound/ppc/burgundy.c +++ b/sound/ppc/burgundy.c @@ -467,7 +467,7 @@ static int snd_pmac_burgundy_put_switch_b(struct snd_kcontrol *kcontrol,  /*   * Burgundy mixers   */ -static struct snd_kcontrol_new snd_pmac_burgundy_mixers[] __devinitdata = { +static struct snd_kcontrol_new snd_pmac_burgundy_mixers[] = {  	BURGUNDY_VOLUME_W("Master Playback Volume", 0,  			MASK_ADDR_BURGUNDY_MASTER_VOLUME, 8),  	BURGUNDY_VOLUME_W("CD Capture Volume", 0, @@ -495,7 +495,7 @@ static struct snd_kcontrol_new snd_pmac_burgundy_mixers[] __devinitdata = {   */	BURGUNDY_SWITCH_B("PCM Capture Switch", 0,  			MASK_ADDR_BURGUNDY_HOSTIFEH, 0x01, 0, 0)  }; -static struct snd_kcontrol_new snd_pmac_burgundy_mixers_imac[] __devinitdata = { +static struct snd_kcontrol_new snd_pmac_burgundy_mixers_imac[] = {  	BURGUNDY_VOLUME_W("Line in Capture Volume", 0,  			MASK_ADDR_BURGUNDY_VOLLINE, 16),  	BURGUNDY_VOLUME_W("Mic Capture Volume", 0, @@ -521,7 +521,7 @@ static struct snd_kcontrol_new snd_pmac_burgundy_mixers_imac[] __devinitdata = {  	BURGUNDY_SWITCH_B("Mic Boost Capture Switch", 0,  			MASK_ADDR_BURGUNDY_INPBOOST, 0x40, 0x80, 1)  }; -static struct snd_kcontrol_new snd_pmac_burgundy_mixers_pmac[] __devinitdata = { +static struct snd_kcontrol_new snd_pmac_burgundy_mixers_pmac[] = {  	BURGUNDY_VOLUME_W("Line in Capture Volume", 0,  			MASK_ADDR_BURGUNDY_VOLMIC, 16),  	BURGUNDY_VOLUME_B("Line in Gain Capture Volume", 0, @@ -537,33 +537,33 @@ static struct snd_kcontrol_new snd_pmac_burgundy_mixers_pmac[] __devinitdata = {  /*	BURGUNDY_SWITCH_B("Line in Boost Capture Switch", 0,   *		MASK_ADDR_BURGUNDY_INPBOOST, 0x40, 0x80, 1) */  }; -static struct snd_kcontrol_new snd_pmac_burgundy_master_sw_imac __devinitdata = +static struct snd_kcontrol_new snd_pmac_burgundy_master_sw_imac =  BURGUNDY_SWITCH_B("Master Playback Switch", 0,  	MASK_ADDR_BURGUNDY_MORE_OUTPUTENABLES,  	BURGUNDY_OUTPUT_LEFT | BURGUNDY_LINEOUT_LEFT | BURGUNDY_HP_LEFT,  	BURGUNDY_OUTPUT_RIGHT | BURGUNDY_LINEOUT_RIGHT | BURGUNDY_HP_RIGHT, 1); -static struct snd_kcontrol_new snd_pmac_burgundy_master_sw_pmac __devinitdata = +static struct snd_kcontrol_new snd_pmac_burgundy_master_sw_pmac =  BURGUNDY_SWITCH_B("Master Playback Switch", 0,  	MASK_ADDR_BURGUNDY_MORE_OUTPUTENABLES,  	BURGUNDY_OUTPUT_INTERN  	| BURGUNDY_OUTPUT_LEFT, BURGUNDY_OUTPUT_RIGHT, 1); -static struct snd_kcontrol_new snd_pmac_burgundy_speaker_sw_imac __devinitdata = +static struct snd_kcontrol_new snd_pmac_burgundy_speaker_sw_imac =  BURGUNDY_SWITCH_B("Speaker Playback Switch", 0,  	MASK_ADDR_BURGUNDY_MORE_OUTPUTENABLES,  	BURGUNDY_OUTPUT_LEFT, BURGUNDY_OUTPUT_RIGHT, 1); -static struct snd_kcontrol_new snd_pmac_burgundy_speaker_sw_pmac __devinitdata = +static struct snd_kcontrol_new snd_pmac_burgundy_speaker_sw_pmac =  BURGUNDY_SWITCH_B("Speaker Playback Switch", 0,  	MASK_ADDR_BURGUNDY_MORE_OUTPUTENABLES,  	BURGUNDY_OUTPUT_INTERN, 0, 0); -static struct snd_kcontrol_new snd_pmac_burgundy_line_sw_imac __devinitdata = +static struct snd_kcontrol_new snd_pmac_burgundy_line_sw_imac =  BURGUNDY_SWITCH_B("Line out Playback Switch", 0,  	MASK_ADDR_BURGUNDY_MORE_OUTPUTENABLES,  	BURGUNDY_LINEOUT_LEFT, BURGUNDY_LINEOUT_RIGHT, 1); -static struct snd_kcontrol_new snd_pmac_burgundy_line_sw_pmac __devinitdata = +static struct snd_kcontrol_new snd_pmac_burgundy_line_sw_pmac =  BURGUNDY_SWITCH_B("Line out Playback Switch", 0,  	MASK_ADDR_BURGUNDY_MORE_OUTPUTENABLES,  	BURGUNDY_OUTPUT_LEFT, BURGUNDY_OUTPUT_RIGHT, 1); -static struct snd_kcontrol_new snd_pmac_burgundy_hp_sw_imac __devinitdata = +static struct snd_kcontrol_new snd_pmac_burgundy_hp_sw_imac =  BURGUNDY_SWITCH_B("Headphone Playback Switch", 0,  	MASK_ADDR_BURGUNDY_MORE_OUTPUTENABLES,  	BURGUNDY_HP_LEFT, BURGUNDY_HP_RIGHT, 1); @@ -617,7 +617,7 @@ static void snd_pmac_burgundy_update_automute(struct snd_pmac *chip, int do_noti  /*   * initialize burgundy   */ -int __devinit snd_pmac_burgundy_init(struct snd_pmac *chip) +int snd_pmac_burgundy_init(struct snd_pmac *chip)  {  	int imac = of_machine_is_compatible("iMac");  	int i, err; diff --git a/sound/ppc/daca.c b/sound/ppc/daca.c index 24200b7bdac..b86526223e4 100644 --- a/sound/ppc/daca.c +++ b/sound/ppc/daca.c @@ -244,7 +244,7 @@ static void daca_cleanup(struct snd_pmac *chip)  }  /* exported */ -int __devinit snd_pmac_daca_init(struct snd_pmac *chip) +int snd_pmac_daca_init(struct snd_pmac *chip)  {  	int i, err;  	struct pmac_daca *mix; diff --git a/sound/ppc/keywest.c b/sound/ppc/keywest.c index 8f064c7ce74..0d1c27e911b 100644 --- a/sound/ppc/keywest.c +++ b/sound/ppc/keywest.c @@ -65,7 +65,7 @@ static int keywest_attach_adapter(struct i2c_adapter *adapter)  	 * already bound. If not it means binding failed, and then there  	 * is no point in keeping the device instantiated.  	 */ -	if (!keywest_ctx->client->driver) { +	if (!keywest_ctx->client->dev.driver) {  		i2c_unregister_device(keywest_ctx->client);  		keywest_ctx->client = NULL;  		return -ENODEV; @@ -76,13 +76,12 @@ static int keywest_attach_adapter(struct i2c_adapter *adapter)  	 * This is safe because i2c-core holds the core_lock mutex for us.  	 */  	list_add_tail(&keywest_ctx->client->detected, -		      &keywest_ctx->client->driver->clients); +		      &to_i2c_driver(keywest_ctx->client->dev.driver)->clients);  	return 0;  }  static int keywest_remove(struct i2c_client *client)  { -	i2c_set_clientdata(client, NULL);  	if (! keywest_ctx)  		return 0;  	if (client == keywest_ctx->client) @@ -116,7 +115,7 @@ void snd_pmac_keywest_cleanup(struct pmac_keywest *i2c)  	}  } -int __devinit snd_pmac_tumbler_post_init(void) +int snd_pmac_tumbler_post_init(void)  {  	int err; @@ -131,7 +130,7 @@ int __devinit snd_pmac_tumbler_post_init(void)  }  /* exported */ -int __devinit snd_pmac_keywest_init(struct pmac_keywest *i2c) +int snd_pmac_keywest_init(struct pmac_keywest *i2c)  {  	int err; diff --git a/sound/ppc/pmac.c b/sound/ppc/pmac.c index 85081172403..7a43c0c3831 100644 --- a/sound/ppc/pmac.c +++ b/sound/ppc/pmac.c @@ -28,6 +28,8 @@  #include <linux/interrupt.h>  #include <linux/pci.h>  #include <linux/dma-mapping.h> +#include <linux/of_address.h> +#include <linux/of_irq.h>  #include <sound/core.h>  #include "pmac.h"  #include <sound/pcm_params.h> @@ -702,7 +704,7 @@ static struct snd_pcm_ops snd_pmac_capture_ops = {  	.pointer =	snd_pmac_capture_pointer,  }; -int __devinit snd_pmac_pcm_new(struct snd_pmac *chip) +int snd_pmac_pcm_new(struct snd_pmac *chip)  {  	struct snd_pcm *pcm;  	int err; @@ -881,8 +883,7 @@ static int snd_pmac_free(struct snd_pmac *chip)  		for (i = 0; i < 3; i++) {  			if (chip->requested & (1 << i))  				release_mem_region(chip->rsrc[i].start, -						   chip->rsrc[i].end - -						   chip->rsrc[i].start + 1); +						   resource_size(&chip->rsrc[i]));  		}  	} @@ -908,7 +909,7 @@ static int snd_pmac_dev_free(struct snd_device *device)   * check the machine support byteswap (little-endian)   */ -static void __devinit detect_byte_swap(struct snd_pmac *chip) +static void detect_byte_swap(struct snd_pmac *chip)  {  	struct device_node *mio; @@ -934,7 +935,7 @@ static void __devinit detect_byte_swap(struct snd_pmac *chip)  /*   * detect a sound chip   */ -static int __devinit snd_pmac_detect(struct snd_pmac *chip) +static int snd_pmac_detect(struct snd_pmac *chip)  {  	struct device_node *sound;  	struct device_node *dn; @@ -1034,7 +1035,11 @@ static int __devinit snd_pmac_detect(struct snd_pmac *chip)  	if (of_device_is_compatible(sound, "tumbler")) {  		chip->model = PMAC_TUMBLER;  		chip->can_capture = of_machine_is_compatible("PowerMac4,2") -				|| of_machine_is_compatible("PowerBook4,1"); +				|| of_machine_is_compatible("PowerBook3,2") +				|| of_machine_is_compatible("PowerBook3,3") +				|| of_machine_is_compatible("PowerBook4,1") +				|| of_machine_is_compatible("PowerBook4,2") +				|| of_machine_is_compatible("PowerBook4,3");  		chip->can_duplex = 0;  		// chip->can_byte_swap = 0; /* FIXME: check this */  		chip->num_freqs = ARRAY_SIZE(tumbler_freqs); @@ -1143,7 +1148,7 @@ static int pmac_hp_detect_get(struct snd_kcontrol *kcontrol,  	return 0;  } -static struct snd_kcontrol_new auto_mute_controls[] __devinitdata = { +static struct snd_kcontrol_new auto_mute_controls[] = {  	{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,  	  .name = "Auto Mute Switch",  	  .info = snd_pmac_boolean_mono_info, @@ -1158,7 +1163,7 @@ static struct snd_kcontrol_new auto_mute_controls[] __devinitdata = {  	},  }; -int __devinit snd_pmac_add_automute(struct snd_pmac *chip) +int snd_pmac_add_automute(struct snd_pmac *chip)  {  	int err;  	chip->auto_mute = 1; @@ -1175,7 +1180,7 @@ int __devinit snd_pmac_add_automute(struct snd_pmac *chip)  /*   * create and detect a pmac chip record   */ -int __devinit snd_pmac_new(struct snd_card *card, struct snd_pmac **chip_return) +int snd_pmac_new(struct snd_card *card, struct snd_pmac **chip_return)  {  	struct snd_pmac *chip;  	struct device_node *np; @@ -1224,14 +1229,11 @@ int __devinit snd_pmac_new(struct snd_card *card, struct snd_pmac **chip_return)  				goto __error;  			}  			if (request_mem_region(chip->rsrc[i].start, -					       chip->rsrc[i].end - -					       chip->rsrc[i].start + 1, +					       resource_size(&chip->rsrc[i]),  					       rnames[i]) == NULL) {  				printk(KERN_ERR "snd: can't request rsrc " -				       " %d (%s: 0x%016llx:%016llx)\n", -				       i, rnames[i], -				       (unsigned long long)chip->rsrc[i].start, -				       (unsigned long long)chip->rsrc[i].end); +				       " %d (%s: %pR)\n", +				       i, rnames[i], &chip->rsrc[i]);  				err = -ENODEV;  				goto __error;  			} @@ -1252,14 +1254,11 @@ int __devinit snd_pmac_new(struct snd_card *card, struct snd_pmac **chip_return)  				goto __error;  			}  			if (request_mem_region(chip->rsrc[i].start, -					       chip->rsrc[i].end - -					       chip->rsrc[i].start + 1, +					       resource_size(&chip->rsrc[i]),  					       rnames[i]) == NULL) {  				printk(KERN_ERR "snd: can't request rsrc " -				       " %d (%s: 0x%016llx:%016llx)\n", -				       i, rnames[i], -				       (unsigned long long)chip->rsrc[i].start, -				       (unsigned long long)chip->rsrc[i].end); +				       " %d (%s: %pR)\n", +				       i, rnames[i], &chip->rsrc[i]);  				err = -ENODEV;  				goto __error;  			} diff --git a/sound/ppc/powermac.c b/sound/ppc/powermac.c index a2b69b8cff4..350a7c8f86d 100644 --- a/sound/ppc/powermac.c +++ b/sound/ppc/powermac.c @@ -21,7 +21,7 @@  #include <linux/init.h>  #include <linux/err.h>  #include <linux/platform_device.h> -#include <linux/moduleparam.h> +#include <linux/module.h>  #include <sound/core.h>  #include <sound/initval.h>  #include "pmac.h" @@ -36,7 +36,7 @@ MODULE_LICENSE("GPL");  static int index = SNDRV_DEFAULT_IDX1;		/* Index 0-MAX */  static char *id = SNDRV_DEFAULT_STR1;		/* ID for this card */ -static int enable_beep = 1; +static bool enable_beep = 1;  module_param(index, int, 0444);  MODULE_PARM_DESC(index, "Index value for " CHIP_NAME " soundchip."); @@ -51,14 +51,14 @@ static struct platform_device *device;  /*   */ -static int __devinit snd_pmac_probe(struct platform_device *devptr) +static int snd_pmac_probe(struct platform_device *devptr)  {  	struct snd_card *card;  	struct snd_pmac *chip;  	char *name_ext;  	int err; -	err = snd_card_create(index, id, THIS_MODULE, 0, &card); +	err = snd_card_new(&devptr->dev, index, id, THIS_MODULE, 0, &card);  	if (err < 0)  		return err; @@ -122,8 +122,6 @@ static int __devinit snd_pmac_probe(struct platform_device *devptr)  	if (enable_beep)  		snd_pmac_attach_beep(chip); -	snd_card_set_dev(card, &devptr->dev); -  	if ((err = snd_card_register(card)) < 0)  		goto __error; @@ -136,40 +134,42 @@ __error:  } -static int __devexit snd_pmac_remove(struct platform_device *devptr) +static int snd_pmac_remove(struct platform_device *devptr)  {  	snd_card_free(platform_get_drvdata(devptr)); -	platform_set_drvdata(devptr, NULL);  	return 0;  } -#ifdef CONFIG_PM -static int snd_pmac_driver_suspend(struct platform_device *devptr, pm_message_t state) +#ifdef CONFIG_PM_SLEEP +static int snd_pmac_driver_suspend(struct device *dev)  { -	struct snd_card *card = platform_get_drvdata(devptr); +	struct snd_card *card = dev_get_drvdata(dev);  	snd_pmac_suspend(card->private_data);  	return 0;  } -static int snd_pmac_driver_resume(struct platform_device *devptr) +static int snd_pmac_driver_resume(struct device *dev)  { -	struct snd_card *card = platform_get_drvdata(devptr); +	struct snd_card *card = dev_get_drvdata(dev);  	snd_pmac_resume(card->private_data);  	return 0;  } + +static SIMPLE_DEV_PM_OPS(snd_pmac_pm, snd_pmac_driver_suspend, snd_pmac_driver_resume); +#define SND_PMAC_PM_OPS	&snd_pmac_pm +#else +#define SND_PMAC_PM_OPS	NULL  #endif  #define SND_PMAC_DRIVER		"snd_powermac"  static struct platform_driver snd_pmac_driver = {  	.probe		= snd_pmac_probe, -	.remove		= __devexit_p(snd_pmac_remove), -#ifdef CONFIG_PM -	.suspend	= snd_pmac_driver_suspend, -	.resume		= snd_pmac_driver_resume, -#endif +	.remove		= snd_pmac_remove,  	.driver		= { -		.name	= SND_PMAC_DRIVER +		.name	= SND_PMAC_DRIVER, +		.owner	= THIS_MODULE, +		.pm	= SND_PMAC_PM_OPS,  	},  }; diff --git a/sound/ppc/snd_ps3.c b/sound/ppc/snd_ps3.c index 581a670e826..58f292a87f9 100644 --- a/sound/ppc/snd_ps3.c +++ b/sound/ppc/snd_ps3.c @@ -24,6 +24,7 @@  #include <linux/init.h>  #include <linux/interrupt.h>  #include <linux/io.h> +#include <linux/module.h>  #include <sound/asound.h>  #include <sound/control.h> @@ -51,7 +52,7 @@ static struct snd_ps3_card_info the_card;  static int snd_ps3_start_delay = CONFIG_SND_PS3_DEFAULT_START_DELAY;  module_param_named(start_delay, snd_ps3_start_delay, uint, 0644); -MODULE_PARM_DESC(start_delay, "time to insert silent data in milisec"); +MODULE_PARM_DESC(start_delay, "time to insert silent data in ms");  static int index = SNDRV_DEFAULT_IDX1;  static char *id = SNDRV_DEFAULT_STR1; @@ -358,7 +359,7 @@ static irqreturn_t snd_ps3_interrupt(int irq, void *dev_id)  		 * filling dummy data, serial automatically start to  		 * consume them and then will generate normal buffer  		 * empty interrupts. -		 * If both buffer underflow and buffer empty are occured, +		 * If both buffer underflow and buffer empty are occurred,  		 * it is better to do nomal data transfer than empty one  		 */  		snd_ps3_program_dma(card, @@ -785,7 +786,7 @@ static struct snd_pcm_ops snd_ps3_pcm_spdif_ops = {  }; -static int __devinit snd_ps3_map_mmio(void) +static int snd_ps3_map_mmio(void)  {  	the_card.mapped_mmio_vaddr =  		ioremap(the_card.ps3_dev->m_region->bus_addr, @@ -807,7 +808,7 @@ static void snd_ps3_unmap_mmio(void)  	the_card.mapped_mmio_vaddr = NULL;  } -static int __devinit snd_ps3_allocate_irq(void) +static int snd_ps3_allocate_irq(void)  {  	int ret;  	u64 lpar_addr, lpar_size; @@ -845,7 +846,7 @@ static int __devinit snd_ps3_allocate_irq(void)  		return ret;  	} -	ret = request_irq(the_card.irq_no, snd_ps3_interrupt, IRQF_DISABLED, +	ret = request_irq(the_card.irq_no, snd_ps3_interrupt, 0,  			  SND_PS3_DRIVER_NAME, &the_card);  	if (ret) {  		pr_info("%s: request_irq failed (%d)\n", __func__, ret); @@ -865,7 +866,7 @@ static void snd_ps3_free_irq(void)  	ps3_irq_plug_destroy(the_card.irq_no);  } -static void __devinit snd_ps3_audio_set_base_addr(uint64_t ioaddr_start) +static void snd_ps3_audio_set_base_addr(uint64_t ioaddr_start)  {  	uint64_t val;  	int ret; @@ -875,13 +876,13 @@ static void __devinit snd_ps3_audio_set_base_addr(uint64_t ioaddr_start)  		(0x0fUL << 12) |  		(PS3_AUDIO_IOID); -	ret = lv1_gpu_attribute(0x100, 0x007, val, 0, 0); +	ret = lv1_gpu_attribute(0x100, 0x007, val);  	if (ret)  		pr_info("%s: gpu_attribute failed %d\n", __func__,  			ret);  } -static void __devinit snd_ps3_audio_fixup(struct snd_ps3_card_info *card) +static void snd_ps3_audio_fixup(struct snd_ps3_card_info *card)  {  	/*  	 * avsetting driver seems to never change the followings @@ -905,7 +906,7 @@ static void __devinit snd_ps3_audio_fixup(struct snd_ps3_card_info *card)  		   PS3_AUDIO_AO_3WMCTRL_ASOPLRCK_DEFAULT);  } -static int __devinit snd_ps3_init_avsetting(struct snd_ps3_card_info *card) +static int snd_ps3_init_avsetting(struct snd_ps3_card_info *card)  {  	int ret;  	pr_debug("%s: start\n", __func__); @@ -927,13 +928,15 @@ static int __devinit snd_ps3_init_avsetting(struct snd_ps3_card_info *card)  	return ret;  } -static int __devinit snd_ps3_driver_probe(struct ps3_system_bus_device *dev) +static int snd_ps3_driver_probe(struct ps3_system_bus_device *dev)  {  	int i, ret;  	u64 lpar_addr, lpar_size; -	BUG_ON(!firmware_has_feature(FW_FEATURE_PS3_LV1)); -	BUG_ON(dev->match_id != PS3_MATCH_ID_SOUND); +	if (WARN_ON(!firmware_has_feature(FW_FEATURE_PS3_LV1))) +		return -ENODEV; +	if (WARN_ON(dev->match_id != PS3_MATCH_ID_SOUND)) +		return -ENODEV;  	the_card.ps3_dev = dev; @@ -981,7 +984,8 @@ static int __devinit snd_ps3_driver_probe(struct ps3_system_bus_device *dev)  	}  	/* create card instance */ -	ret = snd_card_create(index, id, THIS_MODULE, 0, &the_card.card); +	ret = snd_card_new(&dev->core, index, id, THIS_MODULE, +			   0, &the_card.card);  	if (ret < 0)  		goto clean_irq; @@ -1039,6 +1043,7 @@ static int __devinit snd_ps3_driver_probe(struct ps3_system_bus_device *dev)  				   GFP_KERNEL);  	if (!the_card.null_buffer_start_vaddr) {  		pr_info("%s: nullbuffer alloc failed\n", __func__); +		ret = -ENOMEM;  		goto clean_preallocate;  	}  	pr_debug("%s: null vaddr=%p dma=%#llx\n", __func__, @@ -1048,7 +1053,6 @@ static int __devinit snd_ps3_driver_probe(struct ps3_system_bus_device *dev)  	snd_ps3_init_avsetting(&the_card);  	/* register the card */ -	snd_card_set_dev(the_card.card, &dev->core);  	ret = snd_card_register(the_card.card);  	if (ret < 0)  		goto clean_dma_map; diff --git a/sound/ppc/snd_ps3_reg.h b/sound/ppc/snd_ps3_reg.h index 03fdee4aaaf..2e630207956 100644 --- a/sound/ppc/snd_ps3_reg.h +++ b/sound/ppc/snd_ps3_reg.h @@ -125,7 +125,7 @@     transfers.  Any interrupts associated with the canceled transfers     will occur as if the transfer had finished.     Since this bit is designed to recover from DMA related issues -   which are caused by unpredictable situations, it is prefered to wait +   which are caused by unpredictable situations, it is preferred to wait     for normal DMA transfer end without using this bit.  */  #define PS3_AUDIO_CONFIG_CLEAR          (1 << 8)  /* RWIVF */ @@ -316,13 +316,13 @@ DISABLED=Interrupt generation disabled.  /*  Audio Port Interrupt Status Register -Indicates Interrupt status, which interrupt has occured, and can clear +Indicates Interrupt status, which interrupt has occurred, and can clear  each interrupt in this register.  Writing 1b to a field containing 1b clears field and de-asserts interrupt.  Writing 0b to a field has no effect.  Field vaules are the following: -0 - Interrupt hasn't occured. -1 - Interrupt has occured. +0 - Interrupt hasn't occurred. +1 - Interrupt has occurred.   31            24 23           16 15            8 7             0 @@ -473,7 +473,7 @@ Channel N is out of action by setting 0 to asoen.  /*  Sampling Rate  Specifies the divide ratio of the bit clock (clock output -from bclko) used by the 3-wire Audio Output Clock, whcih +from bclko) used by the 3-wire Audio Output Clock, which  is applied to the master clock selected by mcksel.  Data output is synchronized with this clock.  */ @@ -756,7 +756,7 @@ The STATUS field can be used to monitor the progress of a DMA request.  DONE indicates the previous request has completed.  EVENT indicates that the DMA engine is waiting for the EVENT to occur.  PENDING indicates that the DMA engine has not started processing this -request, but the EVENT has occured. +request, but the EVENT has occurred.  DMA indicates that the data transfer is in progress.  NOTIFY indicates that the notifier signalling end of transfer is being written.  CLEAR indicated that the previous transfer was cleared. @@ -824,7 +824,7 @@ AUDIOFIFO = Audio WriteData FIFO,  /*  PS3_AUDIO_DMASIZE specifies the number of 128-byte blocks + 1 to transfer. -So a value of 0 means 128-bytes will get transfered. +So a value of 0 means 128-bytes will get transferred.   31            24 23           16 15            8 7             0 diff --git a/sound/ppc/tumbler.c b/sound/ppc/tumbler.c index 961d9829769..b9ffc17a479 100644 --- a/sound/ppc/tumbler.c +++ b/sound/ppc/tumbler.c @@ -31,6 +31,7 @@  #include <linux/slab.h>  #include <linux/interrupt.h>  #include <linux/string.h> +#include <linux/of_irq.h>  #include <sound/core.h>  #include <asm/io.h>  #include <asm/irq.h> @@ -844,7 +845,7 @@ static int snapper_put_capture_source(struct snd_kcontrol *kcontrol,  /*   */ -static struct snd_kcontrol_new tumbler_mixers[] __devinitdata = { +static struct snd_kcontrol_new tumbler_mixers[] = {  	{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,  	  .name = "Master Playback Volume",  	  .info = tumbler_info_master_volume, @@ -868,7 +869,7 @@ static struct snd_kcontrol_new tumbler_mixers[] __devinitdata = {  	},  }; -static struct snd_kcontrol_new snapper_mixers[] __devinitdata = { +static struct snd_kcontrol_new snapper_mixers[] = {  	{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,  	  .name = "Master Playback Volume",  	  .info = tumbler_info_master_volume, @@ -901,7 +902,7 @@ static struct snd_kcontrol_new snapper_mixers[] __devinitdata = {  	},  }; -static struct snd_kcontrol_new tumbler_hp_sw __devinitdata = { +static struct snd_kcontrol_new tumbler_hp_sw = {  	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,  	.name = "Headphone Playback Switch",  	.info = snd_pmac_boolean_mono_info, @@ -909,7 +910,7 @@ static struct snd_kcontrol_new tumbler_hp_sw __devinitdata = {  	.put = tumbler_put_mute_switch,  	.private_value = TUMBLER_MUTE_HP,  }; -static struct snd_kcontrol_new tumbler_speaker_sw __devinitdata = { +static struct snd_kcontrol_new tumbler_speaker_sw = {  	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,  	.name = "Speaker Playback Switch",  	.info = snd_pmac_boolean_mono_info, @@ -917,7 +918,7 @@ static struct snd_kcontrol_new tumbler_speaker_sw __devinitdata = {  	.put = tumbler_put_mute_switch,  	.private_value = TUMBLER_MUTE_AMP,  }; -static struct snd_kcontrol_new tumbler_lineout_sw __devinitdata = { +static struct snd_kcontrol_new tumbler_lineout_sw = {  	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,  	.name = "Line Out Playback Switch",  	.info = snd_pmac_boolean_mono_info, @@ -925,7 +926,7 @@ static struct snd_kcontrol_new tumbler_lineout_sw __devinitdata = {  	.put = tumbler_put_mute_switch,  	.private_value = TUMBLER_MUTE_LINE,  }; -static struct snd_kcontrol_new tumbler_drc_sw __devinitdata = { +static struct snd_kcontrol_new tumbler_drc_sw = {  	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,  	.name = "DRC Switch",  	.info = snd_pmac_boolean_mono_info, @@ -1000,7 +1001,7 @@ static void device_change_handler(struct work_struct *work)  				   chip->lineout_sw_ctl);  		if (mix->anded_reset)  			msleep(10); -		check_mute(chip, &mix->amp_mute, 1, mix->auto_mute_notify, +		check_mute(chip, &mix->amp_mute, !IS_G4DA, mix->auto_mute_notify,  			   chip->speaker_sw_ctl);  	} else {  		/* unmute speaker, mute others */ @@ -1276,7 +1277,7 @@ static void tumbler_resume(struct snd_pmac *chip)  #endif  /* initialize tumbler */ -static int __devinit tumbler_init(struct snd_pmac *chip) +static int tumbler_init(struct snd_pmac *chip)  {  	int irq;  	struct pmac_tumbler *mix = chip->mixer_data; @@ -1349,7 +1350,7 @@ static void tumbler_cleanup(struct snd_pmac *chip)  }  /* exported */ -int __devinit snd_pmac_tumbler_init(struct snd_pmac *chip) +int snd_pmac_tumbler_init(struct snd_pmac *chip)  {  	int i, err;  	struct pmac_tumbler *mix;  | 
