In January 2007 , Kodak ended a long-standing patent dispute with Sony over digital-camera inventions dating back to 1987 and entered a cross-licensing deal giving the companies access to each other 's patents .