added header

This commit is contained in:
Michelle 2024-12-06 17:14:59 -08:00
parent 45d0e66630
commit e6c1865815

View File

@ -4,6 +4,7 @@
#include <linux/fs.h>
#include <linux/uaccess.h>
#include <linux/ioctl.h>
#include <linux/device.h> // Add this header for class_create, device_create, etc.
#define DEVICE_NAME "audio_mixer"
#define CLASS_NAME "audio"
@ -83,9 +84,9 @@ static long device_ioctl(struct file *filep, unsigned int cmd, unsigned long arg
case AUDIO_IOC_SET_VOLUME:
if (arg >= 0 && arg <= 100) {
for (i = 0; i < 5; i++) {
volumes[i] = arg;
volumes[i] = (int)arg; // Cast arg to int
}
printk(KERN_INFO "Audio Mixer: Set all channel volumes to %d%%\n", arg);
printk(KERN_INFO "Audio Mixer: Set all channel volumes to %lu%%\n", arg); // Use %lu for unsigned long
}
break;
case AUDIO_IOC_MUTE: