extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__)); void reach_error() { __assert_fail("0", "drivers--hwmon--it87.ko_043.67b671b.32_1.cil_unknown.i", 3, "reach_error"); } /* Generated by CIL v. 1.5.1 */ /* print_CIL_Input is false */ typedef unsigned int __kernel_mode_t; typedef unsigned long __kernel_size_t; typedef long __kernel_ssize_t; typedef unsigned short __u16; typedef unsigned int __u32; typedef unsigned long long __u64; typedef unsigned char u8; typedef unsigned short u16; typedef unsigned int u32; typedef unsigned long long u64; typedef __u32 __kernel_dev_t; typedef __kernel_dev_t dev_t; typedef __kernel_mode_t mode_t; typedef __kernel_size_t size_t; typedef __kernel_ssize_t ssize_t; typedef unsigned int gfp_t; typedef u64 resource_size_t; struct pt_regs { unsigned long r15 ; unsigned long r14 ; unsigned long r13 ; unsigned long r12 ; unsigned long bp ; unsigned long bx ; unsigned long r11 ; unsigned long r10 ; unsigned long r9 ; unsigned long r8 ; unsigned long ax ; unsigned long cx ; unsigned long dx ; unsigned long si ; unsigned long di ; unsigned long orig_ax ; unsigned long ip ; unsigned long cs ; unsigned long flags ; unsigned long sp ; unsigned long ss ; }; struct task_struct; struct info { long ___orig_eip ; long ___ebx ; long ___ecx ; long ___edx ; long ___esi ; long ___edi ; long ___ebp ; long ___eax ; long ___ds ; long ___es ; long ___fs ; long ___orig_eax ; long ___eip ; long ___cs ; long ___eflags ; long ___esp ; long ___ss ; long ___vm86_es ; long ___vm86_ds ; long ___vm86_fs ; long ___vm86_gs ; }; struct module; struct bug_entry { unsigned long bug_addr ; char const *file ; unsigned short line ; unsigned short flags ; }; struct completion; struct page; struct __anonstruct____missing_field_name_13 { unsigned int a ; unsigned int b ; }; struct __anonstruct____missing_field_name_14 { u16 limit0 ; u16 base0 ; unsigned int base1 : 8 ; unsigned int type : 4 ; unsigned int s : 1 ; unsigned int dpl : 2 ; unsigned int p : 1 ; unsigned int limit : 4 ; unsigned int avl : 1 ; unsigned int l : 1 ; unsigned int d : 1 ; unsigned int g : 1 ; unsigned int base2 : 8 ; }; union __anonunion____missing_field_name_12 { struct __anonstruct____missing_field_name_13 __annonCompField1 ; struct __anonstruct____missing_field_name_14 __annonCompField2 ; }; struct desc_struct { union __anonunion____missing_field_name_12 __annonCompField3 ; } __attribute__((__packed__)) ; struct gate_struct64 { u16 offset_low ; u16 segment ; unsigned int ist : 3 ; unsigned int zero0 : 5 ; unsigned int type : 5 ; unsigned int dpl : 2 ; unsigned int p : 1 ; u16 offset_middle ; u32 offset_high ; u32 zero1 ; } __attribute__((__packed__)) ; typedef struct gate_struct64 gate_desc; struct desc_ptr { unsigned short size ; unsigned long address ; } __attribute__((__packed__)) ; struct thread_struct; struct tss_struct; struct pv_lazy_ops { void (*enter)(void) ; void (*leave)(void) ; }; struct pv_cpu_ops { unsigned long (*get_debugreg)(int regno ) ; void (*set_debugreg)(int regno , unsigned long value ) ; void (*clts)(void) ; unsigned long (*read_cr0)(void) ; void (*write_cr0)(unsigned long ) ; unsigned long (*read_cr4_safe)(void) ; unsigned long (*read_cr4)(void) ; void (*write_cr4)(unsigned long ) ; unsigned long (*read_cr8)(void) ; void (*write_cr8)(unsigned long ) ; void (*load_tr_desc)(void) ; void (*load_gdt)(struct desc_ptr const * ) ; void (*load_idt)(struct desc_ptr const * ) ; void (*store_gdt)(struct desc_ptr * ) ; void (*store_idt)(struct desc_ptr * ) ; void (*set_ldt)(void const *desc , unsigned int entries ) ; unsigned long (*store_tr)(void) ; void (*load_tls)(struct thread_struct *t , unsigned int cpu ) ; void (*write_ldt_entry)(struct desc_struct *ldt , int entrynum , void const *desc ) ; void (*write_gdt_entry)(struct desc_struct * , int entrynum , void const *desc , int size ) ; void (*write_idt_entry)(gate_desc * , int entrynum , gate_desc const *gate ) ; void (*load_sp0)(struct tss_struct *tss , struct thread_struct *t ) ; void (*set_iopl_mask)(unsigned int mask ) ; void (*wbinvd)(void) ; void (*io_delay)(void) ; void (*cpuid)(unsigned int *eax , unsigned int *ebx , unsigned int *ecx , unsigned int *edx ) ; u64 (*read_msr)(unsigned int msr , int *err ) ; int (*write_msr)(unsigned int msr , unsigned int low , unsigned int high ) ; u64 (*read_tsc)(void) ; u64 (*read_pmc)(int counter ) ; unsigned long long (*read_tscp)(unsigned int *aux ) ; void (*irq_enable_syscall_ret)(void) ; void (*iret)(void) ; void (*swapgs)(void) ; struct pv_lazy_ops lazy_mode ; }; struct exec_domain; struct map_segment; struct exec_domain { char const *name ; void (*handler)(int , struct pt_regs * ) ; unsigned char pers_low ; unsigned char pers_high ; unsigned long *signal_map ; unsigned long *signal_invmap ; struct map_segment *err_map ; struct map_segment *socktype_map ; struct map_segment *sockopt_map ; struct map_segment *af_map ; struct module *module ; struct exec_domain *next ; }; struct x86_hw_tss { u32 reserved1 ; u64 sp0 ; u64 sp1 ; u64 sp2 ; u64 reserved2 ; u64 ist[7] ; u32 reserved3 ; u32 reserved4 ; u16 reserved5 ; u16 io_bitmap_base ; } __attribute__((__packed__, __aligned__((1) << (7) ))) ; struct tss_struct { struct x86_hw_tss x86_tss ; unsigned long io_bitmap[(unsigned long )(65536 / 8) / sizeof(long ) + 1UL] ; unsigned long io_bitmap_max ; struct thread_struct *io_bitmap_owner ; unsigned long __cacheline_filler[35] ; unsigned long stack[64] ; } __attribute__((__packed__)) ; struct i387_fsave_struct { u32 cwd ; u32 swd ; u32 twd ; u32 fip ; u32 fcs ; u32 foo ; u32 fos ; u32 st_space[20] ; u32 status ; }; struct __anonstruct____missing_field_name_21 { u64 rip ; u64 rdp ; }; struct __anonstruct____missing_field_name_22 { u32 fip ; u32 fcs ; u32 foo ; u32 fos ; }; union __anonunion____missing_field_name_20 { struct __anonstruct____missing_field_name_21 __annonCompField4 ; struct __anonstruct____missing_field_name_22 __annonCompField5 ; }; struct i387_fxsave_struct { u16 cwd ; u16 swd ; u16 twd ; u16 fop ; union __anonunion____missing_field_name_20 __annonCompField6 ; u32 mxcsr ; u32 mxcsr_mask ; u32 st_space[32] ; u32 xmm_space[64] ; u32 padding[24] ; } __attribute__((__aligned__(16))) ; struct i387_soft_struct { u32 cwd ; u32 swd ; u32 twd ; u32 fip ; u32 fcs ; u32 foo ; u32 fos ; u32 st_space[20] ; u8 ftop ; u8 changed ; u8 lookahead ; u8 no_update ; u8 rm ; u8 alimit ; struct info *info ; u32 entry_eip ; }; union i387_union { struct i387_fsave_struct fsave ; struct i387_fxsave_struct fxsave ; struct i387_soft_struct soft ; }; struct thread_struct { struct desc_struct tls_array[3] ; unsigned long sp0 ; unsigned long sp ; unsigned long usersp ; unsigned short es ; unsigned short ds ; unsigned short fsindex ; unsigned short gsindex ; unsigned long ip ; unsigned long fs ; unsigned long gs ; unsigned long debugreg0 ; unsigned long debugreg1 ; unsigned long debugreg2 ; unsigned long debugreg3 ; unsigned long debugreg6 ; unsigned long debugreg7 ; unsigned long cr2 ; unsigned long trap_no ; unsigned long error_code ; union i387_union i387 __attribute__((__aligned__(16))) ; unsigned long *io_bitmap_ptr ; unsigned long iopl ; unsigned int io_bitmap_max ; unsigned long debugctlmsr ; unsigned long ds_area_msr ; }; struct __anonstruct_mm_segment_t_23 { unsigned long seg ; }; typedef struct __anonstruct_mm_segment_t_23 mm_segment_t; struct list_head { struct list_head *next ; struct list_head *prev ; }; struct __anonstruct____missing_field_name_25 { unsigned long arg0 ; unsigned long arg1 ; unsigned long arg2 ; unsigned long arg3 ; }; struct __anonstruct_futex_26 { u32 *uaddr ; u32 val ; u32 flags ; u32 bitset ; u64 time ; }; union __anonunion____missing_field_name_24 { struct __anonstruct____missing_field_name_25 __annonCompField7 ; struct __anonstruct_futex_26 futex ; }; struct restart_block { long (*fn)(struct restart_block * ) ; union __anonunion____missing_field_name_24 __annonCompField8 ; }; struct thread_info { struct task_struct *task ; struct exec_domain *exec_domain ; __u32 flags ; __u32 status ; __u32 cpu ; int preempt_count ; mm_segment_t addr_limit ; struct restart_block restart_block ; void *sysenter_return ; }; struct __anonstruct_raw_spinlock_t_27 { unsigned int slock ; }; typedef struct __anonstruct_raw_spinlock_t_27 raw_spinlock_t; struct lock_class_key { }; struct __anonstruct_spinlock_t_29 { raw_spinlock_t raw_lock ; unsigned int magic ; unsigned int owner_cpu ; void *owner ; }; typedef struct __anonstruct_spinlock_t_29 spinlock_t; struct __anonstruct_atomic_t_31 { int counter ; }; typedef struct __anonstruct_atomic_t_31 atomic_t; struct __anonstruct_atomic64_t_32 { long counter ; }; typedef struct __anonstruct_atomic64_t_32 atomic64_t; typedef atomic64_t atomic_long_t; typedef __u64 Elf64_Addr; typedef __u16 Elf64_Half; typedef __u32 Elf64_Word; typedef __u64 Elf64_Xword; struct elf64_sym { Elf64_Word st_name ; unsigned char st_info ; unsigned char st_other ; Elf64_Half st_shndx ; Elf64_Addr st_value ; Elf64_Xword st_size ; }; typedef struct elf64_sym Elf64_Sym; struct kobject; struct attribute { char const *name ; struct module *owner ; mode_t mode ; }; struct attribute_group { char const *name ; int (*is_visible)(struct kobject * , struct attribute * , int ) ; struct attribute **attrs ; }; struct sysfs_ops { ssize_t (*show)(struct kobject * , struct attribute * , char * ) ; ssize_t (*store)(struct kobject * , struct attribute * , char const * , size_t ) ; }; struct kref { atomic_t refcount ; }; struct __wait_queue_head { spinlock_t lock ; struct list_head task_list ; }; typedef struct __wait_queue_head wait_queue_head_t; struct kset; struct kobj_type; struct sysfs_dirent; struct kobject { char const *name ; struct kref kref ; struct list_head entry ; struct kobject *parent ; struct kset *kset ; struct kobj_type *ktype ; struct sysfs_dirent *sd ; unsigned int state_initialized : 1 ; unsigned int state_in_sysfs : 1 ; unsigned int state_add_uevent_sent : 1 ; unsigned int state_remove_uevent_sent : 1 ; }; struct kobj_type { void (*release)(struct kobject *kobj ) ; struct sysfs_ops *sysfs_ops ; struct attribute **default_attrs ; }; struct kobj_uevent_env { char *envp[32] ; int envp_idx ; char buf[2048] ; int buflen ; }; struct kset_uevent_ops { int (*filter)(struct kset *kset , struct kobject *kobj ) ; char const *(*name)(struct kset *kset , struct kobject *kobj ) ; int (*uevent)(struct kset *kset , struct kobject *kobj , struct kobj_uevent_env *env ) ; }; struct kset { struct list_head list ; spinlock_t list_lock ; struct kobject kobj ; struct kset_uevent_ops *uevent_ops ; }; struct kernel_param; struct kparam_string; struct kparam_array; union __anonunion____missing_field_name_38 { void *arg ; struct kparam_string const *str ; struct kparam_array const *arr ; }; struct kernel_param { char const *name ; unsigned int perm ; int (*set)(char const *val , struct kernel_param *kp ) ; int (*get)(char *buffer , struct kernel_param *kp ) ; union __anonunion____missing_field_name_38 __annonCompField9 ; }; struct kparam_string { unsigned int maxlen ; char *string ; }; struct kparam_array { unsigned int max ; unsigned int *num ; int (*set)(char const *val , struct kernel_param *kp ) ; int (*get)(char *buffer , struct kernel_param *kp ) ; unsigned int elemsize ; void *elem ; }; struct marker; typedef void marker_probe_func(struct marker const *mdata , void *private_data , char const *fmt , ...); struct marker { char const *name ; char const *format ; char state ; marker_probe_func *call ; void *private ; } __attribute__((__aligned__(8))) ; struct mutex { atomic_t count ; spinlock_t wait_lock ; struct list_head wait_list ; struct thread_info *owner ; char const *name ; void *magic ; }; struct device; struct pm_message { int event ; }; typedef struct pm_message pm_message_t; struct dev_pm_info { pm_message_t power_state ; unsigned int can_wakeup : 1 ; unsigned int should_wakeup : 1 ; struct list_head entry ; }; struct kmem_cache; struct kmem_cache_cpu { void **freelist ; struct page *page ; int node ; unsigned int offset ; unsigned int objsize ; }; struct kmem_cache_node { spinlock_t list_lock ; unsigned long nr_partial ; atomic_long_t nr_slabs ; struct list_head partial ; struct list_head full ; }; struct kmem_cache { unsigned long flags ; int size ; int objsize ; int offset ; int order ; struct kmem_cache_node local_node ; int objects ; int refcount ; void (*ctor)(struct kmem_cache * , void * ) ; int inuse ; int align ; char const *name ; struct list_head list ; struct kobject kobj ; int remote_node_defrag_ratio ; struct kmem_cache_node *node[1 << 6] ; struct kmem_cache_cpu *cpu_slab[8] ; }; struct __anonstruct_local_t_92 { atomic_long_t a ; }; typedef struct __anonstruct_local_t_92 local_t; struct mod_arch_specific { }; struct kernel_symbol { unsigned long value ; char const *name ; }; struct module_attribute { struct attribute attr ; ssize_t (*show)(struct module_attribute * , struct module * , char * ) ; ssize_t (*store)(struct module_attribute * , struct module * , char const * , size_t count ) ; void (*setup)(struct module * , char const * ) ; int (*test)(struct module * ) ; void (*free)(struct module * ) ; }; struct module_kobject { struct kobject kobj ; struct module *mod ; struct kobject *drivers_dir ; }; struct exception_table_entry; struct module_ref { local_t count ; } __attribute__((__aligned__((1) << (7) ))) ; enum module_state { MODULE_STATE_LIVE = 0, MODULE_STATE_COMING = 1, MODULE_STATE_GOING = 2 } ; struct module_sect_attr { struct module_attribute mattr ; char *name ; unsigned long address ; }; struct module_sect_attrs { struct attribute_group grp ; int nsections ; struct module_sect_attr attrs[0] ; }; struct module_param_attrs; struct module_notes_attrs; struct module { enum module_state state ; struct list_head list ; char name[64UL - sizeof(unsigned long )] ; struct module_kobject mkobj ; struct module_param_attrs *param_attrs ; struct module_attribute *modinfo_attrs ; char const *version ; char const *srcversion ; struct kobject *holders_dir ; struct kernel_symbol const *syms ; unsigned int num_syms ; unsigned long const *crcs ; struct kernel_symbol const *gpl_syms ; unsigned int num_gpl_syms ; unsigned long const *gpl_crcs ; struct kernel_symbol const *unused_syms ; unsigned int num_unused_syms ; unsigned long const *unused_crcs ; struct kernel_symbol const *unused_gpl_syms ; unsigned int num_unused_gpl_syms ; unsigned long const *unused_gpl_crcs ; struct kernel_symbol const *gpl_future_syms ; unsigned int num_gpl_future_syms ; unsigned long const *gpl_future_crcs ; unsigned int num_exentries ; struct exception_table_entry const *extable ; int (*init)(void) ; void *module_init ; void *module_core ; unsigned long init_size ; unsigned long core_size ; unsigned long init_text_size ; unsigned long core_text_size ; void *unwind_info ; struct mod_arch_specific arch ; unsigned int taints ; struct list_head bug_list ; struct bug_entry *bug_table ; unsigned int num_bugs ; struct module_ref ref[8] ; struct list_head modules_which_use_me ; struct task_struct *waiter ; void (*exit)(void) ; Elf64_Sym *symtab ; unsigned long num_symtab ; char *strtab ; struct module_sect_attrs *sect_attrs ; struct module_notes_attrs *notes_attrs ; void *percpu ; char *args ; struct marker *markers ; unsigned int num_markers ; }; struct device_driver; struct resource { resource_size_t start ; resource_size_t end ; char const *name ; unsigned long flags ; struct resource *parent ; struct resource *sibling ; struct resource *child ; }; struct completion { unsigned int done ; wait_queue_head_t wait ; }; struct klist_node; struct klist { spinlock_t k_lock ; struct list_head k_list ; void (*get)(struct klist_node * ) ; void (*put)(struct klist_node * ) ; }; struct klist_node { struct klist *n_klist ; struct list_head n_node ; struct kref n_ref ; struct completion n_removed ; }; struct semaphore { atomic_t count ; int sleepers ; wait_queue_head_t wait ; }; struct dev_archdata { void *acpi_handle ; void *iommu ; }; struct driver_private; struct class; struct class_device; struct bus_type; struct bus_type_private; struct bus_attribute { struct attribute attr ; ssize_t (*show)(struct bus_type *bus , char *buf ) ; ssize_t (*store)(struct bus_type *bus , char const *buf , size_t count ) ; }; struct device_attribute; struct driver_attribute; struct bus_type { char const *name ; struct bus_attribute *bus_attrs ; struct device_attribute *dev_attrs ; struct driver_attribute *drv_attrs ; int (*match)(struct device *dev , struct device_driver *drv ) ; int (*uevent)(struct device *dev , struct kobj_uevent_env *env ) ; int (*probe)(struct device *dev ) ; int (*remove)(struct device *dev ) ; void (*shutdown)(struct device *dev ) ; int (*suspend)(struct device *dev , pm_message_t state ) ; int (*suspend_late)(struct device *dev , pm_message_t state ) ; int (*resume_early)(struct device *dev ) ; int (*resume)(struct device *dev ) ; struct bus_type_private *p ; }; struct device_driver { char const *name ; struct bus_type *bus ; struct module *owner ; char const *mod_name ; int (*probe)(struct device *dev ) ; int (*remove)(struct device *dev ) ; void (*shutdown)(struct device *dev ) ; int (*suspend)(struct device *dev , pm_message_t state ) ; int (*resume)(struct device *dev ) ; struct attribute_group **groups ; struct driver_private *p ; }; struct driver_attribute { struct attribute attr ; ssize_t (*show)(struct device_driver *driver , char *buf ) ; ssize_t (*store)(struct device_driver *driver , char const *buf , size_t count ) ; }; struct class_attribute; struct class_device_attribute; struct class { char const *name ; struct module *owner ; struct kset subsys ; struct list_head children ; struct list_head devices ; struct list_head interfaces ; struct kset class_dirs ; struct semaphore sem ; struct class_attribute *class_attrs ; struct class_device_attribute *class_dev_attrs ; struct device_attribute *dev_attrs ; int (*uevent)(struct class_device *dev , struct kobj_uevent_env *env ) ; int (*dev_uevent)(struct device *dev , struct kobj_uevent_env *env ) ; void (*release)(struct class_device *dev ) ; void (*class_release)(struct class *class ) ; void (*dev_release)(struct device *dev ) ; int (*suspend)(struct device *dev , pm_message_t state ) ; int (*resume)(struct device *dev ) ; }; struct class_attribute { struct attribute attr ; ssize_t (*show)(struct class *class , char *buf ) ; ssize_t (*store)(struct class *class , char const *buf , size_t count ) ; }; struct class_device_attribute { struct attribute attr ; ssize_t (*show)(struct class_device * , char *buf ) ; ssize_t (*store)(struct class_device * , char const *buf , size_t count ) ; }; struct class_device { struct list_head node ; struct kobject kobj ; struct class *class ; dev_t devt ; struct device *dev ; void *class_data ; struct class_device *parent ; struct attribute_group **groups ; void (*release)(struct class_device *dev ) ; int (*uevent)(struct class_device *dev , struct kobj_uevent_env *env ) ; char class_id[20] ; }; struct device_type { char const *name ; struct attribute_group **groups ; int (*uevent)(struct device *dev , struct kobj_uevent_env *env ) ; void (*release)(struct device *dev ) ; int (*suspend)(struct device *dev , pm_message_t state ) ; int (*resume)(struct device *dev ) ; }; struct device_attribute { struct attribute attr ; ssize_t (*show)(struct device *dev , struct device_attribute *attr , char *buf ) ; ssize_t (*store)(struct device *dev , struct device_attribute *attr , char const *buf , size_t count ) ; }; struct device_dma_parameters { unsigned int max_segment_size ; unsigned long segment_boundary_mask ; }; struct dma_coherent_mem; struct device { struct klist klist_children ; struct klist_node knode_parent ; struct klist_node knode_driver ; struct klist_node knode_bus ; struct device *parent ; struct kobject kobj ; char bus_id[20] ; struct device_type *type ; unsigned int is_registered : 1 ; unsigned int uevent_suppress : 1 ; struct semaphore sem ; struct bus_type *bus ; struct device_driver *driver ; void *driver_data ; void *platform_data ; struct dev_pm_info power ; int numa_node ; u64 *dma_mask ; u64 coherent_dma_mask ; struct device_dma_parameters *dma_parms ; struct list_head dma_pools ; struct dma_coherent_mem *dma_mem ; struct dev_archdata archdata ; spinlock_t devres_lock ; struct list_head devres_head ; struct list_head node ; struct class *class ; dev_t devt ; struct attribute_group **groups ; void (*release)(struct device *dev ) ; }; struct platform_device { char const *name ; int id ; struct device dev ; u32 num_resources ; struct resource *resource ; }; struct platform_driver { int (*probe)(struct platform_device * ) ; int (*remove)(struct platform_device * ) ; void (*shutdown)(struct platform_device * ) ; int (*suspend)(struct platform_device * , pm_message_t state ) ; int (*suspend_late)(struct platform_device * , pm_message_t state ) ; int (*resume_early)(struct platform_device * ) ; int (*resume)(struct platform_device * ) ; struct device_driver driver ; }; struct sensor_device_attribute { struct device_attribute dev_attr ; int index ; }; enum chips { it87 = 0, it8712 = 1, it8716 = 2, it8718 = 3 } ; struct it87_sio_data { enum chips type ; u8 vid_value ; }; struct it87_data { struct device *hwmon_dev ; enum chips type ; unsigned short addr ; char const *name ; struct mutex update_lock ; char valid ; unsigned long last_updated ; u8 in[9] ; u8 in_max[8] ; u8 in_min[8] ; u8 has_fan ; u16 fan[5] ; u16 fan_min[5] ; u8 temp[3] ; u8 temp_high[3] ; u8 temp_low[3] ; u8 sensor ; u8 fan_div[3] ; u8 vid ; u8 vrm ; u32 alarms ; u8 fan_main_ctrl ; u8 fan_ctl ; u8 manual_pwm_ctl[3] ; }; long ldv__builtin_expect(long exp , long c ) ; extern unsigned long simple_strtoul(char const * , char ** , unsigned int ) ; extern long simple_strtol(char const * , char ** , unsigned int ) ; extern int ( /* format attribute */ sprintf)(char *buf , char const *fmt , ...) ; extern int ( /* format attribute */ printk)(char const *fmt , ...) ; extern struct pv_cpu_ops pv_cpu_ops ; __inline static void ( __attribute__((__always_inline__)) slow_down_io)(void) { { (*(pv_cpu_ops.io_delay))(); return; } } extern int ( __attribute__((__warn_unused_result__)) sysfs_create_group)(struct kobject *kobj , struct attribute_group const *grp ) ; extern void sysfs_remove_group(struct kobject *kobj , struct attribute_group const *grp ) ; extern int param_set_ushort(char const *val , struct kernel_param *kp ) ; extern int param_get_ushort(char *buffer , struct kernel_param *kp ) ; extern int param_set_bool(char const *val , struct kernel_param *kp ) ; extern int param_get_bool(char *buffer , struct kernel_param *kp ) ; extern void __mutex_init(struct mutex *lock , char const *name , struct lock_class_key *key ) ; void mutex_lock(struct mutex *lock ) ; void mutex_unlock(struct mutex *lock ) ; extern void kfree(void const * ) ; extern unsigned long volatile jiffies __attribute__((__section__(".data"))) ; extern void *__kmalloc(size_t size , gfp_t flags ) ; __inline static void *( __attribute__((__always_inline__)) kmalloc)(size_t size , gfp_t flags ) { void *tmp___3 ; { tmp___3 = __kmalloc(size, flags); return (tmp___3); } } __inline static void *( __attribute__((__always_inline__)) kzalloc)(size_t size , gfp_t flags ) { void *tmp ; { tmp = kmalloc(size, flags | 32768U); return (tmp); } } int init_module(void) ; void cleanup_module(void) ; extern struct module __this_module ; extern struct resource ioport_resource ; extern struct resource *__request_region(struct resource * , resource_size_t start , resource_size_t n , char const *name ) ; extern void __release_region(struct resource * , resource_size_t , resource_size_t ) ; extern int ( __attribute__((__warn_unused_result__)) device_create_file)(struct device *device , struct device_attribute *entry ) ; __inline static void *( __attribute__((__always_inline__)) dev_get_drvdata)(struct device *dev ) { { return (dev->driver_data); } } __inline static void ( __attribute__((__always_inline__)) dev_set_drvdata)(struct device *dev , void *data ) { { dev->driver_data = data; return; } } extern char const *dev_driver_string(struct device *dev ) ; extern void platform_device_unregister(struct platform_device * ) ; extern struct resource *platform_get_resource(struct platform_device * , unsigned int , unsigned int ) ; extern struct platform_device *platform_device_alloc(char const *name , int id ) ; extern int platform_device_add_resources(struct platform_device *pdev , struct resource *res , unsigned int num ) ; extern int platform_device_add_data(struct platform_device *pdev , void const *data , size_t size ) ; extern int platform_device_add(struct platform_device *pdev ) ; extern void platform_device_put(struct platform_device *pdev ) ; extern int platform_driver_register(struct platform_driver * ) ; extern void platform_driver_unregister(struct platform_driver * ) ; extern struct device *hwmon_device_register(struct device *dev ) ; extern void hwmon_device_unregister(struct device *dev ) ; __inline static int ( __attribute__((__always_inline__)) SENSORS_LIMIT)(long value , long low , long high ) { { if (value < low) { return (low); } else if (value > high) { return (high); } else { return (value); } } } extern int vid_from_reg(int val , u8 vrm ) ; extern u8 vid_which_vrm(void) ; __inline static long ( __attribute__((__always_inline__)) PTR_ERR)(void const *ptr ) { { return ((long )ptr); } } __inline static long ( __attribute__((__always_inline__)) IS_ERR)(void const *ptr ) { long tmp ; { tmp = ldv__builtin_expect(! (! ((unsigned long )ptr >= 0xfffffffffffff001UL)), 0); return (tmp); } } __inline static unsigned char ( __attribute__((__always_inline__)) inb)(unsigned short port ) { unsigned char _v ; { __asm__ volatile ("in" "b" " %" "w" "1,%" "" "0": "=a" (_v): "Nd" (port)); return (_v); } } __inline static unsigned char ( __attribute__((__always_inline__)) inb_p)(unsigned short port ) { unsigned char _v ; { __asm__ volatile ("in" "b" " %" "w" "1,%" "" "0": "=a" (_v): "Nd" (port)); slow_down_io(); return (_v); } } __inline static void ( __attribute__((__always_inline__)) outb)(unsigned char value , unsigned short port ) { { __asm__ volatile ("out" "b" " %" "b" "0,%" "w" "1": : "a" (value), "Nd" (port)); return; } } __inline static void ( __attribute__((__always_inline__)) outb_p)(unsigned char value , unsigned short port ) { { __asm__ volatile ("out" "b" " %" "b" "0,%" "w" "1": : "a" (value), "Nd" (port)); slow_down_io(); return; } } static unsigned short force_id ; static char const __param_str_force_id[9] = { 'f', 'o', 'r', 'c', 'e', '_', 'i', 'd', '\000'}; static struct kernel_param const __param_force_id __attribute__((__used__, __unused__, __section__("__param"), __aligned__(sizeof(void *)))) = {__param_str_force_id, 0, & param_set_ushort, & param_get_ushort, {& force_id}}; static char const __mod_force_idtype57[25] __attribute__((__used__, __unused__, __section__(".modinfo"))) = { 'p', 'a', 'r', 'm', 't', 'y', 'p', 'e', '=', 'f', 'o', 'r', 'c', 'e', '_', 'i', 'd', ':', 'u', 's', 'h', 'o', 'r', 't', '\000'}; static char const __mod_force_id58[46] __attribute__((__used__, __unused__, __section__(".modinfo"))) = { 'p', 'a', 'r', 'm', '=', 'f', 'o', 'r', 'c', 'e', '_', 'i', 'd', ':', 'O', 'v', 'e', 'r', 'r', 'i', 'd', 'e', ' ', 't', 'h', 'e', ' ', 'd', 'e', 't', 'e', 'c', 't', 'e', 'd', ' ', 'd', 'e', 'v', 'i', 'c', 'e', ' ', 'I', 'D', '\000'}; static struct platform_device *pdev ; __inline static int ( __attribute__((__always_inline__)) superio_inb)(int reg ) { unsigned char tmp ; { outb(reg, 46); tmp = inb(47); return (tmp); } } static int superio_inw(int reg ) { int val ; int tmp ; unsigned char tmp___0 ; unsigned char tmp___1 ; { tmp = reg; reg = reg + 1; outb(tmp, 46); tmp___0 = inb(47); val = (int )tmp___0 << 8; outb(reg, 46); tmp___1 = inb(47); val = val | (int )tmp___1; return (val); } } __inline static void ( __attribute__((__always_inline__)) superio_select)(int ldn ) { { outb(7, 46); outb(ldn, 47); return; } } __inline static void ( __attribute__((__always_inline__)) superio_enter)(void) { { outb(135, 46); outb(1, 46); outb(85, 46); outb(85, 46); return; } } __inline static void ( __attribute__((__always_inline__)) superio_exit)(void) { { outb(2, 46); outb(2, 47); return; } } static int update_vbat ; static int fix_pwm_polarity ; static u8 const IT87_REG_FAN[5] = { 13, 14, 15, 128, 130}; static u8 const IT87_REG_FAN_MIN[5] = { 16, 17, 18, 132, 134}; static u8 const IT87_REG_FANX[5] = { 24, 25, 26, 129, 131}; static u8 const IT87_REG_FANX_MIN[5] = { 27, 28, 29, 133, 135}; __inline static u8 ( __attribute__((__always_inline__)) FAN_TO_REG)(long rpm , int div ) { int tmp ; int tmp___0 ; { if (rpm == 0L) { return (255); } else { } tmp = SENSORS_LIMIT(rpm, 1, 1000000); rpm = tmp; tmp___0 = SENSORS_LIMIT((1350000L + (rpm * (long )div) / 2L) / (rpm * (long )div), 1, 254); return (tmp___0); } } __inline static u16 ( __attribute__((__always_inline__)) FAN16_TO_REG)(long rpm ) { int tmp ; { if (rpm == 0L) { return (65535); } else { } tmp = SENSORS_LIMIT((1350000L + rpm) / (rpm * 2L), 1, 65534); return (tmp); } } static int DIV_TO_REG(int val ) { int answer ; { answer = 0; while (1) { if (answer < 7) { val = val >> 1; if (val) { } else { break; } } else { break; } answer = answer + 1; } return (answer); } } static unsigned int const pwm_freq[8] = { 48000000 / 128, 24000000 / 128, 12000000 / 128, 8000000 / 128, 6000000 / 128, 3000000 / 128, 1500000 / 128, 750000 / 128}; static int it87_probe(struct platform_device *pdev___0 ) __attribute__((__section__(".devinit.text"))) ; static int it87_remove(struct platform_device *pdev___0 ) __attribute__((__section__(".devexit.text"))) ; static int it87_read_value(struct it87_data *data , u8 reg ) ; static void it87_write_value(struct it87_data *data , u8 reg , u8 value ) ; static struct it87_data *it87_update_device(struct device *dev ) ; static int it87_check_pwm(struct device *dev ) __attribute__((__section__(".devinit.text"))) ; static void it87_init_device(struct platform_device *pdev___0 ) __attribute__((__section__(".devinit.text"))) ; static struct platform_driver it87_driver = {& it87_probe, & it87_remove, 0, 0, 0, 0, 0, {"it87", 0, & __this_module, 0, 0, 0, 0, 0, 0, 0, 0}}; static ssize_t show_in(struct device *dev , struct device_attribute *attr , char *buf ) { struct sensor_device_attribute *sensor_attr ; struct device_attribute const *__mptr ; int nr ; struct it87_data *data ; struct it87_data *tmp ; int tmp___0 ; { __mptr = attr; sensor_attr = (struct sensor_device_attribute *)((char *)__mptr - (unsigned int )(& ((struct sensor_device_attribute *)0)->dev_attr)); nr = sensor_attr->index; tmp = it87_update_device(dev); data = tmp; tmp___0 = sprintf(buf, "%d\n", (int )data->in[nr] * 16); return (tmp___0); } } static ssize_t show_in_min(struct device *dev , struct device_attribute *attr , char *buf ) { struct sensor_device_attribute *sensor_attr ; struct device_attribute const *__mptr ; int nr ; struct it87_data *data ; struct it87_data *tmp ; int tmp___0 ; { __mptr = attr; sensor_attr = (struct sensor_device_attribute *)((char *)__mptr - (unsigned int )(& ((struct sensor_device_attribute *)0)->dev_attr)); nr = sensor_attr->index; tmp = it87_update_device(dev); data = tmp; tmp___0 = sprintf(buf, "%d\n", (int )data->in_min[nr] * 16); return (tmp___0); } } static ssize_t show_in_max(struct device *dev , struct device_attribute *attr , char *buf ) { struct sensor_device_attribute *sensor_attr ; struct device_attribute const *__mptr ; int nr ; struct it87_data *data ; struct it87_data *tmp ; int tmp___0 ; { __mptr = attr; sensor_attr = (struct sensor_device_attribute *)((char *)__mptr - (unsigned int )(& ((struct sensor_device_attribute *)0)->dev_attr)); nr = sensor_attr->index; tmp = it87_update_device(dev); data = tmp; tmp___0 = sprintf(buf, "%d\n", (int )data->in_max[nr] * 16); return (tmp___0); } } static ssize_t set_in_min(struct device *dev , struct device_attribute *attr , char const *buf , size_t count ) { struct sensor_device_attribute *sensor_attr ; struct device_attribute const *__mptr ; int nr ; struct it87_data *data ; void *tmp ; unsigned long val ; unsigned long tmp___0 ; int tmp___1 ; { __mptr = attr; sensor_attr = (struct sensor_device_attribute *)((char *)__mptr - (unsigned int )(& ((struct sensor_device_attribute *)0)->dev_attr)); nr = sensor_attr->index; tmp = dev_get_drvdata(dev); data = tmp; tmp___0 = simple_strtoul(buf, (void *)0, 10); val = tmp___0; mutex_lock(& data->update_lock); tmp___1 = SENSORS_LIMIT((val + 8UL) / 16UL, 0, 255); data->in_min[nr] = tmp___1; it87_write_value(data, 49 + nr * 2, data->in_min[nr]); mutex_unlock(& data->update_lock); return (count); } } static ssize_t set_in_max(struct device *dev , struct device_attribute *attr , char const *buf , size_t count ) { struct sensor_device_attribute *sensor_attr ; struct device_attribute const *__mptr ; int nr ; struct it87_data *data ; void *tmp ; unsigned long val ; unsigned long tmp___0 ; int tmp___1 ; { __mptr = attr; sensor_attr = (struct sensor_device_attribute *)((char *)__mptr - (unsigned int )(& ((struct sensor_device_attribute *)0)->dev_attr)); nr = sensor_attr->index; tmp = dev_get_drvdata(dev); data = tmp; tmp___0 = simple_strtoul(buf, (void *)0, 10); val = tmp___0; mutex_lock(& data->update_lock); tmp___1 = SENSORS_LIMIT((val + 8UL) / 16UL, 0, 255); data->in_max[nr] = tmp___1; it87_write_value(data, 48 + nr * 2, data->in_max[nr]); mutex_unlock(& data->update_lock); return (count); } } static struct sensor_device_attribute sensor_dev_attr_in0_input = {{{"in0_input", 0, (256 | 32) | 4}, & show_in, (void *)0}, 0}; static struct sensor_device_attribute sensor_dev_attr_in0_min = {{{"in0_min", 0, ((256 | 32) | 4) | 128}, & show_in_min, & set_in_min}, 0}; static struct sensor_device_attribute sensor_dev_attr_in0_max = {{{"in0_max", 0, ((256 | 32) | 4) | 128}, & show_in_max, & set_in_max}, 0}; static struct sensor_device_attribute sensor_dev_attr_in1_input = {{{"in1_input", 0, (256 | 32) | 4}, & show_in, (void *)0}, 1}; static struct sensor_device_attribute sensor_dev_attr_in1_min = {{{"in1_min", 0, ((256 | 32) | 4) | 128}, & show_in_min, & set_in_min}, 1}; static struct sensor_device_attribute sensor_dev_attr_in1_max = {{{"in1_max", 0, ((256 | 32) | 4) | 128}, & show_in_max, & set_in_max}, 1}; static struct sensor_device_attribute sensor_dev_attr_in2_input = {{{"in2_input", 0, (256 | 32) | 4}, & show_in, (void *)0}, 2}; static struct sensor_device_attribute sensor_dev_attr_in2_min = {{{"in2_min", 0, ((256 | 32) | 4) | 128}, & show_in_min, & set_in_min}, 2}; static struct sensor_device_attribute sensor_dev_attr_in2_max = {{{"in2_max", 0, ((256 | 32) | 4) | 128}, & show_in_max, & set_in_max}, 2}; static struct sensor_device_attribute sensor_dev_attr_in3_input = {{{"in3_input", 0, (256 | 32) | 4}, & show_in, (void *)0}, 3}; static struct sensor_device_attribute sensor_dev_attr_in3_min = {{{"in3_min", 0, ((256 | 32) | 4) | 128}, & show_in_min, & set_in_min}, 3}; static struct sensor_device_attribute sensor_dev_attr_in3_max = {{{"in3_max", 0, ((256 | 32) | 4) | 128}, & show_in_max, & set_in_max}, 3}; static struct sensor_device_attribute sensor_dev_attr_in4_input = {{{"in4_input", 0, (256 | 32) | 4}, & show_in, (void *)0}, 4}; static struct sensor_device_attribute sensor_dev_attr_in4_min = {{{"in4_min", 0, ((256 | 32) | 4) | 128}, & show_in_min, & set_in_min}, 4}; static struct sensor_device_attribute sensor_dev_attr_in4_max = {{{"in4_max", 0, ((256 | 32) | 4) | 128}, & show_in_max, & set_in_max}, 4}; static struct sensor_device_attribute sensor_dev_attr_in5_input = {{{"in5_input", 0, (256 | 32) | 4}, & show_in, (void *)0}, 5}; static struct sensor_device_attribute sensor_dev_attr_in5_min = {{{"in5_min", 0, ((256 | 32) | 4) | 128}, & show_in_min, & set_in_min}, 5}; static struct sensor_device_attribute sensor_dev_attr_in5_max = {{{"in5_max", 0, ((256 | 32) | 4) | 128}, & show_in_max, & set_in_max}, 5}; static struct sensor_device_attribute sensor_dev_attr_in6_input = {{{"in6_input", 0, (256 | 32) | 4}, & show_in, (void *)0}, 6}; static struct sensor_device_attribute sensor_dev_attr_in6_min = {{{"in6_min", 0, ((256 | 32) | 4) | 128}, & show_in_min, & set_in_min}, 6}; static struct sensor_device_attribute sensor_dev_attr_in6_max = {{{"in6_max", 0, ((256 | 32) | 4) | 128}, & show_in_max, & set_in_max}, 6}; static struct sensor_device_attribute sensor_dev_attr_in7_input = {{{"in7_input", 0, (256 | 32) | 4}, & show_in, (void *)0}, 7}; static struct sensor_device_attribute sensor_dev_attr_in7_min = {{{"in7_min", 0, ((256 | 32) | 4) | 128}, & show_in_min, & set_in_min}, 7}; static struct sensor_device_attribute sensor_dev_attr_in7_max = {{{"in7_max", 0, ((256 | 32) | 4) | 128}, & show_in_max, & set_in_max}, 7}; static struct sensor_device_attribute sensor_dev_attr_in8_input = {{{"in8_input", 0, (256 | 32) | 4}, & show_in, (void *)0}, 8}; static ssize_t show_temp(struct device *dev , struct device_attribute *attr , char *buf ) { struct sensor_device_attribute *sensor_attr ; struct device_attribute const *__mptr ; int nr ; struct it87_data *data ; struct it87_data *tmp ; int tmp___0 ; { __mptr = attr; sensor_attr = (struct sensor_device_attribute *)((char *)__mptr - (unsigned int )(& ((struct sensor_device_attribute *)0)->dev_attr)); nr = sensor_attr->index; tmp = it87_update_device(dev); data = tmp; tmp___0 = sprintf(buf, "%d\n", ((int )data->temp[nr] > 128 ? (int )data->temp[nr] - 256 : data->temp[nr]) * 1000); return (tmp___0); } } static ssize_t show_temp_max(struct device *dev , struct device_attribute *attr , char *buf ) { struct sensor_device_attribute *sensor_attr ; struct device_attribute const *__mptr ; int nr ; struct it87_data *data ; struct it87_data *tmp ; int tmp___0 ; { __mptr = attr; sensor_attr = (struct sensor_device_attribute *)((char *)__mptr - (unsigned int )(& ((struct sensor_device_attribute *)0)->dev_attr)); nr = sensor_attr->index; tmp = it87_update_device(dev); data = tmp; tmp___0 = sprintf(buf, "%d\n", ((int )data->temp_high[nr] > 128 ? (int )data->temp_high[nr] - 256 : data->temp_high[nr]) * 1000); return (tmp___0); } } static ssize_t show_temp_min(struct device *dev , struct device_attribute *attr , char *buf ) { struct sensor_device_attribute *sensor_attr ; struct device_attribute const *__mptr ; int nr ; struct it87_data *data ; struct it87_data *tmp ; int tmp___0 ; { __mptr = attr; sensor_attr = (struct sensor_device_attribute *)((char *)__mptr - (unsigned int )(& ((struct sensor_device_attribute *)0)->dev_attr)); nr = sensor_attr->index; tmp = it87_update_device(dev); data = tmp; tmp___0 = sprintf(buf, "%d\n", ((int )data->temp_low[nr] > 128 ? (int )data->temp_low[nr] - 256 : data->temp_low[nr]) * 1000); return (tmp___0); } } static ssize_t set_temp_max(struct device *dev , struct device_attribute *attr , char const *buf , size_t count ) { struct sensor_device_attribute *sensor_attr ; struct device_attribute const *__mptr ; int nr ; struct it87_data *data ; void *tmp ; int val ; long tmp___0 ; int tmp___1 ; { __mptr = attr; sensor_attr = (struct sensor_device_attribute *)((char *)__mptr - (unsigned int )(& ((struct sensor_device_attribute *)0)->dev_attr)); nr = sensor_attr->index; tmp = dev_get_drvdata(dev); data = tmp; tmp___0 = simple_strtol(buf, (void *)0, 10); val = tmp___0; mutex_lock(& data->update_lock); tmp___1 = SENSORS_LIMIT(val < 0 ? (val - 500) / 1000 : (val + 500) / 1000, -128, 127); data->temp_high[nr] = tmp___1; it87_write_value(data, 64 + nr * 2, data->temp_high[nr]); mutex_unlock(& data->update_lock); return (count); } } static ssize_t set_temp_min(struct device *dev , struct device_attribute *attr , char const *buf , size_t count ) { struct sensor_device_attribute *sensor_attr ; struct device_attribute const *__mptr ; int nr ; struct it87_data *data ; void *tmp ; int val ; long tmp___0 ; int tmp___1 ; { __mptr = attr; sensor_attr = (struct sensor_device_attribute *)((char *)__mptr - (unsigned int )(& ((struct sensor_device_attribute *)0)->dev_attr)); nr = sensor_attr->index; tmp = dev_get_drvdata(dev); data = tmp; tmp___0 = simple_strtol(buf, (void *)0, 10); val = tmp___0; mutex_lock(& data->update_lock); tmp___1 = SENSORS_LIMIT(val < 0 ? (val - 500) / 1000 : (val + 500) / 1000, -128, 127); data->temp_low[nr] = tmp___1; it87_write_value(data, 65 + nr * 2, data->temp_low[nr]); mutex_unlock(& data->update_lock); return (count); } } static struct sensor_device_attribute sensor_dev_attr_temp1_input = {{{"temp1_input", 0, (256 | 32) | 4}, & show_temp, (void *)0}, 1 - 1}; static struct sensor_device_attribute sensor_dev_attr_temp1_max = {{{"temp1_max", 0, ((256 | 32) | 4) | 128}, & show_temp_max, & set_temp_max}, 1 - 1}; static struct sensor_device_attribute sensor_dev_attr_temp1_min = {{{"temp1_min", 0, ((256 | 32) | 4) | 128}, & show_temp_min, & set_temp_min}, 1 - 1}; static struct sensor_device_attribute sensor_dev_attr_temp2_input = {{{"temp2_input", 0, (256 | 32) | 4}, & show_temp, (void *)0}, 2 - 1}; static struct sensor_device_attribute sensor_dev_attr_temp2_max = {{{"temp2_max", 0, ((256 | 32) | 4) | 128}, & show_temp_max, & set_temp_max}, 2 - 1}; static struct sensor_device_attribute sensor_dev_attr_temp2_min = {{{"temp2_min", 0, ((256 | 32) | 4) | 128}, & show_temp_min, & set_temp_min}, 2 - 1}; static struct sensor_device_attribute sensor_dev_attr_temp3_input = {{{"temp3_input", 0, (256 | 32) | 4}, & show_temp, (void *)0}, 3 - 1}; static struct sensor_device_attribute sensor_dev_attr_temp3_max = {{{"temp3_max", 0, ((256 | 32) | 4) | 128}, & show_temp_max, & set_temp_max}, 3 - 1}; static struct sensor_device_attribute sensor_dev_attr_temp3_min = {{{"temp3_min", 0, ((256 | 32) | 4) | 128}, & show_temp_min, & set_temp_min}, 3 - 1}; static ssize_t show_sensor(struct device *dev , struct device_attribute *attr , char *buf ) { struct sensor_device_attribute *sensor_attr ; struct device_attribute const *__mptr ; int nr ; struct it87_data *data ; struct it87_data *tmp ; u8 reg ; int tmp___0 ; int tmp___1 ; int tmp___2 ; { __mptr = attr; sensor_attr = (struct sensor_device_attribute *)((char *)__mptr - (unsigned int )(& ((struct sensor_device_attribute *)0)->dev_attr)); nr = sensor_attr->index; tmp = it87_update_device(dev); data = tmp; reg = data->sensor; if ((int )reg & (1 << nr)) { tmp___0 = sprintf(buf, "3\n"); return (tmp___0); } else { } if ((int )reg & (8 << nr)) { tmp___1 = sprintf(buf, "2\n"); return (tmp___1); } else { } tmp___2 = sprintf(buf, "0\n"); return (tmp___2); } } static ssize_t set_sensor(struct device *dev , struct device_attribute *attr , char const *buf , size_t count ) { struct sensor_device_attribute *sensor_attr ; struct device_attribute const *__mptr ; int nr ; struct it87_data *data ; void *tmp ; int val ; long tmp___0 ; { __mptr = attr; sensor_attr = (struct sensor_device_attribute *)((char *)__mptr - (unsigned int )(& ((struct sensor_device_attribute *)0)->dev_attr)); nr = sensor_attr->index; tmp = dev_get_drvdata(dev); data = tmp; tmp___0 = simple_strtol(buf, (void *)0, 10); val = tmp___0; mutex_lock(& data->update_lock); data->sensor = (int )data->sensor & ~ (1 << nr); data->sensor = (int )data->sensor & ~ (8 << nr); if (val == 3) { data->sensor = (int )data->sensor | (1 << nr); } else if (val == 2) { data->sensor = (int )data->sensor | (8 << nr); } else if (val != 0) { mutex_unlock(& data->update_lock); return (-22); } else { } it87_write_value(data, 81, data->sensor); mutex_unlock(& data->update_lock); return (count); } } static struct sensor_device_attribute sensor_dev_attr_temp1_type = {{{"temp1_type", 0, ((256 | 32) | 4) | 128}, & show_sensor, & set_sensor}, 1 - 1}; static struct sensor_device_attribute sensor_dev_attr_temp2_type = {{{"temp2_type", 0, ((256 | 32) | 4) | 128}, & show_sensor, & set_sensor}, 2 - 1}; static struct sensor_device_attribute sensor_dev_attr_temp3_type = {{{"temp3_type", 0, ((256 | 32) | 4) | 128}, & show_sensor, & set_sensor}, 3 - 1}; static ssize_t show_fan(struct device *dev , struct device_attribute *attr , char *buf ) { struct sensor_device_attribute *sensor_attr ; struct device_attribute const *__mptr ; int nr ; struct it87_data *data ; struct it87_data *tmp ; int tmp___0 ; { __mptr = attr; sensor_attr = (struct sensor_device_attribute *)((char *)__mptr - (unsigned int )(& ((struct sensor_device_attribute *)0)->dev_attr)); nr = sensor_attr->index; tmp = it87_update_device(dev); data = tmp; tmp___0 = sprintf(buf, "%d\n", (int )data->fan[nr] == 0 ? -1 : ((int )data->fan[nr] == 255 ? 0 : 1350000 / ((int )data->fan[nr] * (1 << (int )data->fan_div[nr])))); return (tmp___0); } } static ssize_t show_fan_min(struct device *dev , struct device_attribute *attr , char *buf ) { struct sensor_device_attribute *sensor_attr ; struct device_attribute const *__mptr ; int nr ; struct it87_data *data ; struct it87_data *tmp ; int tmp___0 ; { __mptr = attr; sensor_attr = (struct sensor_device_attribute *)((char *)__mptr - (unsigned int )(& ((struct sensor_device_attribute *)0)->dev_attr)); nr = sensor_attr->index; tmp = it87_update_device(dev); data = tmp; tmp___0 = sprintf(buf, "%d\n", (int )data->fan_min[nr] == 0 ? -1 : ((int )data->fan_min[nr] == 255 ? 0 : 1350000 / ((int )data->fan_min[nr] * (1 << (int )data->fan_div[nr])))); return (tmp___0); } } static ssize_t show_fan_div(struct device *dev , struct device_attribute *attr , char *buf ) { struct sensor_device_attribute *sensor_attr ; struct device_attribute const *__mptr ; int nr ; struct it87_data *data ; struct it87_data *tmp ; int tmp___0 ; { __mptr = attr; sensor_attr = (struct sensor_device_attribute *)((char *)__mptr - (unsigned int )(& ((struct sensor_device_attribute *)0)->dev_attr)); nr = sensor_attr->index; tmp = it87_update_device(dev); data = tmp; tmp___0 = sprintf(buf, "%d\n", 1 << (int )data->fan_div[nr]); return (tmp___0); } } static ssize_t show_pwm_enable(struct device *dev , struct device_attribute *attr , char *buf ) { struct sensor_device_attribute *sensor_attr ; struct device_attribute const *__mptr ; int nr ; struct it87_data *data ; struct it87_data *tmp ; int tmp___0 ; { __mptr = attr; sensor_attr = (struct sensor_device_attribute *)((char *)__mptr - (unsigned int )(& ((struct sensor_device_attribute *)0)->dev_attr)); nr = sensor_attr->index; tmp = it87_update_device(dev); data = tmp; tmp___0 = sprintf(buf, "%d\n", (int )data->fan_main_ctrl & (1 << nr) ? 1 : 0); return (tmp___0); } } static ssize_t show_pwm(struct device *dev , struct device_attribute *attr , char *buf ) { struct sensor_device_attribute *sensor_attr ; struct device_attribute const *__mptr ; int nr ; struct it87_data *data ; struct it87_data *tmp ; int tmp___0 ; { __mptr = attr; sensor_attr = (struct sensor_device_attribute *)((char *)__mptr - (unsigned int )(& ((struct sensor_device_attribute *)0)->dev_attr)); nr = sensor_attr->index; tmp = it87_update_device(dev); data = tmp; tmp___0 = sprintf(buf, "%d\n", data->manual_pwm_ctl[nr]); return (tmp___0); } } static ssize_t show_pwm_freq(struct device *dev , struct device_attribute *attr , char *buf ) { struct it87_data *data ; struct it87_data *tmp ; int index ; int tmp___0 ; { tmp = it87_update_device(dev); data = tmp; index = ((int )data->fan_ctl >> 4) & 7; tmp___0 = sprintf(buf, "%u\n", pwm_freq[index]); return (tmp___0); } } static ssize_t set_fan_min(struct device *dev , struct device_attribute *attr , char const *buf , size_t count ) { struct sensor_device_attribute *sensor_attr ; struct device_attribute const *__mptr ; int nr ; struct it87_data *data ; void *tmp ; int val ; long tmp___0 ; u8 reg ; int tmp___1 ; u8 tmp___2 ; { __mptr = attr; sensor_attr = (struct sensor_device_attribute *)((char *)__mptr - (unsigned int )(& ((struct sensor_device_attribute *)0)->dev_attr)); nr = sensor_attr->index; tmp = dev_get_drvdata(dev); data = tmp; tmp___0 = simple_strtol(buf, (void *)0, 10); val = tmp___0; mutex_lock(& data->update_lock); tmp___1 = it87_read_value(data, 11); reg = tmp___1; switch (nr) { case 0: data->fan_div[nr] = (int )reg & 7; break; case 1: data->fan_div[nr] = ((int )reg >> 3) & 7; break; case 2: data->fan_div[nr] = (int )reg & 64 ? 3 : 1; break; } tmp___2 = FAN_TO_REG(val, 1 << (int )data->fan_div[nr]); data->fan_min[nr] = tmp___2; it87_write_value(data, IT87_REG_FAN_MIN[nr], data->fan_min[nr]); mutex_unlock(& data->update_lock); return (count); } } static ssize_t set_fan_div(struct device *dev , struct device_attribute *attr , char const *buf , size_t count ) { struct sensor_device_attribute *sensor_attr ; struct device_attribute const *__mptr ; int nr ; struct it87_data *data ; void *tmp ; unsigned long val ; unsigned long tmp___0 ; int min ; u8 old ; int tmp___1 ; int tmp___2 ; u8 tmp___3 ; { __mptr = attr; sensor_attr = (struct sensor_device_attribute *)((char *)__mptr - (unsigned int )(& ((struct sensor_device_attribute *)0)->dev_attr)); nr = sensor_attr->index; tmp = dev_get_drvdata(dev); data = tmp; tmp___0 = simple_strtoul(buf, (void *)0, 10); val = tmp___0; mutex_lock(& data->update_lock); tmp___1 = it87_read_value(data, 11); old = tmp___1; min = (int )data->fan_min[nr] == 0 ? -1 : ((int )data->fan_min[nr] == 255 ? 0 : 1350000 / ((int )data->fan_min[nr] * (1 << (int )data->fan_div[nr]))); switch (nr) { case 1: case 0: tmp___2 = DIV_TO_REG(val); data->fan_div[nr] = tmp___2; break; case 2: if (val < 8UL) { data->fan_div[nr] = 1; } else { data->fan_div[nr] = 3; } } val = (int )old & 128; val = val | (unsigned long )((int )data->fan_div[0] & 7); val = val | (unsigned long )(((int )data->fan_div[1] & 7) << 3); if ((int )data->fan_div[2] == 3) { val = val | (unsigned long )(1 << 6); } else { } it87_write_value(data, 11, val); tmp___3 = FAN_TO_REG(min, 1 << (int )data->fan_div[nr]); data->fan_min[nr] = tmp___3; it87_write_value(data, IT87_REG_FAN_MIN[nr], data->fan_min[nr]); mutex_unlock(& data->update_lock); return (count); } } static ssize_t set_pwm_enable(struct device *dev , struct device_attribute *attr , char const *buf , size_t count ) { struct sensor_device_attribute *sensor_attr ; struct device_attribute const *__mptr ; int nr ; struct it87_data *data ; void *tmp ; int val ; long tmp___0 ; int tmp___1 ; { __mptr = attr; sensor_attr = (struct sensor_device_attribute *)((char *)__mptr - (unsigned int )(& ((struct sensor_device_attribute *)0)->dev_attr)); nr = sensor_attr->index; tmp = dev_get_drvdata(dev); data = tmp; tmp___0 = simple_strtol(buf, (void *)0, 10); val = tmp___0; mutex_lock(& data->update_lock); if (val == 0) { tmp___1 = it87_read_value(data, 20); it87_write_value(data, 20, tmp___1 | (1 << nr)); data->fan_main_ctrl = (int )data->fan_main_ctrl & ~ (1 << nr); it87_write_value(data, 19, data->fan_main_ctrl); } else if (val == 1) { data->fan_main_ctrl = (int )data->fan_main_ctrl | (1 << nr); it87_write_value(data, 19, data->fan_main_ctrl); it87_write_value(data, 21 + nr, (int )data->manual_pwm_ctl[nr] >> 1); } else { mutex_unlock(& data->update_lock); return (-22); } mutex_unlock(& data->update_lock); return (count); } } static ssize_t set_pwm(struct device *dev , struct device_attribute *attr , char const *buf , size_t count ) { struct sensor_device_attribute *sensor_attr ; struct device_attribute const *__mptr ; int nr ; struct it87_data *data ; void *tmp ; int val ; long tmp___0 ; { __mptr = attr; sensor_attr = (struct sensor_device_attribute *)((char *)__mptr - (unsigned int )(& ((struct sensor_device_attribute *)0)->dev_attr)); nr = sensor_attr->index; tmp = dev_get_drvdata(dev); data = tmp; tmp___0 = simple_strtol(buf, (void *)0, 10); val = tmp___0; if (val < 0 || val > 255) { return (-22); } else { } mutex_lock(& data->update_lock); data->manual_pwm_ctl[nr] = val; if ((int )data->fan_main_ctrl & (1 << nr)) { it87_write_value(data, 21 + nr, (int )data->manual_pwm_ctl[nr] >> 1); } else { } mutex_unlock(& data->update_lock); return (count); } } static ssize_t set_pwm_freq(struct device *dev , struct device_attribute *attr , char const *buf , size_t count ) { struct it87_data *data ; void *tmp ; unsigned long val ; unsigned long tmp___0 ; int i ; int tmp___1 ; { tmp = dev_get_drvdata(dev); data = tmp; tmp___0 = simple_strtoul(buf, (void *)0, 10); val = tmp___0; i = 0; while (1) { if (i < 7) { } else { break; } if (val > (unsigned long )((pwm_freq[i] + pwm_freq[i + 1]) / (unsigned int const )2)) { break; } else { } i = i + 1; } mutex_lock(& data->update_lock); tmp___1 = it87_read_value(data, 20); data->fan_ctl = tmp___1 & 143; data->fan_ctl = (int )data->fan_ctl | (i << 4); it87_write_value(data, 20, data->fan_ctl); mutex_unlock(& data->update_lock); return (count); } } static struct sensor_device_attribute sensor_dev_attr_fan1_input = {{{"fan1_input", 0, (256 | 32) | 4}, & show_fan, (void *)0}, 1 - 1}; static struct sensor_device_attribute sensor_dev_attr_fan1_min = {{{"fan1_min", 0, ((256 | 32) | 4) | 128}, & show_fan_min, & set_fan_min}, 1 - 1}; static struct sensor_device_attribute sensor_dev_attr_fan1_div = {{{"fan1_div", 0, ((256 | 32) | 4) | 128}, & show_fan_div, & set_fan_div}, 1 - 1}; static struct sensor_device_attribute sensor_dev_attr_fan2_input = {{{"fan2_input", 0, (256 | 32) | 4}, & show_fan, (void *)0}, 2 - 1}; static struct sensor_device_attribute sensor_dev_attr_fan2_min = {{{"fan2_min", 0, ((256 | 32) | 4) | 128}, & show_fan_min, & set_fan_min}, 2 - 1}; static struct sensor_device_attribute sensor_dev_attr_fan2_div = {{{"fan2_div", 0, ((256 | 32) | 4) | 128}, & show_fan_div, & set_fan_div}, 2 - 1}; static struct sensor_device_attribute sensor_dev_attr_fan3_input = {{{"fan3_input", 0, (256 | 32) | 4}, & show_fan, (void *)0}, 3 - 1}; static struct sensor_device_attribute sensor_dev_attr_fan3_min = {{{"fan3_min", 0, ((256 | 32) | 4) | 128}, & show_fan_min, & set_fan_min}, 3 - 1}; static struct sensor_device_attribute sensor_dev_attr_fan3_div = {{{"fan3_div", 0, ((256 | 32) | 4) | 128}, & show_fan_div, & set_fan_div}, 3 - 1}; static struct sensor_device_attribute sensor_dev_attr_pwm1_enable = {{{"pwm1_enable", 0, ((256 | 32) | 4) | 128}, & show_pwm_enable, & set_pwm_enable}, 1 - 1}; static struct sensor_device_attribute sensor_dev_attr_pwm1 = {{{"pwm1", 0, ((256 | 32) | 4) | 128}, & show_pwm, & set_pwm}, 1 - 1}; static struct device_attribute dev_attr_pwm1_freq = {{"pwm1_freq", 0, 1 == 1 ? ((256 | 32) | 4) | 128 : (256 | 32) | 4}, & show_pwm_freq, 1 == 1 ? & set_pwm_freq : (void *)0}; static struct sensor_device_attribute sensor_dev_attr_pwm2_enable = {{{"pwm2_enable", 0, ((256 | 32) | 4) | 128}, & show_pwm_enable, & set_pwm_enable}, 2 - 1}; static struct sensor_device_attribute sensor_dev_attr_pwm2 = {{{"pwm2", 0, ((256 | 32) | 4) | 128}, & show_pwm, & set_pwm}, 2 - 1}; static struct device_attribute dev_attr_pwm2_freq = {{"pwm2_freq", 0, 2 == 1 ? ((256 | 32) | 4) | 128 : (256 | 32) | 4}, & show_pwm_freq, 2 == 1 ? & set_pwm_freq : (void *)0}; static struct sensor_device_attribute sensor_dev_attr_pwm3_enable = {{{"pwm3_enable", 0, ((256 | 32) | 4) | 128}, & show_pwm_enable, & set_pwm_enable}, 3 - 1}; static struct sensor_device_attribute sensor_dev_attr_pwm3 = {{{"pwm3", 0, ((256 | 32) | 4) | 128}, & show_pwm, & set_pwm}, 3 - 1}; static struct device_attribute dev_attr_pwm3_freq = {{"pwm3_freq", 0, 3 == 1 ? ((256 | 32) | 4) | 128 : (256 | 32) | 4}, & show_pwm_freq, 3 == 1 ? & set_pwm_freq : (void *)0}; static ssize_t show_fan16(struct device *dev , struct device_attribute *attr , char *buf ) { struct sensor_device_attribute *sensor_attr ; struct device_attribute const *__mptr ; int nr ; struct it87_data *data ; struct it87_data *tmp ; int tmp___0 ; { __mptr = attr; sensor_attr = (struct sensor_device_attribute *)((char *)__mptr - (unsigned int )(& ((struct sensor_device_attribute *)0)->dev_attr)); nr = sensor_attr->index; tmp = it87_update_device(dev); data = tmp; tmp___0 = sprintf(buf, "%d\n", (int )data->fan[nr] == 0 ? -1 : ((int )data->fan[nr] == 65535 ? 0 : 1350000 / ((int )data->fan[nr] * 2))); return (tmp___0); } } static ssize_t show_fan16_min(struct device *dev , struct device_attribute *attr , char *buf ) { struct sensor_device_attribute *sensor_attr ; struct device_attribute const *__mptr ; int nr ; struct it87_data *data ; struct it87_data *tmp ; int tmp___0 ; { __mptr = attr; sensor_attr = (struct sensor_device_attribute *)((char *)__mptr - (unsigned int )(& ((struct sensor_device_attribute *)0)->dev_attr)); nr = sensor_attr->index; tmp = it87_update_device(dev); data = tmp; tmp___0 = sprintf(buf, "%d\n", (int )data->fan_min[nr] == 0 ? -1 : ((int )data->fan_min[nr] == 65535 ? 0 : 1350000 / ((int )data->fan_min[nr] * 2))); return (tmp___0); } } static ssize_t set_fan16_min(struct device *dev , struct device_attribute *attr , char const *buf , size_t count ) { struct sensor_device_attribute *sensor_attr ; struct device_attribute const *__mptr ; int nr ; struct it87_data *data ; void *tmp ; int val ; long tmp___0 ; { __mptr = attr; sensor_attr = (struct sensor_device_attribute *)((char *)__mptr - (unsigned int )(& ((struct sensor_device_attribute *)0)->dev_attr)); nr = sensor_attr->index; tmp = dev_get_drvdata(dev); data = tmp; tmp___0 = simple_strtol(buf, (void *)0, 10); val = tmp___0; mutex_lock(& data->update_lock); data->fan_min[nr] = FAN16_TO_REG(val); it87_write_value(data, IT87_REG_FAN_MIN[nr], (int )data->fan_min[nr] & 255); it87_write_value(data, IT87_REG_FANX_MIN[nr], (int )data->fan_min[nr] >> 8); mutex_unlock(& data->update_lock); return (count); } } static struct sensor_device_attribute sensor_dev_attr_fan1_input16 = {{{"fan1_input", 0, (256 | 32) | 4}, & show_fan16, (void *)0}, 1 - 1}; static struct sensor_device_attribute sensor_dev_attr_fan1_min16 = {{{"fan1_min", 0, ((256 | 32) | 4) | 128}, & show_fan16_min, & set_fan16_min}, 1 - 1}; static struct sensor_device_attribute sensor_dev_attr_fan2_input16 = {{{"fan2_input", 0, (256 | 32) | 4}, & show_fan16, (void *)0}, 2 - 1}; static struct sensor_device_attribute sensor_dev_attr_fan2_min16 = {{{"fan2_min", 0, ((256 | 32) | 4) | 128}, & show_fan16_min, & set_fan16_min}, 2 - 1}; static struct sensor_device_attribute sensor_dev_attr_fan3_input16 = {{{"fan3_input", 0, (256 | 32) | 4}, & show_fan16, (void *)0}, 3 - 1}; static struct sensor_device_attribute sensor_dev_attr_fan3_min16 = {{{"fan3_min", 0, ((256 | 32) | 4) | 128}, & show_fan16_min, & set_fan16_min}, 3 - 1}; static struct sensor_device_attribute sensor_dev_attr_fan4_input16 = {{{"fan4_input", 0, (256 | 32) | 4}, & show_fan16, (void *)0}, 4 - 1}; static struct sensor_device_attribute sensor_dev_attr_fan4_min16 = {{{"fan4_min", 0, ((256 | 32) | 4) | 128}, & show_fan16_min, & set_fan16_min}, 4 - 1}; static struct sensor_device_attribute sensor_dev_attr_fan5_input16 = {{{"fan5_input", 0, (256 | 32) | 4}, & show_fan16, (void *)0}, 5 - 1}; static struct sensor_device_attribute sensor_dev_attr_fan5_min16 = {{{"fan5_min", 0, ((256 | 32) | 4) | 128}, & show_fan16_min, & set_fan16_min}, 5 - 1}; static ssize_t show_alarms(struct device *dev , struct device_attribute *attr , char *buf ) { struct it87_data *data ; struct it87_data *tmp ; int tmp___0 ; { tmp = it87_update_device(dev); data = tmp; tmp___0 = sprintf(buf, "%u\n", data->alarms); return (tmp___0); } } static struct device_attribute dev_attr_alarms = {{"alarms", 0, (256 | 32) | 4}, & show_alarms, (void *)0}; static ssize_t show_vrm_reg(struct device *dev , struct device_attribute *attr , char *buf ) { struct it87_data *data ; void *tmp ; int tmp___0 ; { tmp = dev_get_drvdata(dev); data = tmp; tmp___0 = sprintf(buf, "%u\n", data->vrm); return (tmp___0); } } static ssize_t store_vrm_reg(struct device *dev , struct device_attribute *attr , char const *buf , size_t count ) { struct it87_data *data ; void *tmp ; u32 val ; unsigned long tmp___0 ; { tmp = dev_get_drvdata(dev); data = tmp; tmp___0 = simple_strtoul(buf, (void *)0, 10); val = tmp___0; data->vrm = val; return (count); } } static struct device_attribute dev_attr_vrm = {{"vrm", 0, ((256 | 32) | 4) | 128}, & show_vrm_reg, & store_vrm_reg}; static ssize_t show_vid_reg(struct device *dev , struct device_attribute *attr , char *buf ) { struct it87_data *data ; struct it87_data *tmp ; int tmp___0 ; int tmp___1 ; { tmp = it87_update_device(dev); data = tmp; tmp___0 = vid_from_reg(data->vid, data->vrm); tmp___1 = sprintf(buf, "%ld\n", (long )tmp___0); return (tmp___1); } } static struct device_attribute dev_attr_cpu0_vid = {{"cpu0_vid", 0, (256 | 32) | 4}, & show_vid_reg, (void *)0}; static ssize_t show_name(struct device *dev , struct device_attribute *devattr , char *buf ) { struct it87_data *data ; void *tmp ; int tmp___0 ; { tmp = dev_get_drvdata(dev); data = tmp; tmp___0 = sprintf(buf, "%s\n", data->name); return (tmp___0); } } static struct device_attribute dev_attr_name = {{"name", 0, (256 | 32) | 4}, & show_name, (void *)0}; static struct attribute *it87_attributes[40] = { & sensor_dev_attr_in0_input.dev_attr.attr, & sensor_dev_attr_in1_input.dev_attr.attr, & sensor_dev_attr_in2_input.dev_attr.attr, & sensor_dev_attr_in3_input.dev_attr.attr, & sensor_dev_attr_in4_input.dev_attr.attr, & sensor_dev_attr_in5_input.dev_attr.attr, & sensor_dev_attr_in6_input.dev_attr.attr, & sensor_dev_attr_in7_input.dev_attr.attr, & sensor_dev_attr_in8_input.dev_attr.attr, & sensor_dev_attr_in0_min.dev_attr.attr, & sensor_dev_attr_in1_min.dev_attr.attr, & sensor_dev_attr_in2_min.dev_attr.attr, & sensor_dev_attr_in3_min.dev_attr.attr, & sensor_dev_attr_in4_min.dev_attr.attr, & sensor_dev_attr_in5_min.dev_attr.attr, & sensor_dev_attr_in6_min.dev_attr.attr, & sensor_dev_attr_in7_min.dev_attr.attr, & sensor_dev_attr_in0_max.dev_attr.attr, & sensor_dev_attr_in1_max.dev_attr.attr, & sensor_dev_attr_in2_max.dev_attr.attr, & sensor_dev_attr_in3_max.dev_attr.attr, & sensor_dev_attr_in4_max.dev_attr.attr, & sensor_dev_attr_in5_max.dev_attr.attr, & sensor_dev_attr_in6_max.dev_attr.attr, & sensor_dev_attr_in7_max.dev_attr.attr, & sensor_dev_attr_temp1_input.dev_attr.attr, & sensor_dev_attr_temp2_input.dev_attr.attr, & sensor_dev_attr_temp3_input.dev_attr.attr, & sensor_dev_attr_temp1_max.dev_attr.attr, & sensor_dev_attr_temp2_max.dev_attr.attr, & sensor_dev_attr_temp3_max.dev_attr.attr, & sensor_dev_attr_temp1_min.dev_attr.attr, & sensor_dev_attr_temp2_min.dev_attr.attr, & sensor_dev_attr_temp3_min.dev_attr.attr, & sensor_dev_attr_temp1_type.dev_attr.attr, & sensor_dev_attr_temp2_type.dev_attr.attr, & sensor_dev_attr_temp3_type.dev_attr.attr, & dev_attr_alarms.attr, & dev_attr_name.attr, (void *)0}; static struct attribute_group const it87_group = {0, 0, it87_attributes}; static struct attribute *it87_attributes_opt[28] = { & sensor_dev_attr_fan1_input16.dev_attr.attr, & sensor_dev_attr_fan1_min16.dev_attr.attr, & sensor_dev_attr_fan2_input16.dev_attr.attr, & sensor_dev_attr_fan2_min16.dev_attr.attr, & sensor_dev_attr_fan3_input16.dev_attr.attr, & sensor_dev_attr_fan3_min16.dev_attr.attr, & sensor_dev_attr_fan4_input16.dev_attr.attr, & sensor_dev_attr_fan4_min16.dev_attr.attr, & sensor_dev_attr_fan5_input16.dev_attr.attr, & sensor_dev_attr_fan5_min16.dev_attr.attr, & sensor_dev_attr_fan1_input.dev_attr.attr, & sensor_dev_attr_fan1_min.dev_attr.attr, & sensor_dev_attr_fan1_div.dev_attr.attr, & sensor_dev_attr_fan2_input.dev_attr.attr, & sensor_dev_attr_fan2_min.dev_attr.attr, & sensor_dev_attr_fan2_div.dev_attr.attr, & sensor_dev_attr_fan3_input.dev_attr.attr, & sensor_dev_attr_fan3_min.dev_attr.attr, & sensor_dev_attr_fan3_div.dev_attr.attr, & sensor_dev_attr_pwm1_enable.dev_attr.attr, & sensor_dev_attr_pwm2_enable.dev_attr.attr, & sensor_dev_attr_pwm3_enable.dev_attr.attr, & sensor_dev_attr_pwm1.dev_attr.attr, & sensor_dev_attr_pwm2.dev_attr.attr, & sensor_dev_attr_pwm3.dev_attr.attr, & dev_attr_vrm.attr, & dev_attr_cpu0_vid.attr, (void *)0}; static struct attribute_group const it87_group_opt = {0, 0, it87_attributes_opt}; static int it87_find(unsigned short *address , struct it87_sio_data *sio_data ) __attribute__((__section__(".init.text"))) ; static int it87_find(unsigned short *address , struct it87_sio_data *sio_data ) { int err ; u16 chip_type ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int reg ; int tmp___3 ; { err = -19; superio_enter(); if (force_id) { chip_type = force_id; } else { tmp = superio_inw(32); chip_type = tmp; } switch ((int )chip_type) { case 34565: sio_data->type = it87; break; case 34578: sio_data->type = it8712; break; case 34598: case 34582: sio_data->type = it8716; break; case 34584: sio_data->type = it8718; break; case 65535: goto exit; default: printk("<7>it87: Unsupported chip (DEVID=0x%x)\n", chip_type); goto exit; } superio_select(4); tmp___0 = superio_inb(48); if (tmp___0 & 1) { } else { printk("<6>it87: Device not activated, skipping\n"); goto exit; } tmp___1 = superio_inw(96); *address = tmp___1 & ~ (8 - 1); if ((int )*address == 0) { printk("<6>it87: Base address not set, skipping\n"); goto exit; } else { } err = 0; tmp___2 = superio_inb(34); printk("<6>it87: Found IT%04xF chip at 0x%x, revision %d\n", chip_type, *address, tmp___2 & 15); if ((int )chip_type != 34565) { superio_select(7); if ((int )chip_type == it8718) { tmp___3 = superio_inb(252); sio_data->vid_value = tmp___3; } else { } reg = superio_inb(44); if (reg & (1 << 0)) { printk("<6>it87: in3 is VCC (+5V)\n"); } else { } if (reg & (1 << 1)) { printk("<6>it87: in7 is VCCH (+5V Stand-By)\n"); } else { } } else { } exit: superio_exit(); return (err); } } static char const *names[4] = { "it87", "it8712", "it8716", "it8718"}; static struct lock_class_key __key ; static int it87_probe(struct platform_device *pdev___0 ) __attribute__((__section__(".devinit.text"))) ; static int it87_probe(struct platform_device *pdev___0 ) { struct it87_data *data ; struct resource *res ; struct device *dev ; struct it87_sio_data *sio_data ; int err ; int enable_pwm_interface ; char const *tmp ; struct resource *tmp___0 ; void *tmp___1 ; int tmp___2 ; int tmp___3 ; long tmp___4 ; long tmp___5 ; { dev = & pdev___0->dev; sio_data = dev->platform_data; err = 0; res = platform_get_resource(pdev___0, 256, 0); tmp___0 = __request_region(& ioport_resource, res->start, 2, "it87"); if (tmp___0) { } else { tmp = dev_driver_string(dev); printk("<3>%s %s: Failed to request region 0x%lx-0x%lx\n", tmp, dev->bus_id, (unsigned long )res->start, (unsigned long )((res->start + (resource_size_t )2) - (resource_size_t )1)); err = -16; goto ERROR0; } tmp___1 = kzalloc(sizeof(struct it87_data ), (16U | 64U) | 128U); data = tmp___1; if (data) { } else { err = -12; goto ERROR1; } data->addr = res->start; data->type = sio_data->type; data->name = names[sio_data->type]; tmp___2 = it87_read_value(data, 0); if (tmp___2 & 128) { err = -19; goto ERROR2; } else { tmp___3 = it87_read_value(data, 88); if (tmp___3 != 144) { err = -19; goto ERROR2; } else { } } dev_set_drvdata(& pdev___0->dev, data); while (1) { __mutex_init(& data->update_lock, "&data->update_lock", & __key); break; } enable_pwm_interface = it87_check_pwm(dev); it87_init_device(pdev___0); err = sysfs_create_group(& dev->kobj, & it87_group); if (err) { goto ERROR2; } else { } if ((unsigned int )data->type == (unsigned int )it8716 || (unsigned int )data->type == (unsigned int )it8718) { if ((int )data->has_fan & (1 << 0)) { err = device_create_file(dev, & sensor_dev_attr_fan1_input16.dev_attr); if (err) { goto ERROR4; } else { err = device_create_file(dev, & sensor_dev_attr_fan1_min16.dev_attr); if (err) { goto ERROR4; } else { } } } else { } if ((int )data->has_fan & (1 << 1)) { err = device_create_file(dev, & sensor_dev_attr_fan2_input16.dev_attr); if (err) { goto ERROR4; } else { err = device_create_file(dev, & sensor_dev_attr_fan2_min16.dev_attr); if (err) { goto ERROR4; } else { } } } else { } if ((int )data->has_fan & (1 << 2)) { err = device_create_file(dev, & sensor_dev_attr_fan3_input16.dev_attr); if (err) { goto ERROR4; } else { err = device_create_file(dev, & sensor_dev_attr_fan3_min16.dev_attr); if (err) { goto ERROR4; } else { } } } else { } if ((int )data->has_fan & (1 << 3)) { err = device_create_file(dev, & sensor_dev_attr_fan4_input16.dev_attr); if (err) { goto ERROR4; } else { err = device_create_file(dev, & sensor_dev_attr_fan4_min16.dev_attr); if (err) { goto ERROR4; } else { } } } else { } if ((int )data->has_fan & (1 << 4)) { err = device_create_file(dev, & sensor_dev_attr_fan5_input16.dev_attr); if (err) { goto ERROR4; } else { err = device_create_file(dev, & sensor_dev_attr_fan5_min16.dev_attr); if (err) { goto ERROR4; } else { } } } else { } } else { if ((int )data->has_fan & (1 << 0)) { err = device_create_file(dev, & sensor_dev_attr_fan1_input.dev_attr); if (err) { goto ERROR4; } else { err = device_create_file(dev, & sensor_dev_attr_fan1_min.dev_attr); if (err) { goto ERROR4; } else { err = device_create_file(dev, & sensor_dev_attr_fan1_div.dev_attr); if (err) { goto ERROR4; } else { } } } } else { } if ((int )data->has_fan & (1 << 1)) { err = device_create_file(dev, & sensor_dev_attr_fan2_input.dev_attr); if (err) { goto ERROR4; } else { err = device_create_file(dev, & sensor_dev_attr_fan2_min.dev_attr); if (err) { goto ERROR4; } else { err = device_create_file(dev, & sensor_dev_attr_fan2_div.dev_attr); if (err) { goto ERROR4; } else { } } } } else { } if ((int )data->has_fan & (1 << 2)) { err = device_create_file(dev, & sensor_dev_attr_fan3_input.dev_attr); if (err) { goto ERROR4; } else { err = device_create_file(dev, & sensor_dev_attr_fan3_min.dev_attr); if (err) { goto ERROR4; } else { err = device_create_file(dev, & sensor_dev_attr_fan3_div.dev_attr); if (err) { goto ERROR4; } else { } } } } else { } } if (enable_pwm_interface) { err = device_create_file(dev, & sensor_dev_attr_pwm1_enable.dev_attr); if (err) { goto ERROR4; } else { err = device_create_file(dev, & sensor_dev_attr_pwm2_enable.dev_attr); if (err) { goto ERROR4; } else { err = device_create_file(dev, & sensor_dev_attr_pwm3_enable.dev_attr); if (err) { goto ERROR4; } else { err = device_create_file(dev, & sensor_dev_attr_pwm1.dev_attr); if (err) { goto ERROR4; } else { err = device_create_file(dev, & sensor_dev_attr_pwm2.dev_attr); if (err) { goto ERROR4; } else { err = device_create_file(dev, & sensor_dev_attr_pwm3.dev_attr); if (err) { goto ERROR4; } else { err = device_create_file(dev, & dev_attr_pwm1_freq); if (err) { goto ERROR4; } else { err = device_create_file(dev, & dev_attr_pwm2_freq); if (err) { goto ERROR4; } else { err = device_create_file(dev, & dev_attr_pwm3_freq); if (err) { goto ERROR4; } else { } } } } } } } } } } else { } if (((unsigned int )data->type == (unsigned int )it8712 || (unsigned int )data->type == (unsigned int )it8716) || (unsigned int )data->type == (unsigned int )it8718) { data->vrm = vid_which_vrm(); data->vid = sio_data->vid_value; err = device_create_file(dev, & dev_attr_vrm); if (err) { goto ERROR4; } else { err = device_create_file(dev, & dev_attr_cpu0_vid); if (err) { goto ERROR4; } else { } } } else { } data->hwmon_dev = hwmon_device_register(dev); tmp___5 = IS_ERR(data->hwmon_dev); if (tmp___5) { tmp___4 = PTR_ERR(data->hwmon_dev); err = tmp___4; goto ERROR4; } else { } return (0); ERROR4: sysfs_remove_group(& dev->kobj, & it87_group); sysfs_remove_group(& dev->kobj, & it87_group_opt); ERROR2: dev_set_drvdata(& pdev___0->dev, (void *)0); kfree(data); ERROR1: __release_region(& ioport_resource, res->start, 2); ERROR0: return (err); } } static int it87_remove(struct platform_device *pdev___0 ) __attribute__((__section__(".devexit.text"))) ; static int it87_remove(struct platform_device *pdev___0 ) { struct it87_data *data ; void *tmp ; { tmp = dev_get_drvdata(& pdev___0->dev); data = tmp; hwmon_device_unregister(data->hwmon_dev); sysfs_remove_group(& pdev___0->dev.kobj, & it87_group); sysfs_remove_group(& pdev___0->dev.kobj, & it87_group_opt); __release_region(& ioport_resource, data->addr, 2); dev_set_drvdata(& pdev___0->dev, (void *)0); kfree(data); return (0); } } static int it87_read_value(struct it87_data *data , u8 reg ) { unsigned char tmp ; { outb_p(reg, (int )data->addr + 0); tmp = inb_p((int )data->addr + 1); return (tmp); } } static void it87_write_value(struct it87_data *data , u8 reg , u8 value ) { { outb_p(reg, (int )data->addr + 0); outb_p(value, (int )data->addr + 1); return; } } static int it87_check_pwm(struct device *dev ) __attribute__((__section__(".devinit.text"))) ; static int it87_check_pwm(struct device *dev ) { struct it87_data *data ; void *tmp ; int tmp___0 ; int tmp___1 ; int i ; u8 pwm[3] ; int tmp___2 ; char const *tmp___3 ; char const *tmp___4 ; char const *tmp___5 ; char const *tmp___6 ; { tmp = dev_get_drvdata(dev); data = tmp; tmp___1 = it87_read_value(data, 20); tmp___0 = tmp___1; if ((tmp___0 & 135) == 0) { if (fix_pwm_polarity) { i = 0; while (1) { if (i < 3) { } else { break; } tmp___2 = it87_read_value(data, 21 + i); pwm[i] = tmp___2; i = i + 1; } if (! ((((int )pwm[0] | (int )pwm[1]) | (int )pwm[2]) & 128)) { tmp___3 = dev_driver_string(dev); printk("<6>%s %s: Reconfiguring PWM to active high polarity\n", tmp___3, dev->bus_id); it87_write_value(data, 20, tmp___0 | 135); i = 0; while (1) { if (i < 3) { } else { break; } it87_write_value(data, 21 + i, 127 & ~ ((int )pwm[i])); i = i + 1; } return (1); } else { } tmp___4 = dev_driver_string(dev); printk("<6>%s %s: PWM configuration is too broken to be fixed\n", tmp___4, dev->bus_id); } else { } tmp___5 = dev_driver_string(dev); printk("<6>%s %s: Detected broken BIOS defaults, disabling PWM interface\n", tmp___5, dev->bus_id); return (0); } else if (fix_pwm_polarity) { tmp___6 = dev_driver_string(dev); printk("<6>%s %s: PWM configuration looks sane, won\'t touch\n", tmp___6, dev->bus_id); } else { } return (1); } } static void it87_init_device(struct platform_device *pdev___0 ) __attribute__((__section__(".devinit.text"))) ; static void it87_init_device(struct platform_device *pdev___0 ) { struct it87_data *data ; void *tmp ; int tmp___0 ; int i ; int tmp___1 ; char const *tmp___2 ; int tmp___3 ; { tmp = dev_get_drvdata(& pdev___0->dev); data = tmp; i = 0; while (1) { if (i < 3) { } else { break; } data->manual_pwm_ctl[i] = 255; i = i + 1; } i = 0; while (1) { if (i < 8) { } else { break; } tmp___0 = it87_read_value(data, 49 + i * 2); if (tmp___0 == 255) { it87_write_value(data, 49 + i * 2, 0); } else { } i = i + 1; } i = 0; while (1) { if (i < 3) { } else { break; } tmp___0 = it87_read_value(data, 64 + i * 2); if (tmp___0 == 255) { it87_write_value(data, 64 + i * 2, 127); } else { } i = i + 1; } tmp___0 = it87_read_value(data, 81); if ((tmp___0 & 63) == 0) { tmp___0 = (tmp___0 & 192) | 42; it87_write_value(data, 81, tmp___0); } else { } data->sensor = tmp___0; tmp___0 = it87_read_value(data, 80); if ((tmp___0 & 255) == 0) { it87_write_value(data, 80, 255); } else { } tmp___1 = it87_read_value(data, 19); data->fan_main_ctrl = tmp___1; if (((int )data->fan_main_ctrl & 112) == 0) { data->fan_main_ctrl = (int )data->fan_main_ctrl | 112; it87_write_value(data, 19, data->fan_main_ctrl); } else { } data->has_fan = ((int )data->fan_main_ctrl >> 4) & 7; if ((unsigned int )data->type == (unsigned int )it8716 || (unsigned int )data->type == (unsigned int )it8718) { tmp___0 = it87_read_value(data, 12); if ((~ tmp___0 & 7) & (int )data->has_fan) { tmp___2 = dev_driver_string(& pdev___0->dev); printk("<7>%s %s: Setting fan1-3 to 16-bit mode\n", tmp___2, pdev___0->dev.bus_id); it87_write_value(data, 12, tmp___0 | 7); } else { } if (tmp___0 & (1 << 4)) { data->has_fan = (int )data->has_fan | (1 << 3); } else { } if (tmp___0 & (1 << 5)) { data->has_fan = (int )data->has_fan | (1 << 4); } else { } } else { } i = 0; while (1) { if (i < 3) { } else { break; } if ((int )data->fan_main_ctrl & (1 << i)) { tmp___0 = it87_read_value(data, 21 + i); if (tmp___0 & 128) { } else { data->manual_pwm_ctl[i] = (tmp___0 & 127) << 1; } } else { } i = i + 1; } tmp___3 = it87_read_value(data, 0); it87_write_value(data, 0, (tmp___3 & 54) | (update_vbat ? 65 : 1)); return; } } static struct it87_data *it87_update_device(struct device *dev ) { struct it87_data *data ; void *tmp ; int i ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; int tmp___8 ; int tmp___9 ; int tmp___10 ; int tmp___11 ; int tmp___12 ; int tmp___13 ; int tmp___14 ; int tmp___15 ; int tmp___16 ; int tmp___17 ; int tmp___18 ; { tmp = dev_get_drvdata(dev); data = tmp; mutex_lock(& data->update_lock); if ((long )((data->last_updated + 250UL) + (unsigned long )(250 / 2)) - (long )jiffies < 0L || ! data->valid) { if (update_vbat) { tmp___0 = it87_read_value(data, 0); it87_write_value(data, 0, tmp___0 | 64); } else { } i = 0; while (1) { if (i <= 7) { } else { break; } tmp___1 = it87_read_value(data, 32 + i); data->in[i] = tmp___1; tmp___2 = it87_read_value(data, 49 + i * 2); data->in_min[i] = tmp___2; tmp___3 = it87_read_value(data, 48 + i * 2); data->in_max[i] = tmp___3; i = i + 1; } tmp___4 = it87_read_value(data, 32 + 8); data->in[8] = tmp___4; i = 0; while (1) { if (i < 5) { } else { break; } if (! ((int )data->has_fan & (1 << i))) { goto __Cont; } else { } tmp___5 = it87_read_value(data, IT87_REG_FAN_MIN[i]); data->fan_min[i] = tmp___5; tmp___6 = it87_read_value(data, IT87_REG_FAN[i]); data->fan[i] = tmp___6; if ((unsigned int )data->type == (unsigned int )it8716 || (unsigned int )data->type == (unsigned int )it8718) { tmp___7 = it87_read_value(data, IT87_REG_FANX[i]); data->fan[i] = (int )data->fan[i] | (tmp___7 << 8); tmp___8 = it87_read_value(data, IT87_REG_FANX_MIN[i]); data->fan_min[i] = (int )data->fan_min[i] | (tmp___8 << 8); } else { } __Cont: /* CIL Label */ i = i + 1; } i = 0; while (1) { if (i < 3) { } else { break; } tmp___9 = it87_read_value(data, 41 + i); data->temp[i] = tmp___9; tmp___10 = it87_read_value(data, 64 + i * 2); data->temp_high[i] = tmp___10; tmp___11 = it87_read_value(data, 65 + i * 2); data->temp_low[i] = tmp___11; i = i + 1; } if (((int )data->has_fan & 7 && (unsigned int )data->type != (unsigned int )it8716) && (unsigned int )data->type != (unsigned int )it8718) { i = it87_read_value(data, 11); data->fan_div[0] = i & 7; data->fan_div[1] = (i >> 3) & 7; data->fan_div[2] = i & 64 ? 3 : 1; } else { } tmp___12 = it87_read_value(data, 1); tmp___13 = it87_read_value(data, 2); tmp___14 = it87_read_value(data, 3); data->alarms = (tmp___12 | (tmp___13 << 8)) | (tmp___14 << 16); tmp___15 = it87_read_value(data, 19); data->fan_main_ctrl = tmp___15; tmp___16 = it87_read_value(data, 20); data->fan_ctl = tmp___16; tmp___17 = it87_read_value(data, 81); data->sensor = tmp___17; if ((unsigned int )data->type == (unsigned int )it8712 || (unsigned int )data->type == (unsigned int )it8716) { tmp___18 = it87_read_value(data, 10); data->vid = tmp___18; data->vid = (int )data->vid & 63; } else { } data->last_updated = jiffies; data->valid = 1; } else { } mutex_unlock(& data->update_lock); return (data); } } static int it87_device_add(unsigned short address , struct it87_sio_data const *sio_data ) __attribute__((__section__(".init.text"))) ; static int it87_device_add(unsigned short address , struct it87_sio_data const *sio_data ) { struct resource res ; int err ; { res.start = (int )address + 5; res.end = (((int )address + 5) + 2) - 1; res.name = "it87"; res.flags = 256; res.parent = 0; res.sibling = 0; res.child = 0; pdev = platform_device_alloc("it87", address); if (! pdev) { err = -12; printk("<3>it87: Device allocation failed\n"); goto exit; } else { } err = platform_device_add_resources(pdev, & res, 1); if (err) { printk("<3>it87: Device resource addition failed (%d)\n", err); goto exit_device_put; } else { } err = platform_device_add_data(pdev, sio_data, sizeof(struct it87_sio_data )); if (err) { printk("<3>it87: Platform data allocation failed\n"); goto exit_device_put; } else { } err = platform_device_add(pdev); if (err) { printk("<3>it87: Device addition failed (%d)\n", err); goto exit_device_put; } else { } return (0); exit_device_put: platform_device_put(pdev); exit: return (err); } } static int sm_it87_init(void) __attribute__((__section__(".init.text"))) ; static int sm_it87_init(void) { int err ; unsigned short isa_address ; struct it87_sio_data sio_data ; { isa_address = 0; err = it87_find(& isa_address, & sio_data); if (err) { return (err); } else { } err = platform_driver_register(& it87_driver); if (err) { return (err); } else { } err = it87_device_add(isa_address, & sio_data); if (err) { platform_driver_unregister(& it87_driver); return (err); } else { } return (0); } } static void sm_it87_exit(void) __attribute__((__section__(".exit.text"))) ; static void sm_it87_exit(void) { { platform_device_unregister(pdev); platform_driver_unregister(& it87_driver); return; } } static char const __mod_author1497[75] __attribute__((__used__, __unused__, __section__(".modinfo"))) = { 'a', 'u', 't', 'h', 'o', 'r', '=', 'C', 'h', 'r', 'i', 's', ' ', 'G', 'a', 'u', 't', 'h', 'r', 'o', 'n', ' ', '<', 'c', 'h', 'r', 'i', 's', 'g', '@', '0', '-', 'i', 'n', '.', 'c', 'o', 'm', '>', ',', ' ', 'J', 'e', 'a', 'n', ' ', 'D', 'e', 'l', 'v', 'a', 'r', 'e', ' ', '<', 'k', 'h', 'a', 'l', 'i', '@', 'l', 'i', 'n', 'u', 'x', '-', 'f', 'r', '.', 'o', 'r', 'g', '>', '\000'}; static char const __mod_description1498[59] __attribute__((__used__, __unused__, __section__(".modinfo"))) = { 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'i', 'o', 'n', '=', 'I', 'T', '8', '7', '0', '5', 'F', '/', '8', '7', '1', '2', 'F', '/', '8', '7', '1', '6', 'F', '/', '8', '7', '1', '8', 'F', '/', '8', '7', '2', '6', 'F', ',', ' ', 'S', 'i', 'S', '9', '5', '0', ' ', 'd', 'r', 'i', 'v', 'e', 'r', '\000'}; static char const __param_str_update_vbat[12] = { 'u', 'p', 'd', 'a', 't', 'e', '_', 'v', 'b', 'a', 't', '\000'}; static struct kernel_param const __param_update_vbat __attribute__((__used__, __unused__, __section__("__param"), __aligned__(sizeof(void *)))) = {__param_str_update_vbat, 0, & param_set_bool, & param_get_bool, {& update_vbat}}; static char const __mod_update_vbattype1499[26] __attribute__((__used__, __unused__, __section__(".modinfo"))) = { 'p', 'a', 'r', 'm', 't', 'y', 'p', 'e', '=', 'u', 'p', 'd', 'a', 't', 'e', '_', 'v', 'b', 'a', 't', ':', 'b', 'o', 'o', 'l', '\000'}; static char const __mod_update_vbat1500[62] __attribute__((__used__, __unused__, __section__(".modinfo"))) = { 'p', 'a', 'r', 'm', '=', 'u', 'p', 'd', 'a', 't', 'e', '_', 'v', 'b', 'a', 't', ':', 'U', 'p', 'd', 'a', 't', 'e', ' ', 'v', 'b', 'a', 't', ' ', 'i', 'f', ' ', 's', 'e', 't', ' ', 'e', 'l', 's', 'e', ' ', 'r', 'e', 't', 'u', 'r', 'n', ' ', 'p', 'o', 'w', 'e', 'r', 'u', 'p', ' ', 'v', 'a', 'l', 'u', 'e', '\000'}; static char const __param_str_fix_pwm_polarity[17] = { 'f', 'i', 'x', '_', 'p', 'w', 'm', '_', 'p', 'o', 'l', 'a', 'r', 'i', 't', 'y', '\000'}; static struct kernel_param const __param_fix_pwm_polarity __attribute__((__used__, __unused__, __section__("__param"), __aligned__(sizeof(void *)))) = {__param_str_fix_pwm_polarity, 0, & param_set_bool, & param_get_bool, {& fix_pwm_polarity}}; static char const __mod_fix_pwm_polaritytype1501[31] __attribute__((__used__, __unused__, __section__(".modinfo"))) = { 'p', 'a', 'r', 'm', 't', 'y', 'p', 'e', '=', 'f', 'i', 'x', '_', 'p', 'w', 'm', '_', 'p', 'o', 'l', 'a', 'r', 'i', 't', 'y', ':', 'b', 'o', 'o', 'l', '\000'}; static char const __mod_fix_pwm_polarity1502[68] __attribute__((__used__, __unused__, __section__(".modinfo"))) = { 'p', 'a', 'r', 'm', '=', 'f', 'i', 'x', '_', 'p', 'w', 'm', '_', 'p', 'o', 'l', 'a', 'r', 'i', 't', 'y', ':', 'F', 'o', 'r', 'c', 'e', ' ', 'P', 'W', 'M', ' ', 'p', 'o', 'l', 'a', 'r', 'i', 't', 'y', ' ', 't', 'o', ' ', 'a', 'c', 't', 'i', 'v', 'e', ' ', 'h', 'i', 'g', 'h', ' ', '(', 'D', 'A', 'N', 'G', 'E', 'R', 'O', 'U', 'S', ')', '\000'}; static char const __mod_license1503[12] __attribute__((__used__, __unused__, __section__(".modinfo"))) = { 'l', 'i', 'c', 'e', 'n', 's', 'e', '=', 'G', 'P', 'L', '\000'}; int init_module(void) { int tmp ; { tmp = sm_it87_init(); return (tmp); } } void cleanup_module(void) { { sm_it87_exit(); return; } } void ldv_check_final_state(void) ; extern void ldv_check_return_value(int res ) ; extern void ldv_check_return_value_probe(int res ) ; extern void ldv_initialize(void) ; extern void ldv_handler_precall(void) ; extern int nondet_int(void) ; int LDV_IN_INTERRUPT ; static int res_it87_probe_40 ; int main(void) { struct platform_device *var_group1 ; int tmp ; int ldv_s_it87_driver_platform_driver ; int tmp___0 ; int tmp___1 ; { LDV_IN_INTERRUPT = 1; ldv_initialize(); ldv_handler_precall(); tmp = sm_it87_init(); if (tmp) { goto ldv_final; } else { } ldv_s_it87_driver_platform_driver = 0; while (1) { tmp___1 = nondet_int(); if (tmp___1 || ! (ldv_s_it87_driver_platform_driver == 0)) { } else { break; } tmp___0 = nondet_int(); switch (tmp___0) { case 0: if (ldv_s_it87_driver_platform_driver == 0) { res_it87_probe_40 = it87_probe(var_group1); ldv_check_return_value(res_it87_probe_40); ldv_check_return_value_probe(res_it87_probe_40); if (res_it87_probe_40) { goto ldv_module_exit; } else { } ldv_s_it87_driver_platform_driver = ldv_s_it87_driver_platform_driver + 1; } else { } break; case 1: if (ldv_s_it87_driver_platform_driver == 1) { ldv_handler_precall(); it87_remove(var_group1); ldv_s_it87_driver_platform_driver = 0; } else { } break; default: break; } } ldv_module_exit: ldv_handler_precall(); sm_it87_exit(); ldv_final: ldv_check_final_state(); return 0; } } int ( __attribute__((__warn_unused_result__)) mutex_lock_interruptible)(struct mutex *lock ) ; int ( __attribute__((__warn_unused_result__)) mutex_lock_killable)(struct mutex *lock ) ; int mutex_trylock(struct mutex *lock ) ; __inline static void ( __attribute__((__always_inline__)) ldv_error)(void) { { LDV_ERROR: {reach_error();abort();} } } extern int ldv_undef_int(void) ; long ldv__builtin_expect(long exp , long c ) { { return (exp); } } int ldv_mutex = 1; int ( __attribute__((__warn_unused_result__)) mutex_lock_interruptible)(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex == 1) { } else { ldv_error(); } nondetermined = ldv_undef_int(); if (nondetermined) { ldv_mutex = 2; return (0); } else { return (-4); } } } int ( __attribute__((__warn_unused_result__)) mutex_lock_killable)(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex == 1) { } else { ldv_error(); } nondetermined = ldv_undef_int(); if (nondetermined) { ldv_mutex = 2; return (0); } else { return (-4); } } } int atomic_dec_and_mutex_lock(atomic_t *cnt , struct mutex *lock ) { int atomic_value_after_dec ; { if (ldv_mutex == 1) { } else { ldv_error(); } atomic_value_after_dec = ldv_undef_int(); if (atomic_value_after_dec == 0) { ldv_mutex = 2; return (1); } else { } return (0); } } void mutex_lock(struct mutex *lock ) { { if (ldv_mutex == 1) { } else { ldv_error(); } ldv_mutex = 2; return; } } int mutex_trylock(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex == 1) { } else { ldv_error(); } nondetermined = ldv_undef_int(); if (nondetermined) { ldv_mutex = 2; return (1); } else { return (0); } } } void mutex_unlock(struct mutex *lock ) { { if (ldv_mutex == 2) { } else { ldv_error(); } ldv_mutex = 1; return; } } void ldv_check_final_state(void) { { if (ldv_mutex == 1) { } else { ldv_error(); } return; } }