| 
									
										
										
										
											2012-02-17 11:24:34 +01:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * QEMU PC speaker emulation | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Copyright (c) 2006 Joachim Henke | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Permission is hereby granted, free of charge, to any person obtaining a copy | 
					
						
							|  |  |  |  * of this software and associated documentation files (the "Software"), to deal | 
					
						
							|  |  |  |  * in the Software without restriction, including without limitation the rights | 
					
						
							|  |  |  |  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | 
					
						
							|  |  |  |  * copies of the Software, and to permit persons to whom the Software is | 
					
						
							|  |  |  |  * furnished to do so, subject to the following conditions: | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * The above copyright notice and this permission notice shall be included in | 
					
						
							|  |  |  |  * all copies or substantial portions of the Software. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | 
					
						
							|  |  |  |  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | 
					
						
							|  |  |  |  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | 
					
						
							|  |  |  |  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | 
					
						
							|  |  |  |  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | 
					
						
							|  |  |  |  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | 
					
						
							|  |  |  |  * THE SOFTWARE. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef HW_PCSPK_H
 | 
					
						
							|  |  |  | #define HW_PCSPK_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-04 15:40:22 +01:00
										 |  |  | #include "hw/hw.h"
 | 
					
						
							| 
									
										
										
										
											2013-02-05 17:06:20 +01:00
										 |  |  | #include "hw/isa/isa.h"
 | 
					
						
							| 
									
										
										
										
											2012-02-17 11:24:34 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-04-27 22:18:48 +02:00
										 |  |  | #define TYPE_PC_SPEAKER "isa-pcspk"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-02-17 11:24:34 +01:00
										 |  |  | static inline ISADevice *pcspk_init(ISABus *bus, ISADevice *pit) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2013-06-07 13:49:13 +02:00
										 |  |  |     DeviceState *dev; | 
					
						
							|  |  |  |     ISADevice *isadev; | 
					
						
							| 
									
										
										
										
											2012-02-17 11:24:34 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-07 13:49:13 +02:00
										 |  |  |     isadev = isa_create(bus, TYPE_PC_SPEAKER); | 
					
						
							|  |  |  |     dev = DEVICE(isadev); | 
					
						
							|  |  |  |     qdev_prop_set_uint32(dev, "iobase", 0x61); | 
					
						
							| 
									
										
										
										
											2016-06-22 15:24:46 +03:00
										 |  |  |     object_property_set_link(OBJECT(dev), OBJECT(pit), "pit", NULL); | 
					
						
							| 
									
										
										
										
											2013-06-07 13:49:13 +02:00
										 |  |  |     qdev_init_nofail(dev); | 
					
						
							| 
									
										
										
										
											2012-02-17 11:24:34 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-07 13:49:13 +02:00
										 |  |  |     return isadev; | 
					
						
							| 
									
										
										
										
											2012-02-17 11:24:34 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif /* !HW_PCSPK_H */
 |